On Thu, Apr 24, 2014 at 7:12 AM, David Ahern <[email protected]> wrote: > On 4/23/14, 11:21 PM, Andi Kleen wrote: >> >> Jun Wang <[email protected]> writes: >> >>> Hi Everyone, >>> >>> With systemTap, in the absence of debugging information (DWARF), one >>> can access function parameters using (positional) numbers. Can the >>> same be done with `perf`? >>> Why? I'm trying to capture variables in a kernel function but I don't >>> have an good perf with DWARF support and there is are significant >>> challenges to build one due to the relatively old distro. >> >> >> You can specify the registers according to the ABI. >> di = 1. arg, si = 2nd arg etc. > > > http://en.wikipedia.org/wiki/X86_calling_conventions#List_of_x86_calling_conventions >
Andi/David, Thanks for the information. In my case, the argument of the kernel function is a pointer to a structure and I'm trying to capture the value of an element/field of that structure. With DWARF, I would have the following. perf probe -a "___sys_sendmsg sk=@sock->sk" Without DWARF, %di can only provide sock directly. Is there anyway to use %di as the address of the 'struct socket sock;' and capture sock->sk? The following was tried, but we captured values are all zeros. perf probe -a "___sys_sendmsg sk=+10(%bp):u32" Thanks, Jun -- To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
