ftrace: distinguish kretprobe'd functions in trace logs
authorAbhishek Sagar <sagar.abhishek@gmail.com>
Tue, 27 May 2008 18:33:18 +0000 (00:03 +0530)
committerIngo Molnar <mingo@elte.hu>
Mon, 2 Jun 2008 10:41:19 +0000 (12:41 +0200)
commit76094a2cf46e4ab776055d4086615b884408568c
treed6c7bd23772fb8ed34a5c176af9d21b4c434b1eb
parent014c257cce65e9d1cd2d28ec1c89a37c536b151d
ftrace: distinguish kretprobe'd functions in trace logs

Tracing functions via ftrace which have a kretprobe installed on them, can produce misleading output in their trace logs. E.g, consider the correct trace of the following sequence:

do_IRQ()
{
~
  irq_enter();
~
}

Trace log (sample):
<idle>-0     [00] 4154504455.781616: irq_enter <- do_IRQ

But if irq_enter() has a kretprobe installed on it, the return value stored on the stack at each invocation is modified to divert the return to a kprobe trampoline function called kretprobe_trampoline(). So with this the trace would (currently) look like:

<idle>-0     [00] 4154504455.781616: irq_enter <- kretprobe_trampoline

Now this is quite misleading to the end user, as it suggests something that didn't actually happen. So just to avoid such misinterpretations, the inlined patch aims to output such a log as:

<idle>-0     [00] 4154504455.781616: irq_enter <- [unknown/kretprobe'd]

Signed-off-by: Abhishek Sagar <sagar.abhishek@gmail.com>
Acked-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/trace.c