+/*
+ * LTTng name mapping macros. LTTng remaps some of the kernel events to
+ * enforce name-spacing.
+ */
+#undef LTTNG_TRACEPOINT_EVENT_MAP
+#define LTTNG_TRACEPOINT_EVENT_MAP(name, map, proto, args, tstruct, assign, print) \
+ LTTNG_TRACEPOINT_EVENT_CLASS(map, \
+ PARAMS(proto), \
+ PARAMS(args), \
+ PARAMS(tstruct), \
+ PARAMS(assign), \
+ PARAMS(print)) \
+ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(map, name, map, PARAMS(proto), PARAMS(args))
+
+#undef LTTNG_TRACEPOINT_EVENT_MAP_NOARGS
+#define LTTNG_TRACEPOINT_EVENT_MAP_NOARGS(name, map, tstruct, assign, print) \
+ LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(map, \
+ PARAMS(tstruct), \
+ PARAMS(assign), \
+ PARAMS(print)) \
+ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS(map, name, map)
+
+#undef LTTNG_TRACEPOINT_EVENT_CODE
+#define LTTNG_TRACEPOINT_EVENT_CODE(name, proto, args, _locvar, _code, tstruct, assign, print) \
+ LTTNG_TRACEPOINT_EVENT_CLASS_CODE(name, \
+ PARAMS(proto), \
+ PARAMS(args), \
+ PARAMS(_locvar), \
+ PARAMS(_code), \
+ PARAMS(tstruct), \
+ PARAMS(assign), \
+ PARAMS(print)) \
+ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(name, name, name, PARAMS(proto), PARAMS(args))
+
+
+#undef LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT_MAP
+#define LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT_MAP(template, name, map, proto, args, print) \
+ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(template, name, map, PARAMS(proto), PARAMS(args))
+
+/* Callbacks are meaningless to LTTng. */
+#undef LTTNG_TRACEPOINT_EVENT_FN_MAP
+#define LTTNG_TRACEPOINT_EVENT_FN_MAP(name, map, proto, args, tstruct, \
+ assign, print, reg, unreg) \
+ LTTNG_TRACEPOINT_EVENT_MAP(name, map, PARAMS(proto), PARAMS(args), \
+ PARAMS(tstruct), PARAMS(assign), PARAMS(print))
+
+#undef LTTNG_TRACEPOINT_EVENT_CONDITION_MAP
+#define LTTNG_TRACEPOINT_EVENT_CONDITION_MAP(name, map, proto, args, cond, tstruct, assign, print) \
+ LTTNG_TRACEPOINT_EVENT_MAP(name, map, \
+ PARAMS(proto), \
+ PARAMS(args), \
+ PARAMS(tstruct), \
+ PARAMS(assign), \
+ PARAMS(print))
+
+#undef LTTNG_TRACEPOINT_EVENT_INSTANCE_CONDITION_MAP
+#define LTTNG_TRACEPOINT_EVENT_INSTANCE_CONDITION_MAP(template, name, map, proto, args, cond) \
+ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(template, name, map, PARAMS(proto), PARAMS(args))
+
+/*
+ * LTTNG_TRACEPOINT_EVENT_CLASS can be used to add a generic function
+ * handlers for events. That is, if all events have the same parameters
+ * and just have distinct trace points. Each tracepoint can be defined
+ * with LTTNG_TRACEPOINT_EVENT_INSTANCE and that will map the
+ * LTTNG_TRACEPOINT_EVENT_CLASS to the tracepoint.
+ *
+ * LTTNG_TRACEPOINT_EVENT is a one to one mapping between tracepoint and
+ * template.
+ */
+
+#undef LTTNG_TRACEPOINT_EVENT
+#define LTTNG_TRACEPOINT_EVENT(name, proto, args, tstruct, assign, print) \
+ LTTNG_TRACEPOINT_EVENT_MAP(name, name, \
+ PARAMS(proto), \
+ PARAMS(args), \
+ PARAMS(tstruct), \
+ PARAMS(assign), \
+ PARAMS(print))
+
+#undef LTTNG_TRACEPOINT_EVENT_NOARGS
+#define LTTNG_TRACEPOINT_EVENT_NOARGS(name, tstruct, assign, print) \
+ LTTNG_TRACEPOINT_EVENT_MAP_NOARGS(name, name, \
+ PARAMS(tstruct), \
+ PARAMS(assign), \
+ PARAMS(print))
+
+#undef LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT
+#define LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT(template, name, proto, args, print) \
+ LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT_MAP(template, name, name, \
+ PARAMS(proto), PARAMS(args), PARAMS(print_))
+
+#undef LTTNG_TRACEPOINT_EVENT_FN
+#define LTTNG_TRACEPOINT_EVENT_FN(name, proto, args, tstruct, \
+ assign, print, reg, unreg) \
+ LTTNG_TRACEPOINT_EVENT_FN_MAP(name, name, PARAMS(proto), PARAMS(args), \
+ PARAMS(tstruct), PARAMS(assign), PARAMS(print), \
+ PARAMS(reg), PARAMS(unreg)) \
+
+#undef LTTNG_TRACEPOINT_EVENT_INSTANCE
+#define LTTNG_TRACEPOINT_EVENT_INSTANCE(template, name, proto, args) \
+ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(template, name, name, PARAMS(proto), PARAMS(args))
+
+#undef LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS
+#define LTTNG_TRACEPOINT_EVENT_INSTANCE_NOARGS(template, name) \
+ LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP_NOARGS(template, name, name)
+
+#undef LTTNG_TRACEPOINT_EVENT_CONDITION
+#define LTTNG_TRACEPOINT_EVENT_CONDITION(name, proto, args, cond, tstruct, assign, print) \
+ LTTNG_TRACEPOINT_EVENT_CONDITION_MAP(name, name, \
+ PARAMS(proto), \
+ PARAMS(args), \
+ PARAMS(cond), \
+ PARAMS(tstruct), \
+ PARAMS(assign), \
+ PARAMS(print))
+
+#undef LTTNG_TRACEPOINT_EVENT_CLASS
+#define LTTNG_TRACEPOINT_EVENT_CLASS(_name, _proto, _args, _tstruct, _assign, _print) \
+ LTTNG_TRACEPOINT_EVENT_CLASS_CODE(_name, PARAMS(_proto), PARAMS(_args), , , \
+ PARAMS(_tstruct), PARAMS(_assign), PARAMS(_print))
+
+#undef LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS
+#define LTTNG_TRACEPOINT_EVENT_CLASS_NOARGS(_name, _tstruct, _assign, _print) \
+ LTTNG_TRACEPOINT_EVENT_CLASS_CODE_NOARGS(_name, , , PARAMS(_tstruct), \
+ PARAMS(_assign), PARAMS(_print))