Commit ca0a816403c53411bb6b6fb8bf60cef30695b09d

Authored by Alexander van Heukelum
Committed by Ingo Molnar
1 parent 2ac53721f3

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>

Showing 2 changed files with 13 additions and 13 deletions Side-by-side Diff

arch/x86/kernel/dumpstack_32.c
... ... @@ -155,8 +155,8 @@
155 155 show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
156 156 unsigned long *stack, unsigned long bp, char *log_lvl)
157 157 {
  158 + printk("%sCall Trace:\n", log_lvl);
158 159 dump_trace(task, regs, stack, bp, &print_trace_ops, log_lvl);
159   - printk("%s =======================\n", log_lvl);
160 160 }
161 161  
162 162 void show_trace(struct task_struct *task, struct pt_regs *regs,
163 163  
164 164  
... ... @@ -184,17 +184,16 @@
184 184 if (kstack_end(stack))
185 185 break;
186 186 if (i && ((i % 8) == 0))
187   - printk("\n%s ", log_lvl);
188   - printk("%08lx ", *stack++);
  187 + printk("\n%s", log_lvl);
  188 + printk(" %08lx", *stack++);
  189 + touch_nmi_watchdog();
189 190 }
190   - printk("\n%sCall Trace:\n", log_lvl);
191   -
  191 + printk("\n");
192 192 show_trace_log_lvl(task, regs, sp, bp, log_lvl);
193 193 }
194 194  
195 195 void show_stack(struct task_struct *task, unsigned long *sp)
196 196 {
197   - printk(" ");
198 197 show_stack_log_lvl(task, NULL, sp, 0, "");
199 198 }
200 199  
... ... @@ -229,7 +228,7 @@
229 228 print_modules();
230 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 232 TASK_COMM_LEN, current->comm, task_pid_nr(current),
234 233 current_thread_info(), current, task_thread_info(current));
235 234 /*
... ... @@ -242,8 +241,9 @@
242 241 unsigned char c;
243 242 u8 *ip;
244 243  
245   - printk("\n" KERN_EMERG "Stack: ");
246   - show_stack_log_lvl(NULL, regs, &regs->sp, 0, KERN_EMERG);
  244 + printk(KERN_EMERG "Stack:\n");
  245 + show_stack_log_lvl(NULL, regs, &regs->sp,
  246 + 0, KERN_EMERG);
247 247  
248 248 printk(KERN_EMERG "Code: ");
249 249  
arch/x86/kernel/dumpstack_64.c
... ... @@ -284,7 +284,7 @@
284 284 show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs,
285 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 288 dump_trace(task, regs, stack, bp, &print_trace_ops, log_lvl);
289 289 }
290 290  
... ... @@ -330,7 +330,7 @@
330 330 break;
331 331 }
332 332 if (i && ((i % 4) == 0))
333   - printk("\n");
  333 + printk("\n%s", log_lvl);
334 334 printk(" %016lx", *stack++);
335 335 touch_nmi_watchdog();
336 336 }
337 337  
... ... @@ -388,9 +388,9 @@
388 388 unsigned char c;
389 389 u8 *ip;
390 390  
391   - printk("Stack: ");
  391 + printk(KERN_EMERG "Stack:\n");
392 392 show_stack_log_lvl(NULL, regs, (unsigned long *)sp,
393   - regs->bp, "");
  393 + regs->bp, KERN_EMERG);
394 394  
395 395 printk(KERN_EMERG "Code: ");
396 396