From: Mathieu Desnoyers Date: Mon, 26 Nov 2012 20:14:24 +0000 (-0500) Subject: Print probe provider mismatch error even without -Wsystem-headers X-Git-Tag: v2.0.6~1 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f7f70ed72bb10703c55f812871100d86f1dc9b47;p=lttng-ust.git Print probe provider mismatch error even without -Wsystem-headers Suggested-by: David OShea Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 78d85af2..5f687090 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -112,7 +112,7 @@ void _TP_COMBINE_TOKENS(__tracepoint_provider_mismatch_, TRACEPOINT_PROVIDER)(vo #define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \ __tracepoint_provider_mismatch_##_provider(); -static __attribute__((unused)) +static inline void _TP_COMBINE_TOKENS(__tracepoint_provider_check_, TRACEPOINT_PROVIDER)(void) { #include TRACEPOINT_INCLUDE @@ -551,6 +551,15 @@ _TP_COMBINE_TOKENS(__lttng_events_init__, TRACEPOINT_PROVIDER)(void) { int ret; + /* + * __tracepoint_provider_check_ ## TRACEPOINT_PROVIDER() is a + * static inline function that ensures every probe PROVIDER + * argument match the provider within which they appear. It + * calls empty static inline functions, and therefore has no + * runtime effect. However, if it detects an error, a linker + * error will appear. + */ + _TP_COMBINE_TOKENS(__tracepoint_provider_check_, TRACEPOINT_PROVIDER)(); ret = ltt_probe_register(&_TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PROVIDER)); assert(!ret); }