From a26a7e4f2376619bb63519d089caeaf59af4a6b2 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 24 Jan 2014 19:16:08 -0500 Subject: [PATCH] Fix: tracepoint name remapping Commit "Introduce API to remap event names exposed by LTTng" failed to map the event names enabled by the user to tracepoint names known to the kernel. For instance, tracing with the kmem_kmalloc event enabled is not gathering any event. This issue applies to all tracepoint events declared with a different name within LTTng than within the Linux kernel. Signed-off-by: Mathieu Desnoyers --- lttng-events.c | 2 +- lttng-events.h | 3 ++- probes/lttng-events.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lttng-events.c b/lttng-events.c index 054489c7..f47e9dcf 100644 --- a/lttng-events.c +++ b/lttng-events.c @@ -400,7 +400,7 @@ struct lttng_event *lttng_event_create(struct lttng_channel *chan, ret = -ENOENT; goto register_error; } - ret = kabi_2635_tracepoint_probe_register(event_param->name, + ret = kabi_2635_tracepoint_probe_register(event->desc->kname, event->desc->probe_callback, event); if (ret) { diff --git a/lttng-events.h b/lttng-events.h index f0628c4c..6b39304f 100644 --- a/lttng-events.h +++ b/lttng-events.h @@ -170,7 +170,8 @@ struct lttng_ctx { }; struct lttng_event_desc { - const char *name; + const char *name; /* lttng-modules name */ + const char *kname; /* Linux kernel name (tracepoints) */ void *probe_callback; const struct lttng_event_ctx *ctx; /* context */ const struct lttng_event_field *fields; /* event payload */ diff --git a/probes/lttng-events.h b/probes/lttng-events.h index bf2e2b9d..680f466f 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -327,6 +327,7 @@ static void __event_probe__##_name(void *__data); static const struct lttng_event_desc __event_desc___##_map = { \ .fields = __event_fields___##_template, \ .name = #_map, \ + .kname = #_name, \ .probe_callback = (void *) TP_PROBE_CB(_template), \ .nr_fields = ARRAY_SIZE(__event_fields___##_template), \ .owner = THIS_MODULE, \ -- 2.34.1