Tracepoints: add provider mismatch check
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 11 Nov 2011 17:46:23 +0000 (12:46 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 11 Nov 2011 17:46:23 +0000 (12:46 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-tracepoint-event.h

index a60149e05c1c54428787999289c46a9abe3113a9..eb2e76a76224b1f732d122c2c5e7e71d9935e547 100644 (file)
                __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 <lttng/ust-tracepoint-event-reset.h>
+
+#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.
This page took 0.030091 seconds and 4 git commands to generate.