Re: module-placed markers/tracepoints

From: Mathieu Desnoyers
Date: Tue Jul 29 2008 - 19:19:48 EST


* Frank Ch. Eigler (fche@xxxxxxxxxx) wrote:
> Hi -
>
> On Tue, Jul 29, 2008 at 06:41:16PM -0400, Mathieu Desnoyers wrote:
> > > Some locals are wondering -- is there code for (or need for new code
> > > for) incrementing module reference counts while markers and/or
> > > tracepoints resident in modules have active clients?
> >
> > Probe module unloading is supposed to be done automatically assuming the
> > following module unload behavior [...]
>
> The question was more that if module-placed markers/tracepoints are
> armed, is there any mechanism to prevent the modules' unloading. For
> kprobes, there is.
>
> - FChE

I see, it's the other way around : declaring a marker/tracepoint in a
module.

When you register to a marker/tracepoint, you actually register the
probe in a hash table. It will be connected to every placed
marker/tracepoint with that given name. Upon module load, markers/tp
that match the name are connected, and upon module unload all markers/tp
are simply freed by module.c : unlike kprobes, there is no need for the
marker/tp infrastructures to keep track of every marker/tp. So we don't
need any refcount on the module which has the marker/tp.

However, the probe question is important; I think a synchronize_sched()
is missing to handle unload of marker/tp probes modules.

Mathieu

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
--
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/