From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Petr Mladek <pmladek@suse.com>, Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Subject: [RFC][PATCH] panic: make panic start/end messages consistent
Date: Fri, 26 Apr 2019 15:33:56 +0900 [thread overview]
Message-ID: <20190426063356.20453-1-sergey.senozhatsky@gmail.com> (raw)
We don't have consistency:
- we always print panic header
pr_emerg("Kernel panic - not syncing:")
- but we don't always print panic footer
pr_emerg("---[ end Kernel panic - not syncing:")
For instance, no panic footer (end panic) message will be
printed when panic_timeout is set - the kernel will either
reboot immediately after console_flush_on_panic() (emergency
restart) or after panic_timeout seconds. Additionally,
panic_print_sys_info() goes before panic footer line, which
doesn't look very right, panic_print_sys_info() is just
additional debugging into.
Let's make it consistent:
pr_emerg("Kernel panic - not syncing:")
dump_stack();
console_flush_on_panic();
pr_emerg("---[ end Kernel panic - not syncing:")
panic_print_sys_info();
/* the rest */
/* panic_timeout handling */
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
kernel/panic.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/panic.c b/kernel/panic.c
index 40882dad9f70..6482e4b54f0b 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -282,6 +282,7 @@ void panic(const char *fmt, ...)
*/
debug_locks_off();
console_flush_on_panic(CONSOLE_FLUSH_PENDING);
+ pr_emerg("---[ end Kernel panic - not syncing: %s ]---\n", buf);
panic_print_sys_info();
@@ -331,8 +332,6 @@ void panic(const char *fmt, ...)
disabled_wait(caller);
}
#endif
- pr_emerg("---[ end Kernel panic - not syncing: %s ]---\n", buf);
-
/* Do not scroll important messages printed above */
suppress_printk = 1;
local_irq_enable();
--
2.21.0
next reply other threads:[~2019-04-26 6:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-26 6:33 Sergey Senozhatsky [this message]
2019-04-26 8:41 ` [RFC][PATCH] panic: make panic start/end messages consistent Petr Mladek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190426063356.20453-1-sergey.senozhatsky@gmail.com \
--to=sergey.senozhatsky.work@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sergey.senozhatsky@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).