aboutsummaryrefslogtreecommitdiff
path: root/arch/mips
diff options
context:
space:
mode:
authorFranck Bui-Huu <vagabon.xyz@gmail.com>2006-08-03 09:29:19 +0200
committerRalf Baechle <ralf@linux-mips.org>2006-09-27 13:37:28 +0100
commit1666a6fc73f724cdc6bd7d699f9ada4b04953efe (patch)
tree394ad3c83258ec0ccdf841cff0474e45be97b474 /arch/mips
parent6057a7987608941a203f40f8b53513af433d8d2f (diff)
[MIPS] Simplify dump_stack()
Make dump_stack() code not depend on CONFIG_KALLSYMS. It also make prepare_frametrace() always inlined to get less false entries reported by show_raw_backtrace(). Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/kernel/traps.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 549cbb8209a..303f0084302 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -158,7 +158,7 @@ static void show_stacktrace(struct task_struct *task, struct pt_regs *regs)
show_backtrace(task, regs);
}
-static noinline void prepare_frametrace(struct pt_regs *regs)
+static __always_inline void prepare_frametrace(struct pt_regs *regs)
{
__asm__ __volatile__(
"1: la $2, 1b\n\t"
@@ -200,17 +200,15 @@ void show_stack(struct task_struct *task, unsigned long *sp)
*/
void dump_stack(void)
{
- unsigned long stack;
+ struct pt_regs regs;
-#ifdef CONFIG_KALLSYMS
- if (!raw_show_trace) {
- struct pt_regs regs;
- prepare_frametrace(&regs);
- show_backtrace(current, &regs);
- return;
- }
-#endif
- show_raw_backtrace(&stack);
+ /*
+ * Remove any garbage that may be in regs (specially func
+ * addresses) to avoid show_raw_backtrace() to report them
+ */
+ memset(&regs, 0, sizeof(regs));
+ prepare_frametrace(&regs);
+ show_backtrace(current, &regs);
}
EXPORT_SYMBOL(dump_stack);