From: Mathieu Desnoyers Date: Tue, 10 Jun 2014 16:17:08 +0000 (-0400) Subject: Fix: multiple providers in same C file failure X-Git-Tag: v2.5.0-rc2~4 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a57713b01d6da30f52bfd564b279e7b3901ecdc9;p=lttng-ust.git Fix: multiple providers in same C file failure 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 --- diff --git a/include/lttng/tracepoint-event.h b/include/lttng/tracepoint-event.h index c1ca31c8..a12b758b 100644 --- a/include/lttng/tracepoint-event.h +++ b/include/lttng/tracepoint-event.h @@ -63,4 +63,30 @@ #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 */