Skip to contentSkip to conversation

i386: fix dump_stack()

PATCH New Chuck Ebbert 1 participant 1 message Mar 6, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i386: fix dump_stack()

i386 has a small bug in the stack dump code where it prints an extra log level code. Remove that and fix the alignment of normal stack dump printout. Also remove some unnecessary printk() calls.

arch/i386/kernel/traps.c +4 -9
@@ -190,25 +190,20 @@ static void show_stack_log_lvl(struct ta
 	}
 
 	stack = esp;
-	printk(log_lvl);
 	for(i = 0; i < kstack_depth_to_print; i++) {
 		if (kstack_end(stack))
 			break;
-		if (i && ((i % 8) == 0)) {
-			printk("\n");
-			printk(log_lvl);
-			printk("       ");
-		}
+		if (i && ((i % 8) == 0))
+			printk("\n%s       ", log_lvl);
 		printk("%08lx ", *stack++);
 	}
-	printk("\n");
-	printk(log_lvl);
-	printk("Call Trace:\n");
+	printk("\n%sCall Trace:\n", log_lvl);
 	show_trace_log_lvl(task, esp, log_lvl);
 }
 
 void show_stack(struct task_struct *task, unsigned long *esp)
 {
+	printk("       ");
 	show_stack_log_lvl(task, esp, "");
 }
 
Signature · 2 lines
Chuck
"Penguins don't come from next door, they come from the Antarctic!"