This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: user backtrace from kernel context status


On Wed, 2010-07-07 at 20:02 +0200, Mark Wielaard wrote:
> Some status update on our ability to produce user backtraces from kernel
> space context. It is now sometimes possible to get (a partial) user
> space backtrace. For those architectures (i686 and x86_64) that use the
> dwarf unwinder. There are some limitations though.
> 
> Some examples:
> 
> Syscalls.
> 
> $ stap -d /bin/ls --ldd -e 'probe syscall.getdents
>   { log(pn()); print_ubacktrace(); }' -c /bin/ls
> syscall.getdents
>  0x000000384f0a2f65 : __getdents+0x15/0x90 [libc-2.12.so]
>  0x000000384f0a2962 : readdir64+0x82/0xdf [libc-2.12.so]
>  0x0000000000407f1f : print_dir+0x1df/0x6f0 [ls]
>  0x000000000040898d : main+0x55d/0x1900 [ls]
>  0x000000384f01ec5d : __libc_start_main+0xfd/0x1d0 [libc-2.12.so]
>  0x0000000000402799 : _start+0x29/0x2c [ls]
> 
> This example works for x86_64, but not for i686 because we don't track
> the vdso yet (PR10080).

This is now fixed and tada (on i686 f13):

$ stap -d /bin/ls --ldd -e 'probe syscall.ioctl
  { log(pn() . ": " . argstr); print_ubacktrace(); }' -c '/bin/ls -d /'
/
syscall.ioctl: 1, 21505, 0xbff13718
 0x00f80416 : __kernel_vsyscall+0x2/0x0
 0x0096c710 : tcgetattr+0x30/0xd0 [libc-2.12.so]
 0x00966de4 : isatty+0x24/0x40 [libc-2.12.so]
 0x08050ba4 : main+0xe4/0x373 [ls]
syscall.ioctl: 1, 21523, 0xbff13888
 0x00f80416 : __kernel_vsyscall+0x2/0x0
 0x0096d1f9 : ioctl+0x19/0x40 [libc-2.12.so]
 0x08050d50 : main+0x290/0x373 [ls]

Tracking the vdso is sadly also architecture specific. So if you like
hacking on non-x86 then take a look at the new vma.c
(_stp_vma_match_vdso) function.

Cheers,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]