Fix: multiple providers in same C file failure
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 10 Jun 2014 16:17:08 +0000 (12:17 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 10 Jun 2014 16:23:16 +0000 (12:23 -0400)
If we have a C file in an application that is meant to contain both the
instrumentation and the provider, build fails if we have more than one
provider.

Fixed by putting back definitions to the state they were when defined by
tracepoint.h after a probe provider is created. This allows the next
tracepoint provider to define its tracepoints.

Fixes #805

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/tracepoint-event.h

index c1ca31c85e11a64d0f5b0b5080e08282a06cec58..a12b758b2db9ca75cd14fedb3398d422d6950952 100644 (file)
 
 #define TRACEPOINT_CREATE_PROBES
 
+/*
+ * Put back definitions to the state they were when defined by
+ * tracepoint.h.
+ */
+#undef TP_ARGS
+#define TP_ARGS(...)       __VA_ARGS__
+
+#undef TRACEPOINT_EVENT
+#define TRACEPOINT_EVENT(provider, name, args, fields)                 \
+       _DECLARE_TRACEPOINT(provider, name, _TP_PARAMS(args))           \
+       _DEFINE_TRACEPOINT(provider, name, _TP_PARAMS(args))
+
+#undef TRACEPOINT_EVENT_CLASS
+#define TRACEPOINT_EVENT_CLASS(provider, name, args, fields)
+
+#undef TRACEPOINT_EVENT_INSTANCE
+#define TRACEPOINT_EVENT_INSTANCE(provider, _template, name, args)     \
+       _DECLARE_TRACEPOINT(provider, name, _TP_PARAMS(args))           \
+       _DEFINE_TRACEPOINT(provider, name, _TP_PARAMS(args))
+
+#undef TRACEPOINT_LOGLEVEL
+#define TRACEPOINT_LOGLEVEL(provider, name, loglevel)
+
+#undef TRACEPOINT_MODEL_EMF_URI
+#define TRACEPOINT_MODEL_EMF_URI(provider, name, uri)
+
 #endif /* TRACEPOINT_CREATE_PROBES */
This page took 0.028026 seconds and 4 git commands to generate.