tracepoint probe refactoring: Move provider name to provider descriptor
[lttng-ust.git] / include / lttng / ust-tracepoint-event.h
index 3f774d1f1178b06ad6085f9937ba61750fb0b217..fcd5303170d29babaa4fb8f3972f9df8b9ad6b3e 100644 (file)
@@ -850,10 +850,9 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args))          \
                         _TP_ARGS_DATA_VAR(_args));                           \
                __event_align = __event_get_align__##_provider##___##_name(_TP_ARGS_VAR(_args)); \
                memset(&__lttng_ctx, 0, sizeof(__lttng_ctx));                 \
-               __lttng_ctx.struct_size = sizeof(struct lttng_ust_stack_ctx);     \
+               __lttng_ctx.struct_size = sizeof(struct lttng_ust_stack_ctx); \
                __lttng_ctx.event_recorder = __event_recorder;                \
-               lib_ring_buffer_ctx_init(&__ctx, __chan->chan, &__lttng_ctx, __event_len, \
-                                        __event_align);                      \
+               lib_ring_buffer_ctx_init(&__ctx, NULL, &__lttng_ctx, __event_len, __event_align); \
                __ctx.ip = _TP_IP_PARAM(TP_IP_PARAM);                         \
                __ret = __chan->ops->event_reserve(&__ctx, __event_recorder->id); \
                if (__ret < 0)                                                \
@@ -974,6 +973,19 @@ LTTNG_TP_EXTERN_C const char *_model_emf_uri___##__provider##___##__name   \
 
 #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 struct lttng_ust_probe_desc _TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PROVIDER)
+       __attribute__((visibility("hidden")));
+
 /*
  * Stage 7.1 of tracepoint event generation.
  *
@@ -995,7 +1007,8 @@ static const char *                                                               \
        __attribute__((weakref ("_model_emf_uri___" #_provider "___" #_name)));\
 static struct lttng_ust_event_desc __event_desc___##_provider##_##_name = {    \
        .struct_size = sizeof(struct lttng_ust_event_desc),                    \
-       .name = #_provider ":" #_name,                                         \
+       .event_name = #_name,                                                  \
+       .probe_desc = &__probe_desc___##_provider,                             \
        .probe_callback = (void (*)(void)) &__event_probe__##_provider##___##_template, \
        .ctx = NULL,                                                           \
        .fields = __event_fields___##_provider##___##_template,                \
@@ -1032,10 +1045,9 @@ static struct lttng_ust_event_desc *_TP_COMBINE_TOKENS(__event_desc___, TRACEPOI
  * Create a toplevel descriptor for the whole probe.
  */
 
-/* non-const because list head will be modified when registered. */
-static struct lttng_ust_probe_desc _TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PROVIDER) = {
+struct lttng_ust_probe_desc _TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PROVIDER) = {
        .struct_size = sizeof(struct lttng_ust_probe_desc),
-       .provider = __tp_stringify(TRACEPOINT_PROVIDER),
+       .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,
        .head = { NULL, NULL },
This page took 0.024126 seconds and 4 git commands to generate.