summaryrefslogtreecommitdiffstats
path: root/runtime/sym.c
diff options
context:
space:
mode:
authorTim Moore <timoore@redhat.com>2009-12-17 16:18:34 +0100
committerTim Moore <timoore@redhat.com>2009-12-17 17:37:37 +0100
commitd5a2bd44d30b45b6829eb27d70ffb6ceaa70c5bd (patch)
tree0eced4c394d1e576932c5739bc5f819f8d584a6e /runtime/sym.c
parent4c5ce7a55108edb5203b3d69949f09c2284f1963 (diff)
downloadsystemtap-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/sym.c')
-rw-r--r--runtime/sym.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/runtime/sym.c b/runtime/sym.c
index 953161bc..cd0c8a71 100644
--- a/runtime/sym.c
+++ b/runtime/sym.c
@@ -374,19 +374,31 @@ static int _stp_func_print(unsigned long address, int verbose, int exact,
else
exstr = " (inexact)";
- name = _stp_kallsyms_lookup(address, &size, &offset, &modname, NULL, task);
+ name = _stp_kallsyms_lookup(address, &size, &offset, &modname, NULL,
+ task);
if (name) {
- if (verbose) {
+ switch (verbose) {
+ case SYM_VERBOSE_FULL:
if (modname && *modname)
_stp_printf(" %p : %s+%#lx/%#lx [%s]%s\n",
- (int64_t) address, name, offset, size, modname, exstr);
+ (int64_t) address, name, offset,
+ size, modname, exstr);
else
- _stp_printf(" %p : %s+%#lx/%#lx%s\n", (int64_t) address, name, offset, size, exstr);
- } else
+ _stp_printf(" %p : %s+%#lx/%#lx%s\n",
+ (int64_t) address, name, offset, size,
+ exstr);
+ break;
+ case SYM_VERBOSE_BRIEF:
+ _stp_printf("%s+%#lx\n", name, offset);
+ break;
+ case SYM_VERBOSE_NO:
+ default:
_stp_printf("%p ", (int64_t) address);
+ }
return 1;
- }
+ } else if (verbose == SYM_VERBOSE_BRIEF)
+ _stp_printf("%p\n", (int64_t) address);
return 0;
}