From bbc46bf643491173b9086907cf0820b3fd2c1fe3 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Mon, 2 Feb 2009 15:58:53 +0100 Subject: Use kernel stack backtrace support when available Define new functions that use the kernel support to do a backtrace of other tasks than current. --- runtime/stack-i386.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/stack-i386.c') diff --git a/runtime/stack-i386.c b/runtime/stack-i386.c index ed7e2ce1..2d3ac53c 100644 --- a/runtime/stack-i386.c +++ b/runtime/stack-i386.c @@ -14,6 +14,7 @@ static int _stp_valid_stack_ptr(unsigned long context, unsigned long p) } /* DWARF unwinder failed. Just dump intereting addresses on kernel stack. */ +#ifndef CONFIG_STACKTRACE static void _stp_stack_print_fallback(unsigned long context, unsigned long stack, int verbose, int levels) { unsigned long addr; @@ -27,6 +28,7 @@ static void _stp_stack_print_fallback(unsigned long context, unsigned long stack stack++; } } +#endif static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels) { -- cgit From 2aa2ccb83142c3bf98ac8ee1558a0ee72dff3a1f Mon Sep 17 00:00:00 2001 From: William Cohen Date: Wed, 18 Feb 2009 10:48:20 -0500 Subject: Remove context argument from _stp_stack_print_fallback (PR 9860). --- runtime/stack-i386.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'runtime/stack-i386.c') diff --git a/runtime/stack-i386.c b/runtime/stack-i386.c index 2d3ac53c..3c3921ea 100644 --- a/runtime/stack-i386.c +++ b/runtime/stack-i386.c @@ -15,10 +15,10 @@ static int _stp_valid_stack_ptr(unsigned long context, unsigned long p) /* DWARF unwinder failed. Just dump intereting addresses on kernel stack. */ #ifndef CONFIG_STACKTRACE -static void _stp_stack_print_fallback(unsigned long context, unsigned long stack, int verbose, int levels) +static void _stp_stack_print_fallback(unsigned long stack, int verbose, int levels) { unsigned long addr; - while (levels && _stp_valid_stack_ptr(context, stack)) { + while (levels && stack & (THREAD_SIZE-1)) { if (unlikely(_stp_read_address(addr, (unsigned long *)stack, KERNEL_DS))) { /* cannot access stack. give up. */ return; @@ -71,11 +71,11 @@ static void __stp_stack_print (struct pt_regs *regs, int verbose, int levels) /* 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(context, UNW_SP(&info), verbose, levels); + _stp_stack_print_fallback(UNW_SP(&info), verbose, levels); break; } #else /* ! STP_USE_DWARF_UNWINDER */ - _stp_stack_print_fallback(context, (unsigned long)®_SP(regs), verbose, levels); + _stp_stack_print_fallback((unsigned long)®_SP(regs), verbose, levels); #endif /* STP_USE_FRAME_POINTER */ #endif } -- cgit From 8aaa6e11f666ad372107299b5b17602011125c7d Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 18 Feb 2009 19:33:06 -0500 Subject: PR9866 band-aid: deactivate new CONFIG_STACKTRACE code for older kernels --- runtime/stack-i386.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/stack-i386.c') diff --git a/runtime/stack-i386.c b/runtime/stack-i386.c index 3c3921ea..206801d8 100644 --- a/runtime/stack-i386.c +++ b/runtime/stack-i386.c @@ -14,7 +14,7 @@ static int _stp_valid_stack_ptr(unsigned long context, unsigned long p) } /* DWARF unwinder failed. Just dump intereting addresses on kernel stack. */ -#ifndef CONFIG_STACKTRACE +#if ! (defined(CONFIG_STACKTRACE) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)) static void _stp_stack_print_fallback(unsigned long stack, int verbose, int levels) { unsigned long addr; -- cgit