diff options
author | wenji <wjhuang@dhcp-beijing-cdc-10-182-120-233.cn.oracle.com> | 2008-04-15 21:32:59 -0400 |
---|---|---|
committer | wenji <wjhuang@dhcp-beijing-cdc-10-182-120-233.cn.oracle.com> | 2008-04-15 21:32:59 -0400 |
commit | 7edb09d8ba7689d26aefc0a273f334cec4419539 (patch) | |
tree | ef40e55d0be98abe137c6d174b5bdb8c40bb022c /runtime/stack-x86_64.c | |
parent | bd10b81c06a0102ac10617da2f368fcc168fc15e (diff) | |
parent | 8a49d1d23c77033bf98fc7b139b37f83e3e0eb49 (diff) | |
download | systemtap-steved-7edb09d8ba7689d26aefc0a273f334cec4419539.tar.gz systemtap-steved-7edb09d8ba7689d26aefc0a273f334cec4419539.tar.xz systemtap-steved-7edb09d8ba7689d26aefc0a273f334cec4419539.zip |
Merge branch 'master' of ssh://wenji@sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/stack-x86_64.c')
-rw-r--r-- | runtime/stack-x86_64.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/runtime/stack-x86_64.c b/runtime/stack-x86_64.c index 9915c594..729b8a2a 100644 --- a/runtime/stack-x86_64.c +++ b/runtime/stack-x86_64.c @@ -9,37 +9,42 @@ */ /* DWARF unwinder failed. Just dump intereting addresses on kernel stack. */ -static void _stp_stack_print_fallback(unsigned long stack, int verbose) +static void _stp_stack_print_fallback(unsigned long stack, int verbose, int levels) { unsigned long addr; - while (stack & (THREAD_SIZE - 1) && - !_stp_pbuf_full()) { + while (levels && stack & (THREAD_SIZE - 1)) { if (unlikely(_stp_read_address(addr, (unsigned long *)stack, KERNEL_DS))) { /* cannot access stack. give up. */ return; } - _stp_func_print(addr, verbose, 0); + if (_stp_func_print(addr, verbose, 0)) + levels--; stack++; } } static void __stp_stack_print(struct pt_regs *regs, int verbose, int levels) { +#ifdef STP_USE_DWARF_UNWINDER // FIXME: large stack allocation struct unwind_frame_info info; arch_unw_init_frame_info(&info, regs); - while (!arch_unw_user_mode(&info)) { + while (levels && !arch_unw_user_mode(&info)) { int ret = unwind(&info); dbug_unwind(1, "ret=%d PC=%lx SP=%lx\n", ret, UNW_PC(&info), UNW_SP(&info)); if (ret == 0) { _stp_func_print(UNW_PC(&info), verbose, 1); + levels--; continue; } /* If an error happened or we hit a kretprobe trampoline, use fallback backtrace */ /* FIXME: is there a way to unwind across kretprobe trampolines? */ if (ret < 0 || (ret > 0 && UNW_PC(&info) == _stp_kretprobe_trampoline)) - _stp_stack_print_fallback(UNW_SP(&info), verbose); + _stp_stack_print_fallback(UNW_SP(&info), verbose, levels); break; } +#else /* ! STP_USE_DWARF_UNWINDER */ + _stp_stack_print_fallback(REG_SP(regs), verbose); +#endif } |