From: Mathieu Desnoyers Date: Mon, 4 Apr 2022 19:55:07 +0000 (-0400) Subject: Cleanup: tracepoint event: use different prefixes for provider and event descriptors X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0997899b47dda080f4f9346b5d4f66ad60bee700;p=lttng-ust.git Cleanup: tracepoint event: use different prefixes for provider and event descriptors Prefix the provider array of descriptor identifier with "lttng_ust__provider_event_desc___" to distinguish it from the event descriptor identifier. This does not cause any conflict even when the event has the same name as the provider because the provider is included in the event name. But providing different prefixes is cleaner. Signed-off-by: Mathieu Desnoyers Change-Id: If8b38d2765de61fd59558fe7c6223d1fdbb3349b --- diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 1edb50c1..86098a98 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -1136,7 +1136,7 @@ static const struct lttng_ust_event_desc lttng_ust__event_desc___##_provider##_# #define LTTNG_UST__TRACEPOINT_EVENT_INSTANCE(_template_provider, _template_name, _provider, _name, _args) \ <tng_ust__event_desc___##_provider##_##_name, -static const struct lttng_ust_event_desc * const LTTNG_UST__TP_COMBINE_TOKENS(lttng_ust__event_desc___, LTTNG_UST_TRACEPOINT_PROVIDER)[] = { +static const struct lttng_ust_event_desc * const LTTNG_UST__TP_COMBINE_TOKENS(lttng_ust__provider_event_desc___, LTTNG_UST_TRACEPOINT_PROVIDER)[] = { #include LTTNG_UST_TRACEPOINT_INCLUDE NULL, /* Dummy, C99 forbids 0-len array. */ }; @@ -1151,8 +1151,8 @@ static const struct lttng_ust_event_desc * const LTTNG_UST__TP_COMBINE_TOKENS(lt const struct lttng_ust_probe_desc LTTNG_UST__TP_COMBINE_TOKENS(lttng_ust__probe_desc___, LTTNG_UST_TRACEPOINT_PROVIDER) = { .struct_size = sizeof(struct lttng_ust_probe_desc), .provider_name = lttng_ust__tp_stringify(LTTNG_UST_TRACEPOINT_PROVIDER), - .event_desc = LTTNG_UST__TP_COMBINE_TOKENS(lttng_ust__event_desc___, LTTNG_UST_TRACEPOINT_PROVIDER), - .nr_events = LTTNG_UST__TP_ARRAY_SIZE(LTTNG_UST__TP_COMBINE_TOKENS(lttng_ust__event_desc___, LTTNG_UST_TRACEPOINT_PROVIDER)) - 1, + .event_desc = LTTNG_UST__TP_COMBINE_TOKENS(lttng_ust__provider_event_desc___, LTTNG_UST_TRACEPOINT_PROVIDER), + .nr_events = LTTNG_UST__TP_ARRAY_SIZE(LTTNG_UST__TP_COMBINE_TOKENS(lttng_ust__provider_event_desc___, LTTNG_UST_TRACEPOINT_PROVIDER)) - 1, .major = LTTNG_UST_PROVIDER_MAJOR, .minor = LTTNG_UST_PROVIDER_MINOR, };