Re: [PATCH 0/3] tracepoints: delay argument evaluation

From: Peter Zijlstra
Date: Wed May 20 2009 - 03:39:16 EST


On Wed, 2009-05-20 at 00:27 -0700, Roland McGrath wrote:
> > Why can't
> >
> > trace_block_bio_complete(arg..)
> > if (__trace_block_bio_compete.state)
> > __trace_block_bio_complete(arg)
> >
> > work?
> >
> > Surely its possible to wrap the whole stuff in yet another macro layer
> > that will do the conditional before evaluating the arguments?
>
> That is exactly what Jason has implemented.
> He called the new macro layer tracepoint_call.
>
> You can't use a macro to generate a new macro definition, so it's not
> possible with cpp alone to have the new macro layer be one that defines a
> separate trace_foobar() macro for each defined tracepoint.

Right, just realized that.

But I think we should be asking GCC to get fixed. Since inline functions
don't act like a compiler barrier anyway, they might as well not force
argument evaluation either.
--
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/