+#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>
+
+/*
+ * Declare _loglevel___##__provider##___##__name as non-static, with
+ * hidden visibility for c++ handling of weakref. We do a weakref to the
+ * symbol in a later stage, which requires that the symbol is not
+ * mangled.
+ */
+#ifdef __cplusplus
+#define LTTNG_TP_EXTERN_C extern "C"
+#else
+#define LTTNG_TP_EXTERN_C
+#endif
+
+#undef TRACEPOINT_LOGLEVEL
+#define TRACEPOINT_LOGLEVEL(__provider, __name, __loglevel) \
+static const int _loglevel_value___##__provider##___##__name = __loglevel; \
+LTTNG_TP_EXTERN_C const int *_loglevel___##__provider##___##__name \
+ __attribute__((visibility("hidden"))) = \
+ &_loglevel_value___##__provider##___##__name;
+
+#include TRACEPOINT_INCLUDE
+
+#ifdef __cplusplus
+#undef LTTNG_TP_EXTERN_C
+#endif
+
+/*
+ * Stage 6.1 of tracepoint event generation.
+ *
+ * Tracepoint UML URI info.
+ */
+
+/* Reset all macros within TRACEPOINT_EVENT */
+#include <lttng/ust-tracepoint-event-reset.h>
+
+/*
+ * Declare _model_emf_uri___##__provider##___##__name as non-static,
+ * with hidden visibility for c++ handling of weakref. We do a weakref
+ * to the symbol in a later stage, which requires that the symbol is not
+ * mangled.
+ */
+#ifdef __cplusplus
+#define LTTNG_TP_EXTERN_C extern "C"
+#else
+#define LTTNG_TP_EXTERN_C
+#endif
+
+#undef TRACEPOINT_MODEL_EMF_URI
+#define TRACEPOINT_MODEL_EMF_URI(__provider, __name, __uri) \
+LTTNG_TP_EXTERN_C const char *_model_emf_uri___##__provider##___##__name \
+ __attribute__((visibility("hidden"))) = __uri \
+
+#include TRACEPOINT_INCLUDE
+
+#ifdef __cplusplus
+#undef LTTNG_TP_EXTERN_C
+#endif
+
+/*
+ * 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))); \
+static const char * \
+ __ref_model_emf_uri___##_provider##___##_name \
+ __attribute__((weakref ("_model_emf_uri___" #_provider "___" #_name)));\
+static const struct lttng_event_desc __event_desc___##_provider##_##_name = { \
+ .name = #_provider ":" #_name, \
+ .probe_callback = (void (*)(void)) &__event_probe__##_provider##___##_template,\
+ .ctx = NULL, \
+ .fields = __event_fields___##_provider##___##_template, \
+ .nr_fields = _TP_ARRAY_SIZE(__event_fields___##_provider##___##_template) - 1, \
+ .loglevel = &__ref_loglevel___##_provider##___##_name, \
+ .signature = __tp_event_signature___##_provider##___##_template, \
+ .u = { \
+ .ext = { \
+ .model_emf_uri = &__ref_model_emf_uri___##_provider##___##_name, \
+ }, \
+ }, \
+};
+
+#include TRACEPOINT_INCLUDE
+
+/*
+ * Stage 7.2 of tracepoint event generation.
+ *
+ * Create array of events.
+ */
+
+/* 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) \
+ &__event_desc___##_provider##_##_name,
+
+static const struct lttng_event_desc *_TP_COMBINE_TOKENS(__event_desc___, TRACEPOINT_PROVIDER)[] = {
+#include TRACEPOINT_INCLUDE
+ NULL, /* Dummy, C99 forbids 0-len array. */
+};
+
+
+/*
+ * Stage 8 of tracepoint event generation.
+ *
+ * Create a toplevel descriptor for the whole probe.
+ */
+
+/* non-const because list head will be modified when registered. */
+static struct lttng_probe_desc _TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PROVIDER) = {
+ .provider = __tp_stringify(TRACEPOINT_PROVIDER),
+ .event_desc = _TP_COMBINE_TOKENS(__event_desc___, TRACEPOINT_PROVIDER),
+ .nr_events = _TP_ARRAY_SIZE(_TP_COMBINE_TOKENS(__event_desc___, TRACEPOINT_PROVIDER)) - 1,
+ .head = { NULL, NULL },
+ .lazy_init_head = { NULL, NULL },
+ .lazy = 0,
+ .major = LTTNG_UST_PROVIDER_MAJOR,
+ .minor = LTTNG_UST_PROVIDER_MINOR,
+};
+
+static int _TP_COMBINE_TOKENS(__probe_register_refcount___, TRACEPOINT_PROVIDER);
+
+/*
+ * Stage 9 of tracepoint event generation.
+ *
+ * Register/unregister probes at module load/unload.
+ *
+ * Generate the constructor as an externally visible symbol for use when
+ * linking the probe statically.
+ *
+ * Register refcount is protected by libc dynamic loader mutex.
+ */
+
+/* Reset all macros within TRACEPOINT_EVENT */
+#include <lttng/ust-tracepoint-event-reset.h>
+static void lttng_ust_notrace __attribute__((constructor))
+_TP_COMBINE_TOKENS(__lttng_events_init__, TRACEPOINT_PROVIDER)(void);
+static void
+_TP_COMBINE_TOKENS(__lttng_events_init__, TRACEPOINT_PROVIDER)(void)