lkml.org 
[lkml]   [2009]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] tracing: add DEFINE_TRACE_FMT to tracepoint.h
* Steven Rostedt (rostedt@goodmis.org) wrote:
>
> On Wed, 25 Feb 2009, Peter Zijlstra wrote:
>
> > On Tue, 2009-02-24 at 21:56 -0500, Steven Rostedt wrote:
> >
> > > +#define DEFINE_TRACE_FMT(name, proto, args, fmt) \
> > > + DECLARE_TRACE(name, TPPROTO(proto), TPARGS(args))
> > > +
> >
> > If TPPROTO and TPARGS were anything but empty stubs, the above would add
> > them twice, no?
>
> I guess I can rename them too.
>
> The problem comes from passing in more than one argument. If a proto or
> args has a comma, you get a nasty error about unmatched number of
> parameters.
>
> I believe that they were purposely made to be empty stubs to allow for
> multiple parameters. But you are right, if that changes we need to fix it.
>
> Since the above is only to protect against the substitution into multiple
> parameters, we could probably create a new macro name to just be
>
> #define PARAMS(args...) args
> #define DEFINE_TRACE_FMT(name, proto, args, fmt) \
> DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
>

Yes, I think this should work. Just be careful to test passing a "void"
function parameter to these when you make any changes. This is a
subtle corner-case.

Mathieu

> -- Steve
>

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68


\
 
 \ /
  Last update: 2009-02-25 17:13    [W:0.211 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site