Skip to contentSkip to conversation

x86: add NUMA to oops messages

PATCH In review Chuck Ebbert 2 participants 2 messages Jun 18, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: add NUMA to oops messages

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.

 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(-)
arch/i386/kernel/traps.c +4 -11
@@ -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) {
arch/x86_64/kernel/traps.c +3 -10
@@ -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);
include/linux/vermagic.h +14 -1
@@ -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
Signature · 2 lines
Chuck
 "You can't read a newspaper if you can't read."  --George W. Bush
#1 lore raw
Quoted 2 lines · Chuck Ebbert

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