diff options
Diffstat (limited to 'arch/x86/kernel/dumpstack.c')
-rw-r--r-- | arch/x86/kernel/dumpstack.c | 51 |
1 files changed, 9 insertions, 42 deletions
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index df20723a6a1b..e2a3f0606da4 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
@@ -27,7 +27,7 @@ static int die_counter; | |||
27 | 27 | ||
28 | void printk_address(unsigned long address, int reliable) | 28 | void printk_address(unsigned long address, int reliable) |
29 | { | 29 | { |
30 | printk(" [<%p>] %s%pS\n", (void *) address, | 30 | printk(" [<%p>] %s%pB\n", (void *) address, |
31 | reliable ? "" : "? ", (void *) address); | 31 | reliable ? "" : "? ", (void *) address); |
32 | } | 32 | } |
33 | 33 | ||
@@ -175,21 +175,21 @@ static const struct stacktrace_ops print_trace_ops = { | |||
175 | 175 | ||
176 | void | 176 | void |
177 | show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, | 177 | show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, |
178 | unsigned long *stack, char *log_lvl) | 178 | unsigned long *stack, unsigned long bp, char *log_lvl) |
179 | { | 179 | { |
180 | printk("%sCall Trace:\n", log_lvl); | 180 | printk("%sCall Trace:\n", log_lvl); |
181 | dump_trace(task, regs, stack, &print_trace_ops, log_lvl); | 181 | dump_trace(task, regs, stack, bp, &print_trace_ops, log_lvl); |
182 | } | 182 | } |
183 | 183 | ||
184 | void show_trace(struct task_struct *task, struct pt_regs *regs, | 184 | void show_trace(struct task_struct *task, struct pt_regs *regs, |
185 | unsigned long *stack) | 185 | unsigned long *stack, unsigned long bp) |
186 | { | 186 | { |
187 | show_trace_log_lvl(task, regs, stack, ""); | 187 | show_trace_log_lvl(task, regs, stack, bp, ""); |
188 | } | 188 | } |
189 | 189 | ||
190 | void show_stack(struct task_struct *task, unsigned long *sp) | 190 | void show_stack(struct task_struct *task, unsigned long *sp) |
191 | { | 191 | { |
192 | show_stack_log_lvl(task, NULL, sp, ""); | 192 | show_stack_log_lvl(task, NULL, sp, 0, ""); |
193 | } | 193 | } |
194 | 194 | ||
195 | /* | 195 | /* |
@@ -197,14 +197,16 @@ void show_stack(struct task_struct *task, unsigned long *sp) | |||
197 | */ | 197 | */ |
198 | void dump_stack(void) | 198 | void dump_stack(void) |
199 | { | 199 | { |
200 | unsigned long bp; | ||
200 | unsigned long stack; | 201 | unsigned long stack; |
201 | 202 | ||
203 | bp = stack_frame(current, NULL); | ||
202 | printk("Pid: %d, comm: %.20s %s %s %.*s\n", | 204 | printk("Pid: %d, comm: %.20s %s %s %.*s\n", |
203 | current->pid, current->comm, print_tainted(), | 205 | current->pid, current->comm, print_tainted(), |
204 | init_utsname()->release, | 206 | init_utsname()->release, |
205 | (int)strcspn(init_utsname()->version, " "), | 207 | (int)strcspn(init_utsname()->version, " "), |
206 | init_utsname()->version); | 208 | init_utsname()->version); |
207 | show_trace(NULL, NULL, &stack); | 209 | show_trace(NULL, NULL, &stack, bp); |
208 | } | 210 | } |
209 | EXPORT_SYMBOL(dump_stack); | 211 | EXPORT_SYMBOL(dump_stack); |
210 | 212 | ||
@@ -320,41 +322,6 @@ void die(const char *str, struct pt_regs *regs, long err) | |||
320 | oops_end(flags, regs, sig); | 322 | oops_end(flags, regs, sig); |
321 | } | 323 | } |
322 | 324 | ||
323 | void notrace __kprobes | ||
324 | die_nmi(char *str, struct pt_regs *regs, int do_panic) | ||
325 | { | ||
326 | unsigned long flags; | ||
327 | |||
328 | if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, 2, SIGINT) == NOTIFY_STOP) | ||
329 | return; | ||
330 | |||
331 | /* | ||
332 | * We are in trouble anyway, lets at least try | ||
333 | * to get a message out. | ||
334 | */ | ||
335 | flags = oops_begin(); | ||
336 | printk(KERN_EMERG "%s", str); | ||
337 | printk(" on CPU%d, ip %08lx, registers:\n", | ||
338 | smp_processor_id(), regs->ip); | ||
339 | show_registers(regs); | ||
340 | oops_end(flags, regs, 0); | ||
341 | if (do_panic || panic_on_oops) | ||
342 | panic("Non maskable interrupt"); | ||
343 | nmi_exit(); | ||
344 | local_irq_enable(); | ||
345 | do_exit(SIGBUS); | ||
346 | } | ||
347 | |||
348 | static int __init oops_setup(char *s) | ||
349 | { | ||
350 | if (!s) | ||
351 | return -EINVAL; | ||
352 | if (!strcmp(s, "panic")) | ||
353 | panic_on_oops = 1; | ||
354 | return 0; | ||
355 | } | ||
356 | early_param("oops", oops_setup); | ||
357 | |||
358 | static int __init kstack_setup(char *s) | 325 | static int __init kstack_setup(char *s) |
359 | { | 326 | { |
360 | if (!s) | 327 | if (!s) |