+/*
+ * 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
+
+#undef LTTNG_TP_EXTERN_C
+
+/*
+ * Stage 7.0 of tracepoint event generation.
+ *
+ * Declare toplevel descriptor for the whole probe.
+ * Unlike C, C++ does not allow tentative definitions. Therefore, we
+ * need to explicitly declare the variable with "extern", using hidden
+ * visibility to keep this symbol from being exported to the global
+ * symbol table.
+ */
+
+extern const struct lttng_ust_probe_desc _TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PROVIDER)
+ __attribute__((visibility("hidden")));
+
+/*
+ * 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_ust_event_desc __event_desc___##_provider##_##_name = { \
+ .struct_size = sizeof(struct lttng_ust_event_desc), \
+ .event_name = #_name, \
+ .probe_desc = &__probe_desc___##_provider, \
+ .probe_callback = (void (*)(void)) &__event_probe__##_provider##___##_template, \
+ .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, \
+ .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_ust_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.
+ */
+
+const struct lttng_ust_probe_desc _TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PROVIDER) = {
+ .struct_size = sizeof(struct lttng_ust_probe_desc),
+ .provider_name = __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,
+ .major = LTTNG_UST_PROVIDER_MAJOR,
+ .minor = LTTNG_UST_PROVIDER_MINOR,
+};
+
+static int _TP_COMBINE_TOKENS(__probe_register_refcount___, TRACEPOINT_PROVIDER);
+static struct lttng_ust_registered_probe *_TP_COMBINE_TOKENS(__lttng_ust_probe_register_cookie___, 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
+_TP_COMBINE_TOKENS(__lttng_events_init__, TRACEPOINT_PROVIDER)(void)
+ lttng_ust_notrace __attribute__((constructor));
+static void
+_TP_COMBINE_TOKENS(__lttng_events_init__, TRACEPOINT_PROVIDER)(void)