Re: [RFC PATCH v2] Tracepoint: register/unregister struct tracepoint

From: Mathieu Desnoyers
Date: Thu Mar 13 2014 - 12:54:22 EST


----- Original Message -----
> From: "Frank Ch. Eigler" <fche@xxxxxxxxxx>
> To: "Mathieu Desnoyers" <mathieu.desnoyers@xxxxxxxxxxxx>
> Cc: "Steven Rostedt" <rostedt@xxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx, "Ingo Molnar" <mingo@xxxxxxxxxx>, "Frederic
> Weisbecker" <fweisbec@xxxxxxxxx>, "Andrew Morton" <akpm@xxxxxxxxxxxxxxxxxxxx>, "Johannes Berg"
> <johannes.berg@xxxxxxxxx>
> Sent: Thursday, March 13, 2014 12:35:31 PM
> Subject: Re: [RFC PATCH v2] Tracepoint: register/unregister struct tracepoint
>
> Hi -
>
> On Thu, Mar 13, 2014 at 12:10:48PM -0400, Mathieu Desnoyers wrote:
>
> > [...] Moreover, tracers are responsible for unregistering the probe
> > before the module containing its associated tracepoint is unloaded.
>
> Could you spell out please how a tracer is supposed to know early
> enough that the module is going to be unloaded?

There are two ways this can be done.

One use-case is when the probe and the callsite are within the same module,
or if the module containing the probe has a symbol dependency on the callsite.
In this case the probe normally unregisters itself from a module exit function
before the module unloads.

The other use-case is if the tracer has a module coming/going notifier
tracking the module's tracepoint callsites. The going notifier should
be run before the tracepoint.c going notifier. A notifier with negative
priority should have this effect, since the tracepoint.c notifier has
priority 0.

Thoughts ?

Thanks,

Mathieu

--
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/