aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-07-25 21:18:04 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-07-25 21:18:04 -0400
commit36e635cb21d96da0f30b91a39cc95ef4ed1bce26 (patch)
treec28397756f579bbd23f1570ca612772c02cfbab2 /arch/x86/kernel
parentc265cc5c3cb2e950910437a846ef59e3a5c2df51 (diff)
parent81c2949f7fdcf8ff681326669afde24962232670 (diff)
Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 stackdump update from Ingo Molnar: "A number of stackdump enhancements" * 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/dumpstack: Add show_stack_regs() and use it printk: Make the printk*once() variants return a value x86/dumpstack: Honor supplied @regs arg
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/dumpstack.c5
-rw-r--r--arch/x86/kernel/dumpstack_32.c4
-rw-r--r--arch/x86/kernel/dumpstack_64.c4
3 files changed, 11 insertions, 2 deletions
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index de8242d8bb61..92e8f0a7159c 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -205,6 +205,11 @@ void show_stack(struct task_struct *task, unsigned long *sp)
205 show_stack_log_lvl(task, NULL, sp, bp, ""); 205 show_stack_log_lvl(task, NULL, sp, bp, "");
206} 206}
207 207
208void show_stack_regs(struct pt_regs *regs)
209{
210 show_stack_log_lvl(current, regs, (unsigned long *)regs->sp, regs->bp, "");
211}
212
208static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED; 213static arch_spinlock_t die_lock = __ARCH_SPIN_LOCK_UNLOCKED;
209static int die_owner = -1; 214static int die_owner = -1;
210static unsigned int die_nest_count; 215static unsigned int die_nest_count;
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index fef917e79b9d..948d77da3881 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -96,7 +96,9 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
96 int i; 96 int i;
97 97
98 if (sp == NULL) { 98 if (sp == NULL) {
99 if (task) 99 if (regs)
100 sp = (unsigned long *)regs->sp;
101 else if (task)
100 sp = (unsigned long *)task->thread.sp; 102 sp = (unsigned long *)task->thread.sp;
101 else 103 else
102 sp = (unsigned long *)&sp; 104 sp = (unsigned long *)&sp;
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index 2552a1eadfed..6dede08dd98b 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -264,7 +264,9 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
264 * back trace for this cpu: 264 * back trace for this cpu:
265 */ 265 */
266 if (sp == NULL) { 266 if (sp == NULL) {
267 if (task) 267 if (regs)
268 sp = (unsigned long *)regs->sp;
269 else if (task)
268 sp = (unsigned long *)task->thread.sp; 270 sp = (unsigned long *)task->thread.sp;
269 else 271 else
270 sp = (unsigned long *)&sp; 272 sp = (unsigned long *)&sp;