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

Steven Rostedt rostedt at goodmis.org
Wed Mar 12 14:58:02 EDT 2014


On Wed, 12 Mar 2014 18:47:15 +0000 (UTC)
Mathieu Desnoyers <mathieu.desnoyers at efficios.com> wrote:
 
> > On module unload, the events are destroyed.
> 
> Isn't trace_event.c responsible for dealing with tracepoint probes rather
> than call sites ? This is quite different. A tracepoint probe "foo" is only
> located within a single module (the one you are unloading here). However,
> if you try to unload a module that contains the callsite "foo", you have no
> guarantee that no other modules also contain this callsite, and therefore
> you cannot destroy the associated name, probe, nor data objects.

No module should have the same tracepoint name as another module.
That's just broken. Although we do not technically enforce this, in
practice that has been the case.


> 
> > 
> > Thus, what your module should do, is exactly what event_remove() does.
> > On module unload, you unregister any of the tracepoints that were
> > registered. Just like any other module resource. If you request a
> > resource on the behalf of a module, it is up to you to free it when the
> > module is unloaded.
> 
> You seem to try to apply a logic that works in the case of the probes
> defined by trace event to tracepoint call sites, but the fact is that
> they are very different. Or again perhaps I'm just on the wrong track.
> 
> > 
> > The tracepoint code will just destroy what it set up when the module
> > was loaded. It's up to your module to clean up the allocations that you
> > made when the module was loaded on unload. Just like we do for all
> > other resources.
> > 
> > Mathieu, stop thinking that tracepoints are special. They are not.
> 
> I'm trying to understand how module going of tracepoint probes and
> call sites can be considered the same. What am I missing ?

What creates the tracepoint probe? For all purposes, it should be
either created on boot up (on core tracepoints), or when a module is
loaded.

Two modules should not have the same name. Is there any duplicate
tracepoints you are aware of. Namespace collisions in tracepoints
should be avoided, as that would cause people to trace things they did
not intend on tracing.

That should be a new patch as well. Enforce unique tracepoint names.

-- Steve



More information about the lttng-dev mailing list