diff options
author | Franck Bui-Huu <vagabon.xyz@gmail.com> | 2006-08-03 03:29:19 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-09-27 08:37:28 -0400 |
commit | 1666a6fc73f724cdc6bd7d699f9ada4b04953efe (patch) | |
tree | 394ad3c83258ec0ccdf841cff0474e45be97b474 /arch | |
parent | 6057a7987608941a203f40f8b53513af433d8d2f (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')
-rw-r--r-- | arch/mips/kernel/traps.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 549cbb8209a3..303f00843021 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) | |||
158 | show_backtrace(task, regs); | 158 | show_backtrace(task, regs); |
159 | } | 159 | } |
160 | 160 | ||
161 | static noinline void prepare_frametrace(struct pt_regs *regs) | 161 | static __always_inline void prepare_frametrace(struct pt_regs *regs) |
162 | { | 162 | { |
163 | __asm__ __volatile__( | 163 | __asm__ __volatile__( |
164 | "1: la $2, 1b\n\t" | 164 | "1: la $2, 1b\n\t" |
@@ -200,17 +200,15 @@ void show_stack(struct task_struct *task, unsigned long *sp) | |||
200 | */ | 200 | */ |
201 | void dump_stack(void) | 201 | void dump_stack(void) |
202 | { | 202 | { |
203 | unsigned long stack; | 203 | struct pt_regs regs; |
204 | 204 | ||
205 | #ifdef CONFIG_KALLSYMS | 205 | /* |
206 | if (!raw_show_trace) { | 206 | * Remove any garbage that may be in regs (specially func |
207 | struct pt_regs regs; | 207 | * addresses) to avoid show_raw_backtrace() to report them |
208 | prepare_frametrace(®s); | 208 | */ |
209 | show_backtrace(current, ®s); | 209 | memset(®s, 0, sizeof(regs)); |
210 | return; | 210 | prepare_frametrace(®s); |
211 | } | 211 | show_backtrace(current, ®s); |
212 | #endif | ||
213 | show_raw_backtrace(&stack); | ||
214 | } | 212 | } |
215 | 213 | ||
216 | EXPORT_SYMBOL(dump_stack); | 214 | EXPORT_SYMBOL(dump_stack); |