#define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
static const struct lttng_event_field __event_fields___##_provider##___##_name[] = { \
_fields \
+ ctf_integer(int, dummy, 0) /* Dummy, C99 forbids 0-len array. */ \
};
#include TRACEPOINT_INCLUDE
size_t __event_len, __event_align; \
size_t __dynamic_len_idx = 0; \
union { \
- size_t __dynamic_len[_TP_ARRAY_SIZE(__event_fields___##_provider##___##_name)]; \
- char __filter_stack_data[2 * sizeof(unsigned long) * _TP_ARRAY_SIZE(__event_fields___##_provider##___##_name)]; \
+ size_t __dynamic_len[_TP_ARRAY_SIZE(__event_fields___##_provider##___##_name) - 1]; \
+ char __filter_stack_data[2 * sizeof(unsigned long) * (_TP_ARRAY_SIZE(__event_fields___##_provider##___##_name) - 1)]; \
} __stackvar; \
int __ret; \
\
.probe_callback = (void (*)(void)) &__event_probe__##_provider##___##_template,\
.ctx = NULL, \
.fields = __event_fields___##_provider##___##_template, \
- .nr_fields = _TP_ARRAY_SIZE(__event_fields___##_provider##___##_template), \
+ .nr_fields = _TP_ARRAY_SIZE(__event_fields___##_provider##___##_template) - 1, \
.loglevel = &__ref_loglevel___##_provider##___##_name, \
.signature = __tp_event_signature___##_provider##___##_template, \
.u = { .ext = { .model_emf_uri = &__ref_model_emf_uri___##_provider##___##_name } }, \
static const struct lttng_event_desc *_TP_COMBINE_TOKENS(__event_desc___, TRACEPOINT_PROVIDER)[] = {
#include TRACEPOINT_INCLUDE
+ NULL, /* Dummy, C99 forbids 0-len array. */
};
static struct lttng_probe_desc _TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PROVIDER) = {
.provider = __tp_stringify(TRACEPOINT_PROVIDER),
.event_desc = _TP_COMBINE_TOKENS(__event_desc___, TRACEPOINT_PROVIDER),
- .nr_events = _TP_ARRAY_SIZE(_TP_COMBINE_TOKENS(__event_desc___, TRACEPOINT_PROVIDER)),
+ .nr_events = _TP_ARRAY_SIZE(_TP_COMBINE_TOKENS(__event_desc___, TRACEPOINT_PROVIDER)) - 1,
.head = { NULL, NULL },
.lazy_init_head = { NULL, NULL },
.lazy = 0,