From: Mathieu Desnoyers Date: Fri, 11 Nov 2011 17:46:23 +0000 (-0500) Subject: Tracepoints: add provider mismatch check X-Git-Tag: v1.9.1~107 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=34a4456df042c41180bb42e468f6d4ab4bfcbced;p=lttng-ust.git Tracepoints: add provider mismatch check Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index a60149e0..eb2e76a7 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -100,6 +100,48 @@ __max1 > __max2 ? __max1: __max2; \ }) +/* + * Stage 0 of the trace events. + * + * Check that each TRACEPOINT_EVENT provider argument match the + * TRACEPOINT_PROVIDER by creating dummy callbacks. + */ + +/* Reset all macros within TRACEPOINT_EVENT */ +#include + +#define TP_ID1(_token, _provider) _token##_provider +#define TP_ID(_token, _provider) TP_ID1(_token, _provider) + +static inline +void TP_ID(__tracepoint_provider_mismatch_, TRACEPOINT_PROVIDER)(void) +{ +} + +#undef TRACEPOINT_EVENT_CLASS +#define TRACEPOINT_EVENT_CLASS(_provider, _name, _proto, _args, _fields) \ + __tracepoint_provider_mismatch_##_provider(); + +#undef TRACEPOINT_EVENT_CLASS_NOARGS +#define TRACEPOINT_EVENT_CLASS_NOARGS(_provider, _name, _fields) \ + __tracepoint_provider_mismatch_##_provider(); + +#undef TRACEPOINT_EVENT_INSTANCE +#define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _proto, _args) \ + __tracepoint_provider_mismatch_##_provider(); + +#undef TRACEPOINT_EVENT_INSTANCE_NOARGS +#define TRACEPOINT_EVENT_INSTANCE_NOARGS(_provider, _template, _name) \ + __tracepoint_provider_mismatch_##_provider(); + +static __attribute__((unused)) +void TP_ID(__tracepoint_provider_check_, TRACEPOINT_PROVIDER)(void) +{ +#include TRACEPOINT_INCLUDE(TRACEPOINT_INCLUDE_FILE) +} + +#undef TP_ID1 +#undef TP_ID /* * Stage 1 of the trace events.