public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mjw@redhat.com>
To: systemtap@sources.redhat.com
Subject: Re: user backtrace from kernel context status
Date: Fri, 09 Jul 2010 18:12:00 -0000	[thread overview]
Message-ID: <1278699164.16260.63.camel@springer.wildebeest.org> (raw)
In-Reply-To: <1278525755.4413.39.camel@springer.wildebeest.org>

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

      reply	other threads:[~2010-07-09 18:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07 18:03 Mark Wielaard
2010-07-09 18:12 ` Mark Wielaard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1278699164.16260.63.camel@springer.wildebeest.org \
    --to=mjw@redhat.com \
    --cc=systemtap@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).