Add probe descriptor field to enum and event class
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 5 May 2021 20:08:19 +0000 (16:08 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 6 May 2021 15:12:24 +0000 (11:12 -0400)
If future event instances can refer to event classes located in
different probe providers, the tracer needs to be able to query the
major/minor version of the probe provider containing the class.

Likewise for enumerations.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Ifb39a52c70e14ce4d77c247d237d456257072b34

include/lttng/ust-events.h
include/lttng/ust-tracepoint-event.h

index b09a6718ce022e02526e3dd4500ac7aa773134ac..6a918f4d2b98a9b1bf6f34d3cb2887c94f8a8a95 100644 (file)
@@ -230,6 +230,7 @@ struct lttng_ust_enum_desc {
        const char *name;
        const struct lttng_ust_enum_entry * const *entries;
        unsigned int nr_entries;
+       const struct lttng_ust_probe_desc *probe_desc;
 
        /* End of base ABI. Fields below should be used after checking struct_size. */
 };
@@ -276,6 +277,7 @@ struct lttng_ust_tracepoint_class {
        size_t nr_fields;
        void (*probe_callback)(void);
        const char *signature;                          /* Argument types/names received */
+       const struct lttng_ust_probe_desc *probe_desc;
 
        /* End of base ABI. Fields below should be used after checking struct_size. */
 };
index c6dfed7ddc36700f1ab8d43430d3f676ed8f53d9..c68f7d98cb1748b5e540946ea87cb7bdffdaf160 100644 (file)
@@ -329,6 +329,19 @@ static void lttng_ust__event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_D
 
 #include LTTNG_UST_TRACEPOINT_INCLUDE
 
+/*
+ * Stage 1.1 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 LTTNG_UST__TP_COMBINE_TOKENS(lttng_ust__probe_desc___, LTTNG_UST_TRACEPOINT_PROVIDER)
+       __attribute__((visibility("hidden")));
+
 /*
  * Stage 2 of tracepoint event generation.
  *
@@ -461,6 +474,7 @@ static void lttng_ust__event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_D
                .nr_fields = LTTNG_UST__TP_ARRAY_SIZE(lttng_ust__event_fields___##_provider##___##_name) - 1, \
                .probe_callback = (void (*)(void)) &lttng_ust__event_probe__##_provider##___##_name, \
                .signature = __tp_event_signature___##_provider##___##_name,                         \
+               .probe_desc = &lttng_ust__probe_desc___##_provider,                                  \
        };
 
 #undef LTTNG_UST_TRACEPOINT_ENUM
@@ -470,6 +484,7 @@ static void lttng_ust__event_probe__##_provider##___##_name(LTTNG_UST__TP_ARGS_D
                .name = #_provider "_" #_name,                                          \
                .entries = __enum_values__##_provider##_##_name,                        \
                .nr_entries = LTTNG_UST__TP_ARRAY_SIZE(__enum_values__##_provider##_##_name) - 1,       \
+               .probe_desc = &lttng_ust__probe_desc___##_provider,                     \
        };
 
 #include LTTNG_UST_TRACEPOINT_INCLUDE
@@ -1075,19 +1090,6 @@ LTTNG_UST_TP_EXTERN_C const char * const _model_emf_uri___##__provider##___##__n
 /*
  * 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 LTTNG_UST__TP_COMBINE_TOKENS(lttng_ust__probe_desc___, LTTNG_UST_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
  * a loglevel that contains NULL.
@@ -1122,7 +1124,7 @@ static const struct lttng_ust_event_desc lttng_ust__event_desc___##_provider##_#
 #include LTTNG_UST_TRACEPOINT_INCLUDE
 
 /*
- * Stage 7.2 of tracepoint event generation.
+ * Stage 7.1 of tracepoint event generation.
  *
  * Create array of events.
  */
This page took 0.02689 seconds and 4 git commands to generate.