+ * Create probe signature
+ */
+
+/* Reset all macros within TRACEPOINT_EVENT */
+#include <lttng/ust-tracepoint-event-reset.h>
+
+#undef TP_ARGS
+#define TP_ARGS(...) __VA_ARGS__
+
+#define _TP_EXTRACT_STRING2(...) #__VA_ARGS__
+
+#undef TRACEPOINT_EVENT_CLASS
+#define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
+const char __tp_event_signature___##_provider##___##_name[] = \
+ _TP_EXTRACT_STRING2(_args);
+
+#include TRACEPOINT_INCLUDE
+
+#undef _TP_EXTRACT_STRING2
+
+/*
+ * Stage 6 of tracepoint event generation.
+ *
+ * Tracepoint loglevel mapping definition generation. We generate a
+ * symbol for each mapping for a provider/event to ensure at most a 1 to
+ * 1 mapping between events and loglevels. If the symbol is repeated,
+ * the compiler will complain.
+ */
+
+/* Reset all macros within TRACEPOINT_EVENT */
+#include <lttng/ust-tracepoint-event-reset.h>
+
+#undef TRACEPOINT_LOGLEVEL
+#define TRACEPOINT_LOGLEVEL(__provider, __name, __loglevel) \
+static const int _loglevel_value___##__provider##___##__name = __loglevel; \
+static const int *_loglevel___##__provider##___##__name = \
+ &_loglevel_value___##__provider##___##__name;
+
+#include TRACEPOINT_INCLUDE
+
+/*
+ * Stage 7.1 of tracepoint event generation.
+ *
+ * Create events description structures. We use a weakref because
+ * loglevels are optional. If not declared, the event will point to the
+ * a loglevel that contains NULL.
+ */
+
+/* Reset all macros within TRACEPOINT_EVENT */
+#include <lttng/ust-tracepoint-event-reset.h>
+
+#undef TRACEPOINT_EVENT_INSTANCE
+#define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \
+static const int * \
+ __ref_loglevel___##_provider##___##_name \
+ __attribute__((weakref ("_loglevel___" #_provider "___" #_name))); \
+const struct lttng_event_desc __event_desc___##_provider##_##_name = { \
+ .fields = __event_fields___##_provider##___##_template, \
+ .name = #_provider ":" #_name, \
+ .probe_callback = (void (*)(void)) &__event_probe__##_provider##___##_template,\
+ .nr_fields = _TP_ARRAY_SIZE(__event_fields___##_provider##___##_template), \
+ .loglevel = &__ref_loglevel___##_provider##___##_name, \
+ .signature = __tp_event_signature___##_provider##___##_template, \
+};
+
+#include TRACEPOINT_INCLUDE
+
+/*
+ * Stage 7.2 of tracepoint event generation.
+ *
+ * Create array of events.