Re: [PATCH v9 1/1] Tracepoint: register/unregister struct tracepoint

From: Mathieu Desnoyers
Date: Fri Apr 04 2014 - 09:19:25 EST


----- Original Message -----
> From: "Mathieu Desnoyers" <mathieu.desnoyers@xxxxxxxxxxxx>
> To: "Steven Rostedt" <rostedt@xxxxxxxxxxx>
> Cc: linux-kernel@xxxxxxxxxxxxxxx, "Ingo Molnar" <mingo@xxxxxxxxxx>, "Frederic Weisbecker" <fweisbec@xxxxxxxxx>,
> "Andrew Morton" <akpm@xxxxxxxxxxxxxxxxxxxx>, "Frank Ch. Eigler" <fche@xxxxxxxxxx>, "Johannes Berg"
> <johannes.berg@xxxxxxxxx>
> Sent: Thursday, April 3, 2014 11:40:17 PM
> Subject: Re: [PATCH v9 1/1] Tracepoint: register/unregister struct tracepoint
>
> ----- Original Message -----
> > From: "Steven Rostedt" <rostedt@xxxxxxxxxxx>
> > To: "Mathieu Desnoyers" <mathieu.desnoyers@xxxxxxxxxxxx>
> > Cc: linux-kernel@xxxxxxxxxxxxxxx, "Ingo Molnar" <mingo@xxxxxxxxxx>,
> > "Frederic Weisbecker" <fweisbec@xxxxxxxxx>,
> > "Andrew Morton" <akpm@xxxxxxxxxxxxxxxxxxxx>, "Frank Ch. Eigler"
> > <fche@xxxxxxxxxx>, "Johannes Berg"
> > <johannes.berg@xxxxxxxxx>
> > Sent: Thursday, April 3, 2014 2:54:41 PM
> > Subject: Re: [PATCH v9 1/1] Tracepoint: register/unregister struct
> > tracepoint
> >
> > On Thu, 3 Apr 2014 17:49:54 +0000 (UTC)
> > Mathieu Desnoyers <mathieu.desnoyers@xxxxxxxxxxxx> wrote:
> >
> >
> > > So my current thinking is that the pre-existing code was erroneously
> > > enabling tracepoints with the name of every event enabled (including
> > > e.g. function tracer, kprobes, etc). It was not failing because
> > > tracepoint.c silently accepted to enable tracepoints were not loaded
> > > yet.
> > >
> >
> > If that was true, than wouldn't the error code I added have returned an
> > error?
>
> Good point.
>
> I found the culprit:
>
> [ 0.560002] event_trace_enable: ïGTïïïïï call ffffffff81613930 (core)
> [ 0.564001] event_trace_enable: ïGTÈïïïï call ffffffff816139c0 (core)
>
> compudj@ok:~/git/rostedt/linux-trace$ objdump -t vmlinux |grep
> ffffffff81613930
> ffffffff81613930 l O .data 0000000000000090 event_sys_exit
> compudj@ok:~/git/rostedt/linux-trace$ objdump -t vmlinux |grep
> ffffffff816139c0
> ffffffff816139c0 l O .data 0000000000000090 event_sys_enter
>
> I'll look into those two sites tomorrow morning.

And here is the fix:

diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 7538389..75e64e8 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -371,7 +371,7 @@ struct ftrace_event_file {
#define __TRACE_EVENT_FLAGS(name, value) \
static int __init trace_init_flags_##name(void) \
{ \
- event_##name.flags = value; \
+ event_##name.flags |= value; \
return 0; \
} \
early_initcall(trace_init_flags_##name);

I will respin a new version after some extra testing.

Thanks!

Mathieu


>
> Thanks,
>
> Mathieu
>
> >
> > -- Steve
> >
>
> --
> Mathieu Desnoyers
> EfficiOS Inc.
> http://www.efficios.com
>

--
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/