diff options
author | Tim Moore <timoore@redhat.com> | 2009-12-17 16:18:34 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-12-17 17:37:37 +0100 |
commit | d5a2bd44d30b45b6829eb27d70ffb6ceaa70c5bd (patch) | |
tree | 0eced4c394d1e576932c5739bc5f819f8d584a6e /tapset/ucontext-unwind.stp | |
parent | 4c5ce7a55108edb5203b3d69949f09c2284f1963 (diff) | |
download | systemtap-steved-d5a2bd44d30b45b6829eb27d70ffb6ceaa70c5bd.tar.gz systemtap-steved-d5a2bd44d30b45b6829eb27d70ffb6ceaa70c5bd.tar.xz systemtap-steved-d5a2bd44d30b45b6829eb27d70ffb6ceaa70c5bd.zip |
support for a brief backtrace format
This only prints symbol+offset, or an address if the symbol isn't
known.
* runtime/runtime.h (SYM_VERBOSE_NO, SYM_VERBOSE_FULL,
SYM_VERBOSE_BRIEF): new constants
* runtime/stack.c (_stp_stack_print): support brief format
* runtime/sym.c (_stp_func_print): ditto
* tapset/ucontext-unwind.stp (print_ubacktrace_brief): new function
* testsuite/systemtap.context/fib.c: new test program
* testsuite/systemtap.context/fib.stp: new test
* testsuite/systemtap.context/fib.exp: new test
Diffstat (limited to 'tapset/ucontext-unwind.stp')
-rw-r--r-- | tapset/ucontext-unwind.stp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tapset/ucontext-unwind.stp b/tapset/ucontext-unwind.stp index e0d883b8..399ce0c5 100644 --- a/tapset/ucontext-unwind.stp +++ b/tapset/ucontext-unwind.stp @@ -35,6 +35,24 @@ function print_ubacktrace () %{ /* unprivileged */ %} /** + * sfunction print_ubacktrace_brief- Print stack back trace for current task. EXPERIMENTAL! + * + * Equivalent to print_ubacktrace(), but output for each symbol is + * shorter (just name and offset), and the function address is + * printed if it can't be mapped to a name. + */ + +function print_ubacktrace_brief () %{ /* unprivileged */ + assert_is_myproc(); + if (CONTEXT->regs) { + _stp_stack_print(CONTEXT->regs, SYM_VERBOSE_BRIEF, CONTEXT->pi, + MAXTRACE, current, CONTEXT->ri); + } else { + _stp_printf("Systemtap probe: %s\n", CONTEXT->probe_point); + } +%} + +/** * sfunction ubacktrace - Hex backtrace of current task stack. EXPERIMENTAL! * * Return a string of hex addresses that are a backtrace of the |