aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAlexander van Heukelum <heukelum@sleipnir.lusi.uni-sb.de>2008-10-04 17:12:44 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-13 04:33:43 -0400
commitca0a816403c53411bb6b6fb8bf60cef30695b09d (patch)
tree2a19497527209f362934d9edb8612651ed3a8122 /arch
parent2ac53721f37c79acddaf60f6ff232f56b7abddba (diff)
dumpstack: x86: use log_lvl and unify trace formatting
- x86: Write log_lvl strings if available - start raw stack dumps on new line - i386: Remove extra indentation for raw stack dumps Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/dumpstack_32.c18
-rw-r--r--arch/x86/kernel/dumpstack_64.c8
2 files changed, 13 insertions, 13 deletions
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index 517b507bc56a..09bc3330d557 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -155,8 +155,8 @@ static void
155show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, 155show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
156 unsigned long *stack, unsigned long bp, char *log_lvl) 156 unsigned long *stack, unsigned long bp, char *log_lvl)
157{ 157{
158 printk("%sCall Trace:\n", log_lvl);
158 dump_trace(task, regs, stack, bp, &print_trace_ops, log_lvl); 159 dump_trace(task, regs, stack, bp, &print_trace_ops, log_lvl);
159 printk("%s =======================\n", log_lvl);
160} 160}
161 161
162void show_trace(struct task_struct *task, struct pt_regs *regs, 162void show_trace(struct task_struct *task, struct pt_regs *regs,
@@ -184,17 +184,16 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
184 if (kstack_end(stack)) 184 if (kstack_end(stack))
185 break; 185 break;
186 if (i && ((i % 8) == 0)) 186 if (i && ((i % 8) == 0))
187 printk("\n%s ", log_lvl); 187 printk("\n%s", log_lvl);
188 printk("%08lx ", *stack++); 188 printk(" %08lx", *stack++);
189 touch_nmi_watchdog();
189 } 190 }
190 printk("\n%sCall Trace:\n", log_lvl); 191 printk("\n");
191
192 show_trace_log_lvl(task, regs, sp, bp, log_lvl); 192 show_trace_log_lvl(task, regs, sp, bp, log_lvl);
193} 193}
194 194
195void show_stack(struct task_struct *task, unsigned long *sp) 195void show_stack(struct task_struct *task, unsigned long *sp)
196{ 196{
197 printk(" ");
198 show_stack_log_lvl(task, NULL, sp, 0, ""); 197 show_stack_log_lvl(task, NULL, sp, 0, "");
199} 198}
200 199
@@ -229,7 +228,7 @@ void show_registers(struct pt_regs *regs)
229 print_modules(); 228 print_modules();
230 __show_regs(regs, 0); 229 __show_regs(regs, 0);
231 230
232 printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)", 231 printk(KERN_EMERG "Process %.*s (pid: %d, ti=%p task=%p task.ti=%p)\n",
233 TASK_COMM_LEN, current->comm, task_pid_nr(current), 232 TASK_COMM_LEN, current->comm, task_pid_nr(current),
234 current_thread_info(), current, task_thread_info(current)); 233 current_thread_info(), current, task_thread_info(current));
235 /* 234 /*
@@ -242,8 +241,9 @@ void show_registers(struct pt_regs *regs)
242 unsigned char c; 241 unsigned char c;
243 u8 *ip; 242 u8 *ip;
244 243
245 printk("\n" KERN_EMERG "Stack: "); 244 printk(KERN_EMERG "Stack:\n");
246 show_stack_log_lvl(NULL, regs, &regs->sp, 0, KERN_EMERG); 245 show_stack_log_lvl(NULL, regs, &regs->sp,
246 0, KERN_EMERG);
247 247
248 printk(KERN_EMERG "Code: "); 248 printk(KERN_EMERG "Code: ");
249 249
diff --git a/arch/x86/kernel/dumpstack_64.c b/arch/x86/kernel/dumpstack_64.c
index 521c833cdc3b..7fd32944ceac 100644
--- a/arch/x86/kernel/dumpstack_64.c
+++ b/arch/x86/kernel/dumpstack_64.c
@@ -284,7 +284,7 @@ static void
284show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, 284show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
285 unsigned long *stack, unsigned long bp, char *log_lvl) 285 unsigned long *stack, unsigned long bp, char *log_lvl)
286{ 286{
287 printk("Call Trace:\n"); 287 printk("%sCall Trace:\n", log_lvl);
288 dump_trace(task, regs, stack, bp, &print_trace_ops, log_lvl); 288 dump_trace(task, regs, stack, bp, &print_trace_ops, log_lvl);
289} 289}
290 290
@@ -330,7 +330,7 @@ show_stack_log_lvl(struct task_struct *task, struct pt_regs *regs,
330 break; 330 break;
331 } 331 }
332 if (i && ((i % 4) == 0)) 332 if (i && ((i % 4) == 0))
333 printk("\n"); 333 printk("\n%s", log_lvl);
334 printk(" %016lx", *stack++); 334 printk(" %016lx", *stack++);
335 touch_nmi_watchdog(); 335 touch_nmi_watchdog();
336 } 336 }
@@ -388,9 +388,9 @@ void show_registers(struct pt_regs *regs)
388 unsigned char c; 388 unsigned char c;
389 u8 *ip; 389 u8 *ip;
390 390
391 printk("Stack: "); 391 printk(KERN_EMERG "Stack:\n");
392 show_stack_log_lvl(NULL, regs, (unsigned long *)sp, 392 show_stack_log_lvl(NULL, regs, (unsigned long *)sp,
393 regs->bp, ""); 393 regs->bp, KERN_EMERG);
394 394
395 printk(KERN_EMERG "Code: "); 395 printk(KERN_EMERG "Code: ");
396 396