Commit 9c107805aba774667debc01704718960339c24b9
Committed by
Linus Torvalds
1 parent
51989b9ffe
Exists in
master
and in
7 other branches
[PATCH] printk levels for i386 oops code.
Especially useful when users have booted with 'quiet'. In the regular 'oops' path, we set the console_loglevel before we start spewing debug info, but we can call the backtrace code from other places now too, such as the spinlock debugging code. Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 1 changed file with 34 additions and 27 deletions Side-by-side Diff
arch/i386/kernel/traps.c
... | ... | @@ -120,7 +120,7 @@ |
120 | 120 | #ifdef CONFIG_FRAME_POINTER |
121 | 121 | while (valid_stack_ptr(tinfo, (void *)ebp)) { |
122 | 122 | addr = *(unsigned long *)(ebp + 4); |
123 | - printk(" [<%08lx>] ", addr); | |
123 | + printk(KERN_EMERG " [<%08lx>] ", addr); | |
124 | 124 | print_symbol("%s", addr); |
125 | 125 | printk("\n"); |
126 | 126 | ebp = *(unsigned long *)ebp; |
... | ... | @@ -129,7 +129,7 @@ |
129 | 129 | while (valid_stack_ptr(tinfo, stack)) { |
130 | 130 | addr = *stack++; |
131 | 131 | if (__kernel_text_address(addr)) { |
132 | - printk(" [<%08lx>]", addr); | |
132 | + printk(KERN_EMERG " [<%08lx>]", addr); | |
133 | 133 | print_symbol(" %s", addr); |
134 | 134 | printk("\n"); |
135 | 135 | } |
... | ... | @@ -161,7 +161,7 @@ |
161 | 161 | stack = (unsigned long*)context->previous_esp; |
162 | 162 | if (!stack) |
163 | 163 | break; |
164 | - printk(" =======================\n"); | |
164 | + printk(KERN_EMERG " =======================\n"); | |
165 | 165 | } |
166 | 166 | } |
167 | 167 | |
168 | 168 | |
169 | 169 | |
... | ... | @@ -178,14 +178,15 @@ |
178 | 178 | } |
179 | 179 | |
180 | 180 | stack = esp; |
181 | + printk(KERN_EMERG); | |
181 | 182 | for(i = 0; i < kstack_depth_to_print; i++) { |
182 | 183 | if (kstack_end(stack)) |
183 | 184 | break; |
184 | 185 | if (i && ((i % 8) == 0)) |
185 | - printk("\n "); | |
186 | + printk("\n" KERN_EMERG " "); | |
186 | 187 | printk("%08lx ", *stack++); |
187 | 188 | } |
188 | - printk("\nCall Trace:\n"); | |
189 | + printk("\n" KERN_EMERG "Call Trace:\n"); | |
189 | 190 | show_trace(task, esp); |
190 | 191 | } |
191 | 192 | |
192 | 193 | |
193 | 194 | |
194 | 195 | |
195 | 196 | |
... | ... | @@ -216,18 +217,18 @@ |
216 | 217 | ss = regs->xss & 0xffff; |
217 | 218 | } |
218 | 219 | print_modules(); |
219 | - printk("CPU: %d\nEIP: %04x:[<%08lx>] %s VLI\nEFLAGS: %08lx" | |
220 | - " (%s) \n", | |
220 | + printk(KERN_EMERG "CPU: %d\nEIP: %04x:[<%08lx>] %s VLI\n" | |
221 | + "EFLAGS: %08lx (%s) \n", | |
221 | 222 | smp_processor_id(), 0xffff & regs->xcs, regs->eip, |
222 | 223 | print_tainted(), regs->eflags, system_utsname.release); |
223 | - print_symbol("EIP is at %s\n", regs->eip); | |
224 | - printk("eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n", | |
224 | + print_symbol(KERN_EMERG "EIP is at %s\n", regs->eip); | |
225 | + printk(KERN_EMERG "eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n", | |
225 | 226 | regs->eax, regs->ebx, regs->ecx, regs->edx); |
226 | - printk("esi: %08lx edi: %08lx ebp: %08lx esp: %08lx\n", | |
227 | + printk(KERN_EMERG "esi: %08lx edi: %08lx ebp: %08lx esp: %08lx\n", | |
227 | 228 | regs->esi, regs->edi, regs->ebp, esp); |
228 | - printk("ds: %04x es: %04x ss: %04x\n", | |
229 | + printk(KERN_EMERG "ds: %04x es: %04x ss: %04x\n", | |
229 | 230 | regs->xds & 0xffff, regs->xes & 0xffff, ss); |
230 | - printk("Process %s (pid: %d, threadinfo=%p task=%p)", | |
231 | + printk(KERN_EMERG "Process %s (pid: %d, threadinfo=%p task=%p)", | |
231 | 232 | current->comm, current->pid, current_thread_info(), current); |
232 | 233 | /* |
233 | 234 | * When in-kernel, we also print out the stack and code at the |
234 | 235 | |
... | ... | @@ -236,10 +237,10 @@ |
236 | 237 | if (in_kernel) { |
237 | 238 | u8 __user *eip; |
238 | 239 | |
239 | - printk("\nStack: "); | |
240 | + printk("\n" KERN_EMERG "Stack: "); | |
240 | 241 | show_stack(NULL, (unsigned long*)esp); |
241 | 242 | |
242 | - printk("Code: "); | |
243 | + printk(KERN_EMERG "Code: "); | |
243 | 244 | |
244 | 245 | eip = (u8 __user *)regs->eip - 43; |
245 | 246 | for (i = 0; i < 64; i++, eip++) { |
246 | 247 | |
... | ... | @@ -280,15 +281,15 @@ |
280 | 281 | (unsigned long)file < PAGE_OFFSET || __get_user(c, file)) |
281 | 282 | file = "<bad filename>"; |
282 | 283 | |
283 | - printk("------------[ cut here ]------------\n"); | |
284 | - printk(KERN_ALERT "kernel BUG at %s:%d!\n", file, line); | |
284 | + printk(KERN_EMERG "------------[ cut here ]------------\n"); | |
285 | + printk(KERN_EMERG "kernel BUG at %s:%d!\n", file, line); | |
285 | 286 | |
286 | 287 | no_bug: |
287 | 288 | return; |
288 | 289 | |
289 | 290 | /* Here we know it was a BUG but file-n-line is unavailable */ |
290 | 291 | bug: |
291 | - printk("Kernel BUG\n"); | |
292 | + printk(KERN_EMERG "Kernel BUG\n"); | |
292 | 293 | } |
293 | 294 | |
294 | 295 | /* This is gone through when something in the kernel |
295 | 296 | |
296 | 297 | |
297 | 298 | |
... | ... | @@ -321,16 +322,20 @@ |
321 | 322 | if (++die.lock_owner_depth < 3) { |
322 | 323 | int nl = 0; |
323 | 324 | handle_BUG(regs); |
324 | - printk(KERN_ALERT "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); | |
325 | + printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); | |
325 | 326 | #ifdef CONFIG_PREEMPT |
326 | - printk("PREEMPT "); | |
327 | + printk(KERN_EMERG "PREEMPT "); | |
327 | 328 | nl = 1; |
328 | 329 | #endif |
329 | 330 | #ifdef CONFIG_SMP |
331 | + if (!nl) | |
332 | + printk(KERN_EMERG); | |
330 | 333 | printk("SMP "); |
331 | 334 | nl = 1; |
332 | 335 | #endif |
333 | 336 | #ifdef CONFIG_DEBUG_PAGEALLOC |
337 | + if (!nl) | |
338 | + printk(KERN_EMERG); | |
334 | 339 | printk("DEBUG_PAGEALLOC"); |
335 | 340 | nl = 1; |
336 | 341 | #endif |
... | ... | @@ -339,7 +344,7 @@ |
339 | 344 | notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV); |
340 | 345 | show_registers(regs); |
341 | 346 | } else |
342 | - printk(KERN_ERR "Recursive die() failure, output suppressed\n"); | |
347 | + printk(KERN_EMERG "Recursive die() failure, output suppressed\n"); | |
343 | 348 | |
344 | 349 | bust_spinlocks(0); |
345 | 350 | die.lock_owner = -1; |
... | ... | @@ -527,8 +532,10 @@ |
527 | 532 | |
528 | 533 | static void mem_parity_error(unsigned char reason, struct pt_regs * regs) |
529 | 534 | { |
530 | - printk("Uhhuh. NMI received. Dazed and confused, but trying to continue\n"); | |
531 | - printk("You probably have a hardware problem with your RAM chips\n"); | |
535 | + printk(KERN_EMERG "Uhhuh. NMI received. Dazed and confused, but trying " | |
536 | + "to continue\n"); | |
537 | + printk(KERN_EMERG "You probably have a hardware problem with your RAM " | |
538 | + "chips\n"); | |
532 | 539 | |
533 | 540 | /* Clear and disable the memory parity error line. */ |
534 | 541 | clear_mem_error(reason); |
... | ... | @@ -538,7 +545,7 @@ |
538 | 545 | { |
539 | 546 | unsigned long i; |
540 | 547 | |
541 | - printk("NMI: IOCK error (debug interrupt?)\n"); | |
548 | + printk(KERN_EMERG "NMI: IOCK error (debug interrupt?)\n"); | |
542 | 549 | show_registers(regs); |
543 | 550 | |
544 | 551 | /* Re-enable the IOCK line, wait for a few seconds */ |
545 | 552 | |
... | ... | @@ -580,11 +587,11 @@ |
580 | 587 | * to get a message out. |
581 | 588 | */ |
582 | 589 | bust_spinlocks(1); |
583 | - printk(msg); | |
590 | + printk(KERN_EMERG "%s", msg); | |
584 | 591 | printk(" on CPU%d, eip %08lx, registers:\n", |
585 | 592 | smp_processor_id(), regs->eip); |
586 | 593 | show_registers(regs); |
587 | - printk("console shuts up ...\n"); | |
594 | + printk(KERN_EMERG "console shuts up ...\n"); | |
588 | 595 | console_silent(); |
589 | 596 | spin_unlock(&nmi_print_lock); |
590 | 597 | bust_spinlocks(0); |
... | ... | @@ -990,8 +997,8 @@ |
990 | 997 | |
991 | 998 | asmlinkage void math_emulate(long arg) |
992 | 999 | { |
993 | - printk("math-emulation not enabled and no coprocessor found.\n"); | |
994 | - printk("killing %s.\n",current->comm); | |
1000 | + printk(KERN_EMERG "math-emulation not enabled and no coprocessor found.\n"); | |
1001 | + printk(KERN_EMERG "killing %s.\n",current->comm); | |
995 | 1002 | force_sig(SIGFPE,current); |
996 | 1003 | schedule(); |
997 | 1004 | } |