From: Mathieu Desnoyers Date: Thu, 1 Mar 2012 19:39:02 +0000 (-0500) Subject: Fix: keep event probe signature, for use by event probe signature check X-Git-Tag: v2.0.0-rc2~6 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=687554296a45bf8b3467ba0bb37c06ba66085641;p=lttng-ust.git Fix: keep event probe signature, for use by event probe signature check Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index 2bf05d56..92e8bf29 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -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]; }; diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 18aa4e44..1dffd946 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -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 + +#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 diff --git a/liblttng-ust/ltt-probes.c b/liblttng-ust/ltt-probes.c index 474ac454..0de5c6a4 100644 --- a/liblttng-ust/ltt-probes.c +++ b/liblttng-ust/ltt-probes.c @@ -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: