diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-04-07 18:39:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-07 19:36:08 -0400 |
commit | d7c0847fe3682a026ee6d147c5b6b8ab457fffc8 (patch) | |
tree | 684a3b2eae10d3f1acb1f3794ee1226b4852c07a /kernel/panic.c | |
parent | 758b4440753969420290eeff69eeedc5a8521149 (diff) |
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>
Diffstat (limited to 'kernel/panic.c')
-rw-r--r-- | kernel/panic.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/kernel/panic.c b/kernel/panic.c index 79fd820bb5e8..d02fa9fef46a 100644 --- a/kernel/panic.c +++ b/kernel/panic.c | |||
@@ -100,7 +100,7 @@ void panic(const char *fmt, ...) | |||
100 | va_start(args, fmt); | 100 | va_start(args, fmt); |
101 | vsnprintf(buf, sizeof(buf), fmt, args); | 101 | vsnprintf(buf, sizeof(buf), fmt, args); |
102 | va_end(args); | 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 | #ifdef CONFIG_DEBUG_BUGVERBOSE | 104 | #ifdef CONFIG_DEBUG_BUGVERBOSE |
105 | /* | 105 | /* |
106 | * Avoid nested stack-dumping if a panic occurs during oops processing | 106 | * Avoid nested stack-dumping if a panic occurs during oops processing |
@@ -141,7 +141,7 @@ void panic(const char *fmt, ...) | |||
141 | * Delay timeout seconds before rebooting the machine. | 141 | * Delay timeout seconds before rebooting the machine. |
142 | * We can't use the "normal" timers since we just panicked. | 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 | for (i = 0; i < panic_timeout * 1000; i += PANIC_TIMER_STEP) { | 146 | for (i = 0; i < panic_timeout * 1000; i += PANIC_TIMER_STEP) { |
147 | touch_nmi_watchdog(); | 147 | touch_nmi_watchdog(); |
@@ -165,7 +165,7 @@ void panic(const char *fmt, ...) | |||
165 | extern int stop_a_enabled; | 165 | extern int stop_a_enabled; |
166 | /* Make sure the user can actually press Stop-A (L1-A) */ | 166 | /* Make sure the user can actually press Stop-A (L1-A) */ |
167 | stop_a_enabled = 1; | 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 | #endif | 170 | #endif |
171 | #if defined(CONFIG_S390) | 171 | #if defined(CONFIG_S390) |
@@ -176,6 +176,7 @@ void panic(const char *fmt, ...) | |||
176 | disabled_wait(caller); | 176 | disabled_wait(caller); |
177 | } | 177 | } |
178 | #endif | 178 | #endif |
179 | pr_emerg("---[ end Kernel panic - not syncing: %s\n", buf); | ||
179 | local_irq_enable(); | 180 | local_irq_enable(); |
180 | for (i = 0; ; i += PANIC_TIMER_STEP) { | 181 | for (i = 0; ; i += PANIC_TIMER_STEP) { |
181 | touch_softlockup_watchdog(); | 182 | touch_softlockup_watchdog(); |
@@ -276,8 +277,7 @@ unsigned long get_taint(void) | |||
276 | void add_taint(unsigned flag, enum lockdep_ok lockdep_ok) | 277 | void add_taint(unsigned flag, enum lockdep_ok lockdep_ok) |
277 | { | 278 | { |
278 | if (lockdep_ok == LOCKDEP_NOW_UNRELIABLE && __debug_locks_off()) | 279 | if (lockdep_ok == LOCKDEP_NOW_UNRELIABLE && __debug_locks_off()) |
279 | printk(KERN_WARNING | 280 | pr_warn("Disabling lock debugging due to kernel taint\n"); |
280 | "Disabling lock debugging due to kernel taint\n"); | ||
281 | 281 | ||
282 | set_bit(flag, &tainted_mask); | 282 | set_bit(flag, &tainted_mask); |
283 | } | 283 | } |
@@ -382,8 +382,7 @@ late_initcall(init_oops_id); | |||
382 | void print_oops_end_marker(void) | 382 | void print_oops_end_marker(void) |
383 | { | 383 | { |
384 | init_oops_id(); | 384 | init_oops_id(); |
385 | printk(KERN_WARNING "---[ end trace %016llx ]---\n", | 385 | pr_warn("---[ end trace %016llx ]---\n", (unsigned long long)oops_id); |
386 | (unsigned long long)oops_id); | ||
387 | } | 386 | } |
388 | 387 | ||
389 | /* | 388 | /* |