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 /runtime/stack.c | |
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 'runtime/stack.c')
-rw-r--r-- | runtime/stack.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/runtime/stack.c b/runtime/stack.c index 27abee7e..3d907a7f 100644 --- a/runtime/stack.c +++ b/runtime/stack.c @@ -112,15 +112,20 @@ static void _stp_stack_print(struct pt_regs *regs, int verbose, struct kretprobe if (verbose) { /* print the current address */ if (pi) { - _stp_print("Returning from: "); - _stp_symbol_print((unsigned long)_stp_probe_addr_r(pi)); - _stp_print("\nReturning to : "); + if (verbose == SYM_VERBOSE_FULL) { + _stp_print("Returning from: "); + _stp_symbol_print((unsigned long)_stp_probe_addr_r(pi)); + _stp_print("\nReturning to : "); + } _stp_symbol_print((unsigned long)_stp_ret_addr_r(pi)); } else if (ri) { - _stp_print("Returning from: "); - _stp_usymbol_print(ri->rp->u.vaddr, tsk); - _stp_print("\nReturning to : "); - _stp_usymbol_print(ri->ret_addr, tsk); + if (verbose == SYM_VERBOSE_FULL) { + _stp_print("Returning from: "); + _stp_usymbol_print(ri->rp->u.vaddr, tsk); + _stp_print("\nReturning to : "); + _stp_usymbol_print(ri->ret_addr, tsk); + } else + _stp_func_print(ri->ret_addr, verbose, 0, tsk); } else { _stp_print_char(' '); if (tsk) @@ -128,7 +133,8 @@ static void _stp_stack_print(struct pt_regs *regs, int verbose, struct kretprobe else _stp_symbol_print(REG_IP(regs)); } - _stp_print_char('\n'); + if (verbose != SYM_VERBOSE_BRIEF) + _stp_print_char('\n'); } else if (pi) _stp_printf("%p %p ", (int64_t)(long)_stp_ret_addr_r(pi), (int64_t) REG_IP(regs)); else |