This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: full dwarf backtracing kernel to user
On Mon, 2011-08-01 at 15:15 -0700, amouehsan wrote:
> I am trying systemtap and when probing a kernel function ("bio_endio") I
> need to get the user backtrace. When I use
> probe kernel.function("bio_endio@fs/bio.c:1443").call
> {
> print_ubacktrace();
> }
> I get the following message.
> <no ubacktrace: kernel.function("bio_endio@fs/bio.c:1443").call>
>
> I tried using --ldd but it didn't help.
It might be that stap is already totally correct. It can be that your
probe point triggered totally in a kernel context, without any user
space trigger. You can check by doing:
stap -e 'probe kernel.function("bio_endio@fs/bio.c:1443").call
{ printf("%d %s\n", pid(), execname()); print_ubacktrace(); }'
For example for me this gives output like:
0 swapper
<no ubacktrace: kernel.function("bio_endio@fs/bio.c:1442").call>
3373 firefox-bin
0x7faa1e35a670
So, the first does indeed not have any user backtrace associated with
it. The second does have one, but since I didn't provide -d firefox-bin
--ldd stap couldn't unwinding past the initial user space address.
> By what you have written:
>
> Mark Wielaard-4 wrote:
> >
> > I have been cleaning up the dwarf unwinder a bit, and after some small
> > fixes (all in git trunk now) it is now finally possible to unwind fully
> > from kernel space right into user space. This provides better user
> > backtraces when a probe point triggered in kernel space.
> >
> > With the new setup it is now possible to get a
> > full user space register set to start the user space dwarf unwinder and
> > always do a full unwind. One example is setting a probe point on
> > syscall.close and then doing a print_ubacktrace().
> >
> I understand the feature I wanted to use was not implemented before. Is my
> understanding right? If no, how can I do that? If yes, how I can have this
> new feature enabled? Should I get a new code and re-compile systemtap?
You are partly right. What I am working on will provide us with more
places where we will be able to grab a user space register context and
so a usable user backtrace. The work isn't finished yet though. I try
pushing early and often to systemtap git, so if you follow that and
build from source then you can see the progress.
http://sourceware.org/systemtap/getinvolved.html
Cheers,
Mark