[lttng-dev] [for-next][PATCH 08/20] tracing: Warn if a tracepoint is not set via debugfs

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Wed Mar 12 12:05:36 EDT 2014


----- Original Message -----
> From: "Steven Rostedt" <rostedt at goodmis.org>
> To: "Mathieu Desnoyers" <mathieu.desnoyers at efficios.com>
> Cc: "Frank Ch. Eigler" <fche at redhat.com>, linux-kernel at vger.kernel.org, "Ingo Molnar" <mingo at kernel.org>, "Frederic
> Weisbecker" <fweisbec at gmail.com>, "Andrew Morton" <akpm at linux-foundation.org>, "Johannes Berg"
> <johannes.berg at intel.com>, "Linus Torvalds" <torvalds at linux-foundation.org>, "Peter Zijlstra"
> <peterz at infradead.org>, "Thomas Gleixner" <tglx at linutronix.de>, "Greg Kroah-Hartman" <gregkh at linuxfoundation.org>,
> "lttng-dev" <lttng-dev at lists.lttng.org>, "Rusty Russell" <rusty at rustcorp.com.au>
> Sent: Wednesday, March 12, 2014 11:46:11 AM
> Subject: Re: [for-next][PATCH 08/20] tracing: Warn if a tracepoint is not set via debugfs
> 
> 
> To sum up this thread, and get the signal vs noise ratio up.
> 
> On Wed, 12 Mar 2014 11:11:00 -0400
> Steven Rostedt <rostedt at goodmis.org> wrote:
> 
> 
> > The solution I like the most that I believe will work for both of us,
> > is to to move this magic "enable tracepoint in the future" to your
> > LTTng module. Have your module register a module load and unload handler
> > to be able to see the tracepoints that exist in the module, and you can
> > enable them then. When a module is unloaded, your module can do the
> > accounting to record that, and the state of its tracepoints.
> 
> This is my final proposal.
> 
> I'll add the patch that removes the tracepoint on failure along with
> returning -ENODEV. That way, there will be no registered tracepoints
> that do not exist.
> 
> I'll also make sure that on module unload, the tracepoints are disabled
> for the module as well.

Do you mean that the tracepoint probe will be unregistered from within
tracepoint.c whenever all modules containing tracepoint call sites are
unloaded ? If so, how do you plan to handle ownership of the "name",
"probe" and "data" pointer ? They belong to the tracer. Would they simply
leak ?

> 
> Then, you can simply add a module notifier that does the work that you
> like, and save and restore the state of named tracepoints and enabled
> them on module load. Just set the priority of the notifier to 1
> so that it runs after the tracepoint notifier that adds the new
> tracepoints to the system.

I don't mind the extra work on the LTTng side at all. What I am concerned
about are changes that would make the tracepoint API sloppy.

> 
> > 
> > Looks like we can have it both ways. A way that works well for the
> > kernel, and a way that works well for you. But your module will need to
> > do the heavy work for what you want.
> > 
> > To me, a tracepoint should only be enabled when it exists. If it is
> > enabled in module when the module is unloaded, then it should be
> > removed after the module has left. If the module is loaded again, it is
> > up to the user (or your module) to enable that tracepoint again.
> 
> I want to point out that LTTng should not be dictating the way the
> kernel works, but it should be the other way around.

I don't care about doing extra work in LTTng, no worries about that.
I'm just trying to ensure all the corner cases are thought through
when a change such as this is proposed in a core infrastructure like
tracepoints.

Thanks,

Mathieu

> 
> -- Steve
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list