diff options
Diffstat (limited to 'arch/i386/kernel/traps.c')
| -rw-r--r-- | arch/i386/kernel/traps.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 0d4005dc06c5..7e9edafffd8a 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c | |||
| @@ -92,7 +92,11 @@ asmlinkage void spurious_interrupt_bug(void); | |||
| 92 | asmlinkage void machine_check(void); | 92 | asmlinkage void machine_check(void); |
| 93 | 93 | ||
| 94 | static int kstack_depth_to_print = 24; | 94 | static int kstack_depth_to_print = 24; |
| 95 | #ifdef CONFIG_STACK_UNWIND | ||
| 95 | static int call_trace = 1; | 96 | static int call_trace = 1; |
| 97 | #else | ||
| 98 | #define call_trace (-1) | ||
| 99 | #endif | ||
| 96 | ATOMIC_NOTIFIER_HEAD(i386die_chain); | 100 | ATOMIC_NOTIFIER_HEAD(i386die_chain); |
| 97 | 101 | ||
| 98 | int register_die_notifier(struct notifier_block *nb) | 102 | int register_die_notifier(struct notifier_block *nb) |
| @@ -187,22 +191,21 @@ static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, | |||
| 187 | if (unwind_init_blocked(&info, task) == 0) | 191 | if (unwind_init_blocked(&info, task) == 0) |
| 188 | unw_ret = show_trace_unwind(&info, log_lvl); | 192 | unw_ret = show_trace_unwind(&info, log_lvl); |
| 189 | } | 193 | } |
| 190 | if (unw_ret > 0 && !arch_unw_user_mode(&info)) { | 194 | if (unw_ret > 0) { |
| 191 | #ifdef CONFIG_STACK_UNWIND | 195 | if (call_trace == 1 && !arch_unw_user_mode(&info)) { |
| 192 | print_symbol("DWARF2 unwinder stuck at %s\n", | 196 | print_symbol("DWARF2 unwinder stuck at %s\n", |
| 193 | UNW_PC(&info)); | 197 | UNW_PC(&info)); |
| 194 | if (call_trace == 1) { | 198 | if (UNW_SP(&info) >= PAGE_OFFSET) { |
| 195 | printk("Leftover inexact backtrace:\n"); | 199 | printk("Leftover inexact backtrace:\n"); |
| 196 | if (UNW_SP(&info)) | ||
| 197 | stack = (void *)UNW_SP(&info); | 200 | stack = (void *)UNW_SP(&info); |
| 198 | } else if (call_trace > 1) | 201 | } else |
| 202 | printk("Full inexact backtrace again:\n"); | ||
| 203 | } else if (call_trace >= 1) | ||
| 199 | return; | 204 | return; |
| 200 | else | 205 | else |
| 201 | printk("Full inexact backtrace again:\n"); | 206 | printk("Full inexact backtrace again:\n"); |
| 202 | #else | 207 | } else |
| 203 | printk("Inexact backtrace:\n"); | 208 | printk("Inexact backtrace:\n"); |
| 204 | #endif | ||
| 205 | } | ||
| 206 | } | 209 | } |
| 207 | 210 | ||
| 208 | if (task == current) { | 211 | if (task == current) { |
| @@ -454,7 +457,7 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
| 454 | panic("Fatal exception in interrupt"); | 457 | panic("Fatal exception in interrupt"); |
| 455 | 458 | ||
| 456 | if (panic_on_oops) | 459 | if (panic_on_oops) |
| 457 | panic("Fatal exception: panic_on_oops"); | 460 | panic("Fatal exception"); |
| 458 | 461 | ||
| 459 | oops_exit(); | 462 | oops_exit(); |
| 460 | do_exit(SIGSEGV); | 463 | do_exit(SIGSEGV); |
| @@ -1241,6 +1244,7 @@ static int __init kstack_setup(char *s) | |||
| 1241 | } | 1244 | } |
| 1242 | __setup("kstack=", kstack_setup); | 1245 | __setup("kstack=", kstack_setup); |
| 1243 | 1246 | ||
| 1247 | #ifdef CONFIG_STACK_UNWIND | ||
| 1244 | static int __init call_trace_setup(char *s) | 1248 | static int __init call_trace_setup(char *s) |
| 1245 | { | 1249 | { |
| 1246 | if (strcmp(s, "old") == 0) | 1250 | if (strcmp(s, "old") == 0) |
| @@ -1254,3 +1258,4 @@ static int __init call_trace_setup(char *s) | |||
| 1254 | return 1; | 1258 | return 1; |
| 1255 | } | 1259 | } |
| 1256 | __setup("call_trace=", call_trace_setup); | 1260 | __setup("call_trace=", call_trace_setup); |
| 1261 | #endif | ||
