Skip to contentSkip to conversation

dual line backtraces for i386.

PATCH Dave Jones 1 participant 1 message Jan 5, 2006

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

Another 'get better debug info from users' patch. x86-64 has had this since day one, and I don't know why no-one ever ported it to i386.

Instead of using one line per function call in the backtrace, we can fit two per line.

arch/i386/kernel/traps.c renamed from arch/i386/kernel/traps.c~ +10 -1
@@ -116,6 +116,7 @@ static inline unsigned long print_contex
 				unsigned long *stack, unsigned long ebp)
 {
 	unsigned long addr;
+	char space=0;
 
 #ifdef	CONFIG_FRAME_POINTER
 	while (valid_stack_ptr(tinfo, (void *)ebp)) {
@@ -131,9 +132,17 @@ static inline unsigned long print_contex
 		if (__kernel_text_address(addr)) {
 			printk(" [<%08lx>]", addr);
 			print_symbol(" %s", addr);
-			printk("\n");
+			if (space == 0) {
+				printk("    ");
+				space = 1;
+			} else {
+				printk("\n");
+				space = 0;
+			}
 		}
 	}
+	if (space==1)
+		printk("\n");
 #endif
 	return ebp;
 }