aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/dumpstack.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/dumpstack.c')
-rw-r--r--arch/x86/kernel/dumpstack.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index 6d817554780a..df20723a6a1b 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -18,7 +18,6 @@
18 18
19#include <asm/stacktrace.h> 19#include <asm/stacktrace.h>
20 20
21#include "dumpstack.h"
22 21
23int panic_on_unrecovered_nmi; 22int panic_on_unrecovered_nmi;
24int panic_on_io_nmi; 23int panic_on_io_nmi;
@@ -176,21 +175,21 @@ static const struct stacktrace_ops print_trace_ops = {
176 175
177void 176void
178show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, 177show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
179 unsigned long *stack, unsigned long bp, char *log_lvl) 178 unsigned long *stack, char *log_lvl)
180{ 179{
181 printk("%sCall Trace:\n", log_lvl); 180 printk("%sCall Trace:\n", log_lvl);
182 dump_trace(task, regs, stack, bp, &print_trace_ops, log_lvl); 181 dump_trace(task, regs, stack, &print_trace_ops, log_lvl);
183} 182}
184 183
185void show_trace(struct task_struct *task, struct pt_regs *regs, 184void show_trace(struct task_struct *task, struct pt_regs *regs,
186 unsigned long *stack, unsigned long bp) 185 unsigned long *stack)
187{ 186{
188 show_trace_log_lvl(task, regs, stack, bp, ""); 187 show_trace_log_lvl(task, regs, stack, "");
189} 188}
190 189
191void show_stack(struct task_struct *task, unsigned long *sp) 190void show_stack(struct task_struct *task, unsigned long *sp)
192{ 191{
193 show_stack_log_lvl(task, NULL, sp, 0, ""); 192 show_stack_log_lvl(task, NULL, sp, "");
194} 193}
195 194
196/* 195/*
@@ -198,20 +197,14 @@ void show_stack(struct task_struct *task, unsigned long *sp)
198 */ 197 */
199void dump_stack(void) 198void dump_stack(void)
200{ 199{
201 unsigned long bp = 0;
202 unsigned long stack; 200 unsigned long stack;
203 201
204#ifdef CONFIG_FRAME_POINTER
205 if (!bp)
206 get_bp(bp);
207#endif
208
209 printk("Pid: %d, comm: %.20s %s %s %.*s\n", 202 printk("Pid: %d, comm: %.20s %s %s %.*s\n",
210 current->pid, current->comm, print_tainted(), 203 current->pid, current->comm, print_tainted(),
211 init_utsname()->release, 204 init_utsname()->release,
212 (int)strcspn(init_utsname()->version, " "), 205 (int)strcspn(init_utsname()->version, " "),
213 init_utsname()->version); 206 init_utsname()->version);
214 show_trace(NULL, NULL, &stack, bp); 207 show_trace(NULL, NULL, &stack);
215} 208}
216EXPORT_SYMBOL(dump_stack); 209EXPORT_SYMBOL(dump_stack);
217 210
@@ -224,11 +217,6 @@ unsigned __kprobes long oops_begin(void)
224 int cpu; 217 int cpu;
225 unsigned long flags; 218 unsigned long flags;
226 219
227 /* notify the hw-branch tracer so it may disable tracing and
228 add the last trace to the trace buffer -
229 the earlier this happens, the more useful the trace. */
230 trace_hw_branch_oops();
231
232 oops_enter(); 220 oops_enter();
233 221
234 /* racy, but better than risking deadlock. */ 222 /* racy, but better than risking deadlock. */
@@ -246,6 +234,7 @@ unsigned __kprobes long oops_begin(void)
246 bust_spinlocks(1); 234 bust_spinlocks(1);
247 return flags; 235 return flags;
248} 236}
237EXPORT_SYMBOL_GPL(oops_begin);
249 238
250void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr) 239void __kprobes oops_end(unsigned long flags, struct pt_regs *regs, int signr)
251{ 240{