Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kernel/panic.c: display reason at end + pr_emerg

Currently, booting without initrd specified on 80x25 screen gives a call
trace followed by atkbd : Spurious ACK. Original message ("VFS: Unable
to mount root fs") is not available. Of course this could happen in
other situations...

This patch displays panic reason after call trace which could help lot
of people even if it's not the very last line on screen.

Also, convert all panic.c printk(KERN_EMERG to pr_emerg(

[akpm@linux-foundation.org: missed a couple of pr_ conversions]
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Fabian Frederick and committed by
Linus Torvalds
d7c0847f 758b4440

+6 -7
+6 -7
kernel/panic.c
··· 100 100 va_start(args, fmt); 101 101 vsnprintf(buf, sizeof(buf), fmt, args); 102 102 va_end(args); 103 - printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf); 103 + pr_emerg("Kernel panic - not syncing: %s\n", buf); 104 104 #ifdef CONFIG_DEBUG_BUGVERBOSE 105 105 /* 106 106 * Avoid nested stack-dumping if a panic occurs during oops processing ··· 141 141 * Delay timeout seconds before rebooting the machine. 142 142 * We can't use the "normal" timers since we just panicked. 143 143 */ 144 - printk(KERN_EMERG "Rebooting in %d seconds..", panic_timeout); 144 + pr_emerg("Rebooting in %d seconds..", panic_timeout); 145 145 146 146 for (i = 0; i < panic_timeout * 1000; i += PANIC_TIMER_STEP) { 147 147 touch_nmi_watchdog(); ··· 165 165 extern int stop_a_enabled; 166 166 /* Make sure the user can actually press Stop-A (L1-A) */ 167 167 stop_a_enabled = 1; 168 - printk(KERN_EMERG "Press Stop-A (L1-A) to return to the boot prom\n"); 168 + pr_emerg("Press Stop-A (L1-A) to return to the boot prom\n"); 169 169 } 170 170 #endif 171 171 #if defined(CONFIG_S390) ··· 176 176 disabled_wait(caller); 177 177 } 178 178 #endif 179 + pr_emerg("---[ end Kernel panic - not syncing: %s\n", buf); 179 180 local_irq_enable(); 180 181 for (i = 0; ; i += PANIC_TIMER_STEP) { 181 182 touch_softlockup_watchdog(); ··· 277 276 void add_taint(unsigned flag, enum lockdep_ok lockdep_ok) 278 277 { 279 278 if (lockdep_ok == LOCKDEP_NOW_UNRELIABLE && __debug_locks_off()) 280 - printk(KERN_WARNING 281 - "Disabling lock debugging due to kernel taint\n"); 279 + pr_warn("Disabling lock debugging due to kernel taint\n"); 282 280 283 281 set_bit(flag, &tainted_mask); 284 282 } ··· 382 382 void print_oops_end_marker(void) 383 383 { 384 384 init_oops_id(); 385 - printk(KERN_WARNING "---[ end trace %016llx ]---\n", 386 - (unsigned long long)oops_id); 385 + pr_warn("---[ end trace %016llx ]---\n", (unsigned long long)oops_id); 387 386 } 388 387 389 388 /*