Re: [PATCH 1/4] tracing: move __DO_TRACE out of line

From: Jeremy Fitzhardinge
Date: Fri Apr 17 2009 - 15:59:18 EST


Ingo Molnar wrote:
* Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:

Taking __do_trace_sched_switch out of lines inserts this into the hot path (6 instructions, 31 bytes):

cmpl $0, __tracepoint_sched_switch+8(%rip) #, __tracepoint_sched_switch.state
je .L1748 #,
movq -136(%rbp), %rdx # next,
movq -144(%rbp), %rsi # prev,
movq %rbx, %rdi # rq,
call __do_trace_sched_switch #
.L1748:

Hm, why isnt this off-line in the function? It's marked unlikely(), isnt it?

Yes, its unlikely(). I don't know why it doesn't move it; I've never seen unlikely() do anything useful.

also, did you investigate the effect on the _instrumented_ function itself? (i.e. the non-tracing related bits) A function call clobbers various registers and creates pressure on gcc to shuffle registers around.

Well, there's a function call in either case, so I don't think it makes much difference.

J
--
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/