Fix: keep event probe signature, for use by event probe signature check
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 1 Mar 2012 19:39:02 +0000 (14:39 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 1 Mar 2012 19:39:02 +0000 (14:39 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng/ust-events.h
include/lttng/ust-tracepoint-event.h
liblttng-ust/ltt-probes.c

index 2bf05d56af0b199a492541304badeb0e0d982306..92e8bf291152932df5e5f88e7216f4ef24d41ae2 100644 (file)
@@ -215,6 +215,7 @@ struct lttng_event_desc {
        const struct lttng_event_field *fields; /* event payload */
        unsigned int nr_fields;
        const int **loglevel;
+       const char *signature;  /* Argument types/names received */
        char padding[LTTNG_UST_EVENT_DESC_PADDING];
 };
 
index 18aa4e44f1439b56d194601e5c1d4c89aee4ad9c..1dffd94635364f84a5f7b9bdd9a28036403aa1fa 100644 (file)
@@ -76,7 +76,7 @@
                         _TP_PARAMS(_args),                     \
                         _TP_PARAMS(_fields))                   \
        TRACEPOINT_EVENT_INSTANCE(_provider, _name, _name,      \
-                        _TP_PARAMS(args))
+                        _TP_PARAMS(_args))
 
 /* Helpers */
 #define _TP_ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
@@ -433,6 +433,25 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args))\
 
 #undef __get_dynamic_len
 
+/*
+ * Stage 5.1 of tracepoint event generation.
+ *
+ * Create probe signature
+ */
+
+/* Reset all macros within TRACEPOINT_EVENT */
+#include <lttng/ust-tracepoint-event-reset.h>
+
+#undef TP_ARGS
+#define TP_ARGS(args...) #args
+
+#undef TRACEPOINT_EVENT_CLASS
+#define TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields)       \
+const char __tp_event_signature___##_provider##___##_name[] =          \
+               _args;
+
+#include TRACEPOINT_INCLUDE
+
 /*
  * Stage 6 of tracepoint event generation.
  *
@@ -475,6 +494,7 @@ const struct lttng_event_desc __event_desc___##_provider##_##_name = {             \
        .probe_callback = (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
index 474ac454a7aac33a67e0b280ece029ec9673046d..0de5c6a48f2ed6b5a4b0fd71b068cac6519c4433 100644 (file)
@@ -99,7 +99,12 @@ desc_added:
         * fix the events awaiting probe load.
         */
        for (i = 0; i < desc->nr_events; i++) {
-               ret = pending_probe_fix_events(desc->event_desc[i]);
+               const struct lttng_event_desc *ed;
+
+               ed = desc->event_desc[i];
+               DBG("Registered event probe \"%s\" with signature \"%s\"",
+                       ed->name, ed->signature);
+               ret = pending_probe_fix_events(ed);
                assert(!ret);
        }
 end:
This page took 0.026994 seconds and 4 git commands to generate.