Re: [PATCH 2/8] tracing: create automated trace defines

Jeremy Fitzhardinge
2009-04-17T00:18:52Z

Mathieu Desnoyers wrote:
>> Are they? They're generally considered to be "free", because the call
>> and return are predicted 100% accurately.
>>
>>
>
> Adding a simple function call within the tracer fast path, in LTTng, has
> a very measurable performance impact on the tbench workload. This is why
> I don't use any function call-based trace clocks in LTTng, but rather my
> own inline trace clock.

I'm a bit concerned about all the code that tracing puts inline though.
It seems it would put quite a lot of icache overhead on the codepath
when the tracepoint is disabled, not least because its duplicated in
every instance of the tracepoint. And if the compiler decides to put
the unlikely() branch code out of line, then that's the same as making
it a function call (except that if it is a function call, all the
tracepoints will share the same code, and get a higher likelihood of
getting icache hits).

J