diff options
Diffstat (limited to 'arch/x86/kernel/dumpstack.c')
-rw-r--r-- | arch/x86/kernel/dumpstack.c | 63 |
1 files changed, 4 insertions, 59 deletions
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 6e8752c1bd52..1aae78f775fc 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 | ||
@@ -135,20 +135,6 @@ print_context_stack_bp(struct thread_info *tinfo, | |||
135 | } | 135 | } |
136 | EXPORT_SYMBOL_GPL(print_context_stack_bp); | 136 | EXPORT_SYMBOL_GPL(print_context_stack_bp); |
137 | 137 | ||
138 | |||
139 | static void | ||
140 | print_trace_warning_symbol(void *data, char *msg, unsigned long symbol) | ||
141 | { | ||
142 | printk(data); | ||
143 | print_symbol(msg, symbol); | ||
144 | printk("\n"); | ||
145 | } | ||
146 | |||
147 | static void print_trace_warning(void *data, char *msg) | ||
148 | { | ||
149 | printk("%s%s\n", (char *)data, msg); | ||
150 | } | ||
151 | |||
152 | static int print_trace_stack(void *data, char *name) | 138 | static int print_trace_stack(void *data, char *name) |
153 | { | 139 | { |
154 | printk("%s <%s> ", (char *)data, name); | 140 | printk("%s <%s> ", (char *)data, name); |
@@ -166,8 +152,6 @@ static void print_trace_address(void *data, unsigned long addr, int reliable) | |||
166 | } | 152 | } |
167 | 153 | ||
168 | static const struct stacktrace_ops print_trace_ops = { | 154 | static const struct stacktrace_ops print_trace_ops = { |
169 | .warning = print_trace_warning, | ||
170 | .warning_symbol = print_trace_warning_symbol, | ||
171 | .stack = print_trace_stack, | 155 | .stack = print_trace_stack, |
172 | .address = print_trace_address, | 156 | .address = print_trace_address, |
173 | .walk_stack = print_context_stack, | 157 | .walk_stack = print_context_stack, |
@@ -197,14 +181,10 @@ void show_stack(struct task_struct *task, unsigned long *sp) | |||
197 | */ | 181 | */ |
198 | void dump_stack(void) | 182 | void dump_stack(void) |
199 | { | 183 | { |
200 | unsigned long bp = 0; | 184 | unsigned long bp; |
201 | unsigned long stack; | 185 | unsigned long stack; |
202 | 186 | ||
203 | #ifdef CONFIG_FRAME_POINTER | 187 | bp = stack_frame(current, NULL); |
204 | if (!bp) | ||
205 | get_bp(bp); | ||
206 | #endif | ||
207 | |||
208 | printk("Pid: %d, comm: %.20s %s %s %.*s\n", | 188 | printk("Pid: %d, comm: %.20s %s %s %.*s\n", |
209 | current->pid, current->comm, print_tainted(), | 189 | current->pid, current->comm, print_tainted(), |
210 | init_utsname()->release, | 190 | init_utsname()->release, |
@@ -240,6 +220,7 @@ unsigned __kprobes long oops_begin(void) | |||
240 | bust_spinlocks(1); | 220 | bust_spinlocks(1); |
241 | return flags; | 221 | return flags; |
242 | } | 222 | } |
223 | EXPORT_SYMBOL_GPL(oops_begin); | ||
243 | 224 | ||
244 | void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr) | 225 | void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr) |
245 | { | 226 | { |
@@ -282,7 +263,6 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err) | |||
282 | printk("DEBUG_PAGEALLOC"); | 263 | printk("DEBUG_PAGEALLOC"); |
283 | #endif | 264 | #endif |
284 | printk("\n"); | 265 | printk("\n"); |
285 | sysfs_printk_last_file(); | ||
286 | if (notify_die(DIE_OOPS, str, regs, err, | 266 | if (notify_die(DIE_OOPS, str, regs, err, |
287 | current->thread.trap_no, SIGSEGV) == NOTIFY_STOP) | 267 | current->thread.trap_no, SIGSEGV) == NOTIFY_STOP) |
288 | return 1; | 268 | return 1; |
@@ -325,41 +305,6 @@ void die(const char *str, struct pt_regs *regs, long err) | |||
325 | oops_end(flags, regs, sig); | 305 | oops_end(flags, regs, sig); |
326 | } | 306 | } |
327 | 307 | ||
328 | void notrace __kprobes | ||
329 | die_nmi(char *str, struct pt_regs *regs, int do_panic) | ||
330 | { | ||
331 | unsigned long flags; | ||
332 | |||
333 | if (notify_die(DIE_NMIWATCHDOG, str, regs, 0, 2, SIGINT) == NOTIFY_STOP) | ||
334 | return; | ||
335 | |||
336 | /* | ||
337 | * We are in trouble anyway, lets at least try | ||
338 | * to get a message out. | ||
339 | */ | ||
340 | flags = oops_begin(); | ||
341 | printk(KERN_EMERG "%s", str); | ||
342 | printk(" on CPU%d, ip %08lx, registers:\n", | ||
343 | smp_processor_id(), regs->ip); | ||
344 | show_registers(regs); | ||
345 | oops_end(flags, regs, 0); | ||
346 | if (do_panic || panic_on_oops) | ||
347 | panic("Non maskable interrupt"); | ||
348 | nmi_exit(); | ||
349 | local_irq_enable(); | ||
350 | do_exit(SIGBUS); | ||
351 | } | ||
352 | |||
353 | static int __init oops_setup(char *s) | ||
354 | { | ||
355 | if (!s) | ||
356 | return -EINVAL; | ||
357 | if (!strcmp(s, "panic")) | ||
358 | panic_on_oops = 1; | ||
359 | return 0; | ||
360 | } | ||
361 | early_param("oops", oops_setup); | ||
362 | |||
363 | static int __init kstack_setup(char *s) | 308 | static int __init kstack_setup(char *s) |
364 | { | 309 | { |
365 | if (!s) | 310 | if (!s) |