From 129de9ef18cd142e31ed509a7704d4faf0879f4c Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 3 Jun 2009 15:36:03 +0200 Subject: Detect kretprobe trampoline and use fallback unwinder. * runtime/sym.h (_stp_kretprobe_trampoline): Document. * translate.cxx (unwindsym_dump_context): Add stp_kretprobe_trampoline_addr. (dump_unwindsyms): Detect kretprobe_trampoline_holder symbol address. (emit_symbol_data): Initialize and emit _stp_kretprobe_trampoline. * runtime/transport/symbols.c (_stp_do_relocation): Detect kernel load address and adjust _stp_kretprobe_trampoline. * runtime/stack-i386.c (__stp_stack_print): Always use fallback unwinder when hitting kretprobe_trampoline_holder. * runtime/stack-x86_64.c (__stp_stack_print): Likewise. --- runtime/sym.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/sym.h') diff --git a/runtime/sym.h b/runtime/sym.h index 7e28ebe6..ca69345f 100644 --- a/runtime/sym.h +++ b/runtime/sym.h @@ -61,10 +61,10 @@ struct _stp_module { static struct _stp_module *_stp_modules []; static unsigned _stp_num_modules; - -/* the number of modules in the arrays */ - -static unsigned long _stp_kretprobe_trampoline = 0; +/* Used in the unwinder to special case unwinding through kretprobes. */ +/* Initialized through translator (stap-symbols.h) relative to kernel */ +/* load address, fixup by transport symbols _stp_do_relocation */ +static unsigned long _stp_kretprobe_trampoline; static unsigned long _stp_module_relocate (const char *module, const char *section, unsigned long offset); static struct _stp_module *_stp_get_unwind_info (unsigned long addr); -- cgit