public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2.6.16-rc6-mm2] x86: add NUMA to oops messages
@ 2006-06-18  8:13 Chuck Ebbert
  2006-06-18  8:59 ` Andi Kleen
  0 siblings, 1 reply; 6+ messages in thread
From: Chuck Ebbert @ 2006-06-18  8:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Andrew Morton, Arjan van de Ven

Add "NUMA" to x86 oops printouts to help with debugging.  Use vermagic.h
defines to clean up the code, suggested by Arjan van de Ven.

Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>

 arch/i386/kernel/traps.c   |   15 ++++-----------
 arch/x86_64/kernel/traps.c |   13 +++----------
 include/linux/vermagic.h   |   15 ++++++++++++++-
 3 files changed, 21 insertions(+), 22 deletions(-)

--- 2.6.17-rc6-mm2-32.orig/arch/i386/kernel/traps.c
+++ 2.6.17-rc6-mm2-32/arch/i386/kernel/traps.c
@@ -29,6 +29,7 @@
 #include <linux/kprobes.h>
 #include <linux/kexec.h>
 #include <linux/unwind.h>
+#include <linux/vermagic.h>
 
 #ifdef CONFIG_EISA
 #include <linux/ioport.h>
@@ -391,17 +392,9 @@ void die(const char * str, struct pt_reg
 		handle_BUG(regs);
 		printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff,
 				++die_counter);
-		printk(KERN_EMERG "%dK_STACKS ", THREAD_SIZE / 1024);
-#ifdef CONFIG_PREEMPT
-		printk("PREEMPT ");
-#endif
-#ifdef CONFIG_SMP
-		printk("SMP ");
-#endif
-#ifdef CONFIG_DEBUG_PAGEALLOC
-		printk("DEBUG_PAGEALLOC");
-#endif
-		printk("\n");
+		printk(KERN_EMERG MODULE_VERMAGIC_PREEMPT MODULE_VERMAGIC_SMP
+		       VERMAGIC_NUMA VERMAGIC_DEBUG_PAGEALLOC);
+		printk("%dK_STACKS\n", THREAD_SIZE / 1024);
 		sysfs_printk_last_file();
 		if (notify_die(DIE_OOPS, str, regs, err,
 			    current->thread.trap_no, SIGSEGV) != NOTIFY_STOP) {
--- 2.6.17-rc6-mm2-32.orig/arch/x86_64/kernel/traps.c
+++ 2.6.17-rc6-mm2-32/arch/x86_64/kernel/traps.c
@@ -30,6 +30,7 @@
 #include <linux/kprobes.h>
 #include <linux/kexec.h>
 #include <linux/unwind.h>
+#include <linux/vermagic.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -528,16 +529,8 @@ void __kprobes __die(const char * str, s
 {
 	static int die_counter;
 	printk(KERN_EMERG "%s: %04lx [%u] ", str, err & 0xffff,++die_counter);
-#ifdef CONFIG_PREEMPT
-	printk("PREEMPT ");
-#endif
-#ifdef CONFIG_SMP
-	printk("SMP ");
-#endif
-#ifdef CONFIG_DEBUG_PAGEALLOC
-	printk("DEBUG_PAGEALLOC");
-#endif
-	printk("\n");
+	printk(MODULE_VERMAGIC_PREEMPT MODULE_VERMAGIC_SMP
+	       VERMAGIC_NUMA VERMAGIC_DEBUG_PAGEALLOC "\n");
 	sysfs_printk_last_file();
 	notify_die(DIE_OOPS, str, regs, err, current->thread.trap_no, SIGSEGV);
 	show_registers(regs);
--- 2.6.17-rc6-mm2-32.orig/include/linux/vermagic.h
+++ 2.6.17-rc6-mm2-32/include/linux/vermagic.h
@@ -8,7 +8,7 @@
 #define MODULE_VERMAGIC_SMP ""
 #endif
 #ifdef CONFIG_PREEMPT
-#define MODULE_VERMAGIC_PREEMPT "preempt "
+#define MODULE_VERMAGIC_PREEMPT "PREEMPT "
 #else
 #define MODULE_VERMAGIC_PREEMPT ""
 #endif
@@ -26,3 +26,16 @@
 	MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT 			\
 	MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC 		\
 	"gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__)
+
+/* for printing in debug routines */
+#ifdef CONFIG_DEBUG_PAGEALLOC
+#define VERMAGIC_DEBUG_PAGEALLOC "DEBUG_PAGEALLOC "
+#else
+#define VERMAGIC_DEBUG_PAGEALLOC ""
+#endif
+
+#ifdef CONFIG_NUMA
+#define VERMAGIC_NUMA "NUMA "
+#else
+#define VERMAGIC_NUMA ""
+#endif
-- 
Chuck
 "You can't read a newspaper if you can't read."  --George W. Bush

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

* Re: [patch 2.6.16-rc6-mm2] x86: add NUMA to oops messages
  2006-06-18  8:13 Chuck Ebbert
@ 2006-06-18  8:59 ` Andi Kleen
  0 siblings, 0 replies; 6+ messages in thread
From: Andi Kleen @ 2006-06-18  8:59 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: linux-kernel, Andrew Morton, Arjan van de Ven

On Sunday 18 June 2006 10:13, Chuck Ebbert wrote:
> Add "NUMA" to x86 oops printouts to help with debugging.  Use vermagic.h
> defines to clean up the code, suggested by Arjan van de Ven.

I don't see any particular value in printing NUMA here,
and putting half of .config into the oops doesn't seem
like a good long term strategy.

-Andi

  

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

* Re: [patch 2.6.16-rc6-mm2] x86: add NUMA to oops messages
@ 2006-06-18 12:13 Chuck Ebbert
  2006-06-18 12:48 ` Arjan van de Ven
  2006-06-18 16:16 ` Andreas Kleen
  0 siblings, 2 replies; 6+ messages in thread
From: Chuck Ebbert @ 2006-06-18 12:13 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Arjan van de Ven, Andrew Morton, linux-kernel

In-Reply-To: <200606181059.44576.ak@suse.de>

On Sun, 18 Jun 2006 10:59:44 +0200, Andi Kleen wrote:

> On Sunday 18 June 2006 10:13, Chuck Ebbert wrote:
> > Add "NUMA" to x86 oops printouts to help with debugging.  Use vermagic.h
> > defines to clean up the code, suggested by Arjan van de Ven.
> 
> I don't see any particular value in printing NUMA here,

It helps a lot when trying to decode oopses posted to the list, as the
NUMA kernel is very different now that the slab allocator and scheduler
are NUMA-aware.

 $ fgrep 'def CONFIG_NUMA' mm/*.c kernel/*.c include/linux/* | wc -l
 58
 $ fgrep 'def CONFIG_SMP' mm/*.c kernel/*.c include/linux/* | wc -l
 81

> and putting half of .config into the oops doesn't seem
> like a good long term strategy.

It's just this one thing; I can't think of anything else to add...

-- 
Chuck
 "You can't read a newspaper if you can't read."  --George W. Bush

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

* Re: [patch 2.6.16-rc6-mm2] x86: add NUMA to oops messages
  2006-06-18 12:13 [patch 2.6.16-rc6-mm2] x86: add NUMA to oops messages Chuck Ebbert
@ 2006-06-18 12:48 ` Arjan van de Ven
  2006-06-18 17:25   ` Randy.Dunlap
  2006-06-18 16:16 ` Andreas Kleen
  1 sibling, 1 reply; 6+ messages in thread
From: Arjan van de Ven @ 2006-06-18 12:48 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: Andi Kleen, Andrew Morton, linux-kernel

Chuck Ebbert wrote:
>> and putting half of .config into the oops doesn't seem
>> like a good long term strategy.
> 
> It's just this one thing; I can't think of anything else to add...
> 

if it's compact I'd actually put the entire vermagic line there...
it'll show compiler, preempt and a whole lot of other "distinctive" features


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

* Re: [patch 2.6.16-rc6-mm2] x86: add NUMA to oops messages
  2006-06-18 12:13 [patch 2.6.16-rc6-mm2] x86: add NUMA to oops messages Chuck Ebbert
  2006-06-18 12:48 ` Arjan van de Ven
@ 2006-06-18 16:16 ` Andreas Kleen
  1 sibling, 0 replies; 6+ messages in thread
From: Andreas Kleen @ 2006-06-18 16:16 UTC (permalink / raw)
  To: Chuck Ebbert; +Cc: Arjan van de Ven, Andrew Morton, linux-kernel

Am So 18.06.2006 14:13 schrieb Chuck Ebbert <76306.1226@compuserve.com>:

> In-Reply-To: <200606181059.44576.ak@suse.de>
>
> On Sun, 18 Jun 2006 10:59:44 +0200, Andi Kleen wrote:
>
> > On Sunday 18 June 2006 10:13, Chuck Ebbert wrote:
> > > Add "NUMA" to x86 oops printouts to help with debugging. Use
> > > vermagic.h
> > > defines to clean up the code, suggested by Arjan van de Ven.
> >
> > I don't see any particular value in printing NUMA here,
>
> It helps a lot when trying to decode oopses posted to the list, as the
> NUMA kernel is very different now that the slab allocator and
> scheduler
> are NUMA-aware.

And there are a thousand other things that change with other
CONFIG_* options. I also can't remember a bug where
this wasn't clear.

In general the rule of thumb is: i386: NUMA is not
used and x86-64 SMP: NUMA is used.

-Andi



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

* Re: [patch 2.6.16-rc6-mm2] x86: add NUMA to oops messages
  2006-06-18 12:48 ` Arjan van de Ven
@ 2006-06-18 17:25   ` Randy.Dunlap
  0 siblings, 0 replies; 6+ messages in thread
From: Randy.Dunlap @ 2006-06-18 17:25 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: 76306.1226, ak, akpm, linux-kernel

On Sun, 18 Jun 2006 14:48:27 +0200 Arjan van de Ven wrote:

> Chuck Ebbert wrote:
> >> and putting half of .config into the oops doesn't seem
> >> like a good long term strategy.
> > 
> > It's just this one thing; I can't think of anything else to add...
> > 
> 
> if it's compact I'd actually put the entire vermagic line there...
> it'll show compiler, preempt and a whole lot of other "distinctive" features

Yep, I like that idea too.

---
~Randy

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

end of thread, other threads:[~2006-06-18 17:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-18 12:13 [patch 2.6.16-rc6-mm2] x86: add NUMA to oops messages Chuck Ebbert
2006-06-18 12:48 ` Arjan van de Ven
2006-06-18 17:25   ` Randy.Dunlap
2006-06-18 16:16 ` Andreas Kleen
  -- strict thread matches above, loose matches on Subject: below --
2006-06-18  8:13 Chuck Ebbert
2006-06-18  8:59 ` Andi Kleen

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