Re: Re: Re: [RFC][PATCH 2/4 v4] ftrace/x86: Add save_regs fori386 function calls

From: Masami Hiramatsu
Date: Mon Jul 16 2012 - 23:13:48 EST


(2012/07/17 12:05), Steven Rostedt wrote:
> On Tue, 2012-07-17 at 11:08 +0900, Masami Hiramatsu wrote:
>
>>> I found that regs_get_register() doesn't honor this either. Thus,
>>> kprobes in tracing gets this:
>>>
>>> # echo 'p:ftrace sys_read+4 s=%sp' > /debug/tracing/kprobe_events
>>> # echo 1 > /debug/tracing/events/kprobes/enable
>>> # cat trace
>>> sshd-1345 [000] d... 489.117168: ftrace: (sys_read+0x4/0x70) s=b7e96768
>>> sshd-1345 [000] d... 489.117191: ftrace: (sys_read+0x4/0x70) s=b7e96768
>>> cat-1447 [000] d... 489.117392: ftrace: (sys_read+0x4/0x70) s=5a7
>>> cat-1447 [001] d... 489.118023: ftrace: (sys_read+0x4/0x70) s=b77ad05f
>>> less-1448 [000] d... 489.118079: ftrace: (sys_read+0x4/0x70) s=b7762e06
>>> less-1448 [000] d... 489.118117: ftrace: (sys_read+0x4/0x70) s=b7764970
>>>
>>
>> Yes, that is by design, since I made it so. :)
>> Instead of %sp, kprobe tracer provides $stack special argument
>> for stack address, because "sp" is not always means the stack
>> address on every arch.
>
> But is that useful? Wouldn't the actual stack pointer be more
> informative?

It is just FYI :). I rather like your "%sp" enhancement
than current meaningless "%sp" on i386...

However, I think "$stack" is more general and informative
for users, thus, at least perf probe uses it for getting
variables from stack.

Thank you,

--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@xxxxxxxxxxx


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