Re: [PATCH 0/3] tracepoints: delay argument evaluation
From: Peter Zijlstra
Date: Wed May 20 2009 - 03:12:40 EST
On Tue, 2009-05-19 at 17:03 -0400, Jason Baron wrote:
> hi,
>
> After disassembling some of the tracepoints, I've noticed that arguments that
> are passed as macros or that perform dereferences, evaluate prior to the
> tracepoint on/off check. This means that we are needlessly impacting the
> off case.
>
> I am proposing to fix this by adding a macro that first checks for on/off and
> then calls 'trace_##name', preserving type checking. Thus, callsites have to
> move from:
>
> trace_block_bio_complete(md->queue, bio);
>
> to:
>
> tracepoint_call(block_bio_complete, md->queue, bio);
>
> I've tried '__always_inline', but that did not fix this issue. Obviously this
> change will require changes to all the callsites. But, that shouldn't be
> very hard, I've already included the scheduler and block changes with this
> patch. I think its important to minimize code execution in the off case, and
> thus going through all the callsites is well worth it. If we agree on this
> change, I can change the rest in very short order.
>
> Below I'm also showing the assembly in the 'dec_pending()' function before and
> after this change to show the difference it makes. The arguments to the
> tracepoint are as above, 'md->queue' and 'bio'. Notice the 2 extra instructions,
> before the initial 'je', that could be moved after the 'je'.
I really really hate this.
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?
--
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/