diff options
author | Mark Wielaard <mjw@redhat.com> | 2009-05-13 12:51:38 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2009-05-13 12:51:38 +0200 |
commit | 90562d7d561c26b25aa73082bd33eaa399688187 (patch) | |
tree | b79f6918db64f202ef4e9ce26945c6aa418a1a54 /tapset/context-unwind.stp | |
parent | f4ece7ad6def675f87f98f97383e1667399e2353 (diff) | |
download | systemtap-steved-90562d7d561c26b25aa73082bd33eaa399688187.tar.gz systemtap-steved-90562d7d561c26b25aa73082bd33eaa399688187.tar.xz systemtap-steved-90562d7d561c26b25aa73082bd33eaa399688187.zip |
Implement caller:string() in terms of symname() and caller_addr().
* tapset/context-unwind.stp (caller): Implement as stap function using
symname(), caller_addr() and sprintf().
Diffstat (limited to 'tapset/context-unwind.stp')
-rw-r--r-- | tapset/context-unwind.stp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tapset/context-unwind.stp b/tapset/context-unwind.stp index f1e99dc8..d6654d25 100644 --- a/tapset/context-unwind.stp +++ b/tapset/context-unwind.stp @@ -51,16 +51,13 @@ function backtrace:string () %{ /* pure */ * sfunction caller - Return name and address of calling function * * Return the address and name of the calling function. + * This is equivalent to calling: + * sprintf("%s 0x%x", symname(caller_addr(), caller_addr())) * <emphasis>Works only for return probes at this time.</emphasis> */ -function caller:string() %{ /* pure */ - if (CONTEXT->pi) - _stp_symbol_snprint( THIS->__retvalue, MAXSTRINGLEN, - (unsigned long)_stp_ret_addr_r(CONTEXT->pi), - current, 0); - else - strlcpy(THIS->__retvalue,"unknown",MAXSTRINGLEN); -%} +function caller:string() { + return sprintf("%s 0x%x", symname(caller_addr()), caller_addr()); +} /** * sfunction caller_addr - Return caller address |