Skip to contentSkip to conversation

x86: Make sure we also print a Code: line for show_regs()

PATCH In review Arjan van de Ven 3 participants 3 messages Nov 3, 2009 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: Make sure we also print a Code: line for show_regs()

Quoted 1 line

From c560acdd03d28d3dc55ed9c19d42d4567caab1d8 Mon Sep 17 00:00:00 2001

From: Arjan van de Ven <[email protected]>
Date: Mon, 2 Nov 2009 16:50:04 -0800
Subject: [PATCH] x86: Make sure we also print a Code: line for show_regs()

show_regs() is called as a mini BUG() equivalent in some places, specifically for the "scheduling while atomic" case.

Unfortunately right now it does not print a Code: like unlike a real bug/oops.

This patch changes the x86 implementation of show_regs() so that it calls the same function as oopses do to print the registers as well as the Code: line.

---
 arch/x86/kernel/process_32.c |    2 +-
 arch/x86/kernel/process_64.c |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
arch/x86/kernel/process_32.c +1 -1
index f2cb086..b124f2f 100644
@@ -189,7 +189,7 @@ void __show_regs(struct pt_regs *regs, int all)
 
 void show_regs(struct pt_regs *regs)
 {
-	__show_regs(regs, 1);
+	show_registers(regs);
 	show_trace(NULL, regs, &regs->sp, regs->bp);
 }
 
arch/x86/kernel/process_64.c +1 -2
index 959b062..e53e66f 100644
@@ -228,8 +228,7 @@ void __show_regs(struct pt_regs *regs, int all)
 
 void show_regs(struct pt_regs *regs)
 {
-	printk(KERN_INFO "CPU %d:", smp_processor_id());
-	__show_regs(regs, 1);
+	show_registers(regs);
 	show_trace(NULL, regs, (void *)(regs + 1), regs->bp);
 }
 
Signature · 8 lines
1.6.0.6



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Arjan van de Ven

From c560acdd03d28d3dc55ed9c19d42d4567caab1d8 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <[email protected]>
Date: Mon, 2 Nov 2009 16:50:04 -0800
Subject: [PATCH] x86: Make sure we also print a Code: line for show_regs()

show_regs() is called as a mini BUG() equivalent in some places, specifically for the "scheduling while atomic" case.

Quoted 8 lines

Unfortunately right now it does not print a Code: like unlike a real bug/oops.

This patch changes the x86 implementation of show_regs() so that it calls the same function as oopses do to print the registers as well as the Code: line.

Quoted 46 lines

---

arch/x86/kernel/process_32.c |    2 +-
arch/x86/kernel/process_64.c |    3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
arch/x86/kernel/process_32.c +1 -1
index f2cb086..b124f2f 100644
@@ -189,7 +189,7 @@ void __show_regs(struct pt_regs *regs, int all)
 
 void show_regs(struct pt_regs *regs)
 {
-	__show_regs(regs, 1);
+	show_registers(regs);
 	show_trace(NULL, regs, &regs->sp, regs->bp);
 }
 
arch/x86/kernel/process_64.c +1 -2
index 959b062..e53e66f 100644
@@ -228,8 +228,7 @@ void __show_regs(struct pt_regs *regs, int all)
 
 void show_regs(struct pt_regs *regs)
 {
-	printk(KERN_INFO "CPU %d:", smp_processor_id());
-	__show_regs(regs, 1);
+	show_registers(regs);
 	show_trace(NULL, regs, (void *)(regs + 1), regs->bp);
 }
 
Signature · 13 lines
1.6.0.6



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Signature · 1 line
Live like a child, think like the god.
#2 lore raw
In reply to Arjan van de Ven
Commit-ID:  a489ca355efaf9efa4990b0f8f30ab650a206273
Gitweb:     http://git.kernel.org/tip/a489ca355efaf9efa4990b0f8f30ab650a206273
Author:     Arjan van de Ven <[email protected]>
AuthorDate: Mon, 2 Nov 2009 16:59:15 -0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 3 Nov 2009 16:50:22 +0100

x86: Make sure we also print a Code: line for show_regs()

show_regs() is called as a mini BUG() equivalent in some places, specifically for the "scheduling while atomic" case.

Unfortunately right now it does not print a Code: line unlike a real bug/oops.

This patch changes the x86 implementation of show_regs() so that it calls the same function as oopses do to print the registers as well as the Code: line.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/process_32.c |    2 +-
 arch/x86/kernel/process_64.c |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
arch/x86/kernel/process_32.c +1 -1
index 4cf7956..e658331 100644
@@ -187,7 +187,7 @@ void __show_regs(struct pt_regs *regs, int all)
 
 void show_regs(struct pt_regs *regs)
 {
-	__show_regs(regs, 1);
+	show_registers(regs);
 	show_trace(NULL, regs, &regs->sp, regs->bp);
 }
 
arch/x86/kernel/process_64.c +1 -2
index ad535b6..2386999 100644
@@ -226,8 +226,7 @@ void __show_regs(struct pt_regs *regs, int all)
 
 void show_regs(struct pt_regs *regs)
 {
-	printk(KERN_INFO "CPU %d:", smp_processor_id());
-	__show_regs(regs, 1);
+	show_registers(regs);
 	show_trace(NULL, regs, (void *)(regs + 1), regs->bp);
 }