+#define TRACE_EVENT(name, proto, args, tstruct, assign, print) \
+ TRACE_EVENT_MAP(name, name, \
+ PARAMS(proto), \
+ PARAMS(args), \
+ PARAMS(tstruct), \
+ PARAMS(assign), \
+ PARAMS(print))
+
+#undef TRACE_EVENT_NOARGS
+#define TRACE_EVENT_NOARGS(name, tstruct, assign, print) \
+ TRACE_EVENT_MAP_NOARGS(name, name, \
+ PARAMS(tstruct), \
+ PARAMS(assign), \
+ PARAMS(print))
+
+#undef DEFINE_EVENT_PRINT
+#define DEFINE_EVENT_PRINT(template, name, proto, args, print) \
+ DEFINE_EVENT_PRINT_MAP(template, name, name, \
+ PARAMS(proto), PARAMS(args), PARAMS(print_))
+
+#undef TRACE_EVENT_FN
+#define TRACE_EVENT_FN(name, proto, args, tstruct, \
+ assign, print, reg, unreg) \
+ TRACE_EVENT_FN_MAP(name, name, PARAMS(proto), PARAMS(args), \
+ PARAMS(tstruct), PARAMS(assign), PARAMS(print), \
+ PARAMS(reg), PARAMS(unreg)) \
+
+#undef DEFINE_EVENT
+#define DEFINE_EVENT(template, name, proto, args) \
+ DEFINE_EVENT_MAP(template, name, name, PARAMS(proto), PARAMS(args))
+
+#undef DEFINE_EVENT_NOARGS
+#define DEFINE_EVENT_NOARGS(template, name) \
+ DEFINE_EVENT_MAP_NOARGS(template, name, name)
+
+#undef TRACE_EVENT_CONDITION
+#define TRACE_EVENT_CONDITION(name, proto, args, cond, tstruct, assign, print) \
+ TRACE_EVENT_CONDITION_MAP(name, name, \
+ PARAMS(proto), \
+ PARAMS(args), \
+ PARAMS(cond), \
+ PARAMS(tstruct), \
+ PARAMS(assign), \
+ PARAMS(print))
+
+/*
+ * Stage 1 of the trace events.
+ *
+ * Create dummy trace calls for each events, verifying that the LTTng module
+ * TRACE_EVENT headers match the kernel arguments. Will be optimized out by the
+ * compiler.
+ */
+
+#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */
+
+#undef TP_PROTO
+#define TP_PROTO(args...) args
+
+#undef TP_ARGS
+#define TP_ARGS(args...) args
+
+#undef DEFINE_EVENT_MAP
+#define DEFINE_EVENT_MAP(_template, _name, _map, _proto, _args) \
+void trace_##_name(_proto);
+
+#undef DEFINE_EVENT_MAP_NOARGS
+#define DEFINE_EVENT_MAP_NOARGS(_template, _name, _map) \
+void trace_##_name(void *__data);
+
+#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
+
+/*
+ * Stage 2 of the trace events.
+ *
+ * Create event field type metadata section.
+ * Each event produce an array of fields.
+ */
+
+#include "lttng-events-reset.h" /* Reset all macros within TRACE_EVENT */