Fix: tracepoint event: allow same provider and event name
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 4 Apr 2022 19:49:32 +0000 (15:49 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 4 Apr 2022 19:52:19 +0000 (15:52 -0400)
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 <mathieu.desnoyers@efficios.com>
Change-Id: I8cdf8f859e35b8bd5c19737860d12f1ed546dfc2

probes/lttng-tracepoint-event-impl.h

index 72a669e929d91f3415f8ae72c0ea492e14958df1..53c929d86110b1295e58f179cde885cd181ed4f5 100644 (file)
@@ -1344,8 +1344,7 @@ static const struct lttng_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_event_desc *TP_ID(__event_desc___, TRACE_SYSTEM)[] = {
-#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
+static const struct lttng_event_desc *TP_ID(__provider_event_desc___, TRACE_SYSTEM)[] = {
 };
 
 #undef TP_ID1
@@ -1363,8 +1362,8 @@ static const struct lttng_event_desc *TP_ID(__event_desc___, TRACE_SYSTEM)[] = {
 /* non-const because list head will be modified when registered. */
 static __used struct lttng_probe_desc TP_ID(__probe_desc___, TRACE_SYSTEM) = {
        .provider = __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,
This page took 0.027859 seconds and 4 git commands to generate.