* [PATCH 1/1] kernel: panic: display reason at end + pr_emerg
@ 2014-02-08 7:45 Fabian Frederick
2014-02-11 23:34 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Fabian Frederick @ 2014-02-08 7:45 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm, rdunlap
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.
-Converting all panic.c printk(KERN_EMERG to pr_emerg(
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
kernel/panic.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index 6d63003..b71d520 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -100,7 +100,7 @@ void panic(const char *fmt, ...)
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
- printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf);
+ pr_emerg("Kernel panic - not syncing: %s\n", buf);
#ifdef CONFIG_DEBUG_BUGVERBOSE
/*
* Avoid nested stack-dumping if a panic occurs during oops processing
@@ -141,7 +141,7 @@ void panic(const char *fmt, ...)
* Delay timeout seconds before rebooting the machine.
* We can't use the "normal" timers since we just panicked.
*/
- printk(KERN_EMERG "Rebooting in %d seconds..", panic_timeout);
+ pr_emerg("Rebooting in %d seconds..", panic_timeout);
for (i = 0; i < panic_timeout * 1000; i += PANIC_TIMER_STEP) {
touch_nmi_watchdog();
@@ -165,7 +165,7 @@ void panic(const char *fmt, ...)
extern int stop_a_enabled;
/* Make sure the user can actually press Stop-A (L1-A) */
stop_a_enabled = 1;
- printk(KERN_EMERG "Press Stop-A (L1-A) to return to the boot prom\n");
+ pr_emerg("Press Stop-A (L1-A) to return to the boot prom\n");
}
#endif
#if defined(CONFIG_S390)
@@ -176,6 +176,7 @@ void panic(const char *fmt, ...)
disabled_wait(caller);
}
#endif
+ pr_emerg("---[ end Kernel panic - not syncing: %s\n", buf);
local_irq_enable();
for (i = 0; ; i += PANIC_TIMER_STEP) {
touch_softlockup_watchdog();
--
1.8.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] kernel: panic: display reason at end + pr_emerg
2014-02-08 7:45 [PATCH 1/1] kernel: panic: display reason at end + pr_emerg Fabian Frederick
@ 2014-02-11 23:34 ` Andrew Morton
2014-02-12 8:26 ` Fabian Frederick
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2014-02-11 23:34 UTC (permalink / raw)
To: Fabian Frederick; +Cc: linux-kernel, rdunlap
On Sat, 8 Feb 2014 15:45:22 +0800 Fabian Frederick <fabf@skynet.be> wrote:
> 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.
Fair enough. Hate it when that happens!
> -Converting all panic.c printk(KERN_EMERG to pr_emerg(
You missed a couple.
--- a/kernel/panic.c~kernel-panicc-display-reason-at-end-pr_emerg-fix
+++ a/kernel/panic.c
@@ -275,8 +275,7 @@ unsigned long get_taint(void)
void add_taint(unsigned flag, enum lockdep_ok lockdep_ok)
{
if (lockdep_ok == LOCKDEP_NOW_UNRELIABLE && __debug_locks_off())
- printk(KERN_WARNING
- "Disabling lock debugging due to kernel taint\n");
+ pr_warn("Disabling lock debugging due to kernel taint\n");
set_bit(flag, &tainted_mask);
}
@@ -381,8 +380,7 @@ late_initcall(init_oops_id);
void print_oops_end_marker(void)
{
init_oops_id();
- printk(KERN_WARNING "---[ end trace %016llx ]---\n",
- (unsigned long long)oops_id);
+ pr_warn("---[ end trace %016llx ]---\n", (unsigned long long)oops_id);
}
/*
_
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] kernel: panic: display reason at end + pr_emerg
2014-02-11 23:34 ` Andrew Morton
@ 2014-02-12 8:26 ` Fabian Frederick
0 siblings, 0 replies; 3+ messages in thread
From: Fabian Frederick @ 2014-02-12 8:26 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, rdunlap
On Tue, 11 Feb 2014 15:34:45 -0800
Andrew Morton <akpm@linux-foundation.org> wrote:
> On Sat, 8 Feb 2014 15:45:22 +0800 Fabian Frederick <fabf@skynet.be> wrote:
>
> > 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.
>
> Fair enough. Hate it when that happens!
I was sure I was not the only one :)
>
> > -Converting all panic.c printk(KERN_EMERG to pr_emerg(
>
> You missed a couple.
Thanks a lot for addition and patch fix.
What a pleasure to see such professionalism !
>
> --- a/kernel/panic.c~kernel-panicc-display-reason-at-end-pr_emerg-fix
> +++ a/kernel/panic.c
> @@ -275,8 +275,7 @@ unsigned long get_taint(void)
> void add_taint(unsigned flag, enum lockdep_ok lockdep_ok)
> {
> if (lockdep_ok == LOCKDEP_NOW_UNRELIABLE && __debug_locks_off())
> - printk(KERN_WARNING
> - "Disabling lock debugging due to kernel taint\n");
> + pr_warn("Disabling lock debugging due to kernel taint\n");
>
> set_bit(flag, &tainted_mask);
> }
> @@ -381,8 +380,7 @@ late_initcall(init_oops_id);
> void print_oops_end_marker(void)
> {
> init_oops_id();
> - printk(KERN_WARNING "---[ end trace %016llx ]---\n",
> - (unsigned long long)oops_id);
> + pr_warn("---[ end trace %016llx ]---\n", (unsigned long long)oops_id);
> }
>
> /*
> _
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-12 16:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-08 7:45 [PATCH 1/1] kernel: panic: display reason at end + pr_emerg Fabian Frederick
2014-02-11 23:34 ` Andrew Morton
2014-02-12 8:26 ` Fabian Frederick
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.