This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Question on checking the stack
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Bryce <philip dot copeland at oracle dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: 13 Oct 2005 11:46:42 -0400
- Subject: Re: Question on checking the stack
- References: <434E3AA0.9040407@oracle.com>
Bryce <philip.copeland@oracle.com> writes:
> Setting up a probe for a function is great and all but is there a way
> to test how we entered the routine?
> [...]
Just about all the essentials are in there somewhere, just
not in a convenient-to-use form.
> probe kernel.function("generic_make_request") {
> if (stack(1) == "submit_bio" ) { // where stack(1) was the last
> routine and stack(2) was 2nd last etc
> do_test/display
> }
> }
The tapset/context.stp file would need two new functions such as these:
caller:string(n:long) - returns the nth substring as if from backtrace()
addr2symbol:string(n:long) - address-to-symbol lookup, which is exactly
one stage of print_stack()
- FChE