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 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

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  8:13 [patch 2.6.16-rc6-mm2] x86: add NUMA to oops messages Chuck Ebbert
2006-06-18  8:59 ` Andi Kleen
  -- strict thread matches above, loose matches on Subject: below --
2006-06-18 12:13 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

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