From: Mathieu Desnoyers Date: Mon, 4 Apr 2022 19:49:32 +0000 (-0400) Subject: Fix: tracepoint event: allow same provider and event name X-Git-Tag: v2.13.4~15 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c680fdeed4f47912fb10f604812d90b37591b5a7;p=lttng-modules.git Fix: tracepoint event: allow same provider and event name Using the same name for the provider (TRACE_SYSTEM) and event name causes a compilation error because the same identifiers are emitted twice. Fix this by prefixing the provider identifier with "__provider_event_desc___". Signed-off-by: Mathieu Desnoyers Change-Id: I8cdf8f859e35b8bd5c19737860d12f1ed546dfc2 --- diff --git a/include/lttng/tracepoint-event-impl.h b/include/lttng/tracepoint-event-impl.h index 38b1dc43..dcb22247 100644 --- a/include/lttng/tracepoint-event-impl.h +++ b/include/lttng/tracepoint-event-impl.h @@ -1255,7 +1255,7 @@ static const struct lttng_kernel_event_desc __event_desc___##_map = { \ #define TP_ID1(_token, _system) _token##_system #define TP_ID(_token, _system) TP_ID1(_token, _system) -static const struct lttng_kernel_event_desc * const TP_ID(__event_desc___, TRACE_SYSTEM)[] = { +static const struct lttng_kernel_event_desc * const TP_ID(__provider_event_desc___, TRACE_SYSTEM)[] = { #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) }; @@ -1274,8 +1274,8 @@ static const struct lttng_kernel_event_desc * const TP_ID(__event_desc___, TRACE /* non-const because list head will be modified when registered. */ static __used struct lttng_kernel_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = { .provider_name = __stringify(TRACE_SYSTEM), - .event_desc = TP_ID(__event_desc___, TRACE_SYSTEM), - .nr_events = ARRAY_SIZE(TP_ID(__event_desc___, TRACE_SYSTEM)), + .event_desc = TP_ID(__provider_event_desc___, TRACE_SYSTEM), + .nr_events = ARRAY_SIZE(TP_ID(__provider_event_desc___, TRACE_SYSTEM)), .head = { NULL, NULL }, .lazy_init_head = { NULL, NULL }, .lazy = 0,