Re: Multiple handlers per marker

Mathieu Desnoyers <[email protected]> Thu, 1 Nov 2007 23:36:54 -0400
Newsgroups gmane.linux.kernel.tracing
Message-ID <20071102033654.GA1301@Krystal>
* Mathieu Desnoyers ([email protected]) wrote:
> * Mike Mason ([email protected]) wrote:
> > Hi Mathieu,
> > 
> > Are you aware of any working being done to allow multiple handlers to be 
> > attached to a marker?  Something like what kprobes allows.  I've started to 
> > look into this and don't want to duplicate efforts.
> > 
> 
> Nope, but I know we will have to address this.
> 
> Something along the lines of walking an RCU list of function pointers,
> calling them.
> 
> The only downside I see is that we will have to pass a va_list * instead
> of real va args. The could make the marker site a little bit bigger and
> will change the probe callback arguments.
> 
> What do you think about these ideas ?
> 
> If we can find a way to make the common case (only one probe connected)
> _ultra_ fast, and yet architecture independent, that would be awesome. A
> simple call is kind of hard to beat though.. So we may have to think
> about a design with :
> 
> - One call at the marker site
> - if 1 probe is installed :
>   - If the format string is empty, connect a probe without va args.
>   - If the format string is not empty, connect a "stage 1" probe that takes
>     the va args, starts/ends the va_list and calls _one_ function (let's
>     call it "stage 2" probe), that takes va_list as parameter.
> - if more than 1 probe is installed :
>   - The stage 1 probe creates the va_list and passes it to each function
>     connected, iterated with an RCU list.
> 
> What do you think ?
> 
> Mathieu
>

I'm working on an implementation.

> > Thanks,
> > Mike
> 
> -- 
> Mathieu Desnoyers
> Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
> OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68