diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-12-09 16:48:51 -0500 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-12-09 16:51:40 -0500 |
commit | 30a77b443b2016212e731ee063e83e0b295c0f21 (patch) | |
tree | 03cfff1cc387bdbd2e0a15787f0c4af5e8e56b18 /tapset/context-unwind.stp | |
parent | 309cc9ecf51b082d6de8f1c3b0028c398daa395f (diff) | |
download | systemtap-steved-30a77b443b2016212e731ee063e83e0b295c0f21.tar.gz systemtap-steved-30a77b443b2016212e731ee063e83e0b295c0f21.tar.xz systemtap-steved-30a77b443b2016212e731ee063e83e0b295c0f21.zip |
PR6961: initial sketch: set up dummy pt_regs for non-trap based probes
Diffstat (limited to 'tapset/context-unwind.stp')
-rw-r--r-- | tapset/context-unwind.stp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/tapset/context-unwind.stp b/tapset/context-unwind.stp index a0836ed6..4c5ed34b 100644 --- a/tapset/context-unwind.stp +++ b/tapset/context-unwind.stp @@ -23,11 +23,10 @@ * except that deeper stack nesting may be supported. Return nothing. */ function print_backtrace () %{ - if (CONTEXT->regs) { - _stp_stack_print(CONTEXT->regs, 1, CONTEXT->pi, MAXTRACE); - } else { - _stp_printf("Systemtap probe: %s\n", CONTEXT->probe_point); - } + if (! CONTEXT->regs) + WARN_ON (! CONTEXT->regs); + else + _stp_stack_print(CONTEXT->regs, 1, CONTEXT->pi, MAXTRACE); %} /** @@ -37,10 +36,10 @@ function print_backtrace () %{ * stack. It may be truncated due to maximum string length. */ function backtrace:string () %{ /* pure */ - if (CONTEXT->regs) - _stp_stack_snprint (THIS->__retvalue, MAXSTRINGLEN, CONTEXT->regs, 0, CONTEXT->pi, MAXTRACE); - else - strlcpy (THIS->__retvalue, "", MAXSTRINGLEN); + if (! CONTEXT->regs) + WARN_ON (! CONTEXT->regs); + else + _stp_stack_snprint (THIS->__retvalue, MAXSTRINGLEN, CONTEXT->regs, 0, CONTEXT->pi, MAXTRACE); %} /** |