public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Make sure we also print a Code: line for show_regs()
@ 2009-11-03  0:59 Arjan van de Ven
  2009-11-03  2:39 ` Américo Wang
  2009-11-03 15:54 ` [tip:x86/debug] " tip-bot for Arjan van de Ven
  0 siblings, 2 replies; 3+ messages in thread
From: Arjan van de Ven @ 2009-11-03  0:59 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86

>From c560acdd03d28d3dc55ed9c19d42d4567caab1d8 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
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.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
 arch/x86/kernel/process_32.c |    2 +-
 arch/x86/kernel/process_64.c |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index f2cb086..b124f2f 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -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);
 }
 
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 959b062..e53e66f 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -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);
 }
 
-- 
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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: Make sure we also print a Code: line for show_regs()
  2009-11-03  0:59 [PATCH] x86: Make sure we also print a Code: line for show_regs() Arjan van de Ven
@ 2009-11-03  2:39 ` Américo Wang
  2009-11-03 15:54 ` [tip:x86/debug] " tip-bot for Arjan van de Ven
  1 sibling, 0 replies; 3+ messages in thread
From: Américo Wang @ 2009-11-03  2:39 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: linux-kernel, x86

On Mon, Nov 02, 2009 at 04:59:15PM -0800, Arjan van de Ven wrote:
>From c560acdd03d28d3dc55ed9c19d42d4567caab1d8 Mon Sep 17 00:00:00 2001
>From: Arjan van de Ven <arjan@linux.intel.com>
>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.
>
>Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>

Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>

>---
> arch/x86/kernel/process_32.c |    2 +-
> arch/x86/kernel/process_64.c |    3 +--
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
>diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
>index f2cb086..b124f2f 100644
>--- a/arch/x86/kernel/process_32.c
>+++ b/arch/x86/kernel/process_32.c
>@@ -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);
> }
> 
>diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
>index 959b062..e53e66f 100644
>--- a/arch/x86/kernel/process_64.c
>+++ b/arch/x86/kernel/process_64.c
>@@ -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);
> }
> 
>-- 
>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 majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/

-- 
Live like a child, think like the god.
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/debug] x86: Make sure we also print a Code: line for show_regs()
  2009-11-03  0:59 [PATCH] x86: Make sure we also print a Code: line for show_regs() Arjan van de Ven
  2009-11-03  2:39 ` Américo Wang
@ 2009-11-03 15:54 ` tip-bot for Arjan van de Ven
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Arjan van de Ven @ 2009-11-03 15:54 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, arjan, tglx, mingo

Commit-ID:  a489ca355efaf9efa4990b0f8f30ab650a206273
Gitweb:     http://git.kernel.org/tip/a489ca355efaf9efa4990b0f8f30ab650a206273
Author:     Arjan van de Ven <arjan@linux.intel.com>
AuthorDate: Mon, 2 Nov 2009 16:59:15 -0800
Committer:  Ingo Molnar <mingo@elte.hu>
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.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
LKML-Reference: <20091102165915.4a980fc0@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 arch/x86/kernel/process_32.c |    2 +-
 arch/x86/kernel/process_64.c |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 4cf7956..e658331 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -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);
 }
 
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index ad535b6..2386999 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -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);
 }
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-03 15:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-03  0:59 [PATCH] x86: Make sure we also print a Code: line for show_regs() Arjan van de Ven
2009-11-03  2:39 ` Américo Wang
2009-11-03 15:54 ` [tip:x86/debug] " tip-bot for Arjan van de Ven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox