mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/dumpstack: uniform die messages
@ 2024-01-02  7:43 alexs
  2024-01-03 12:43 ` Alex Shi
  0 siblings, 1 reply; 2+ messages in thread
From: alexs @ 2024-01-02  7:43 UTC (permalink / raw)
  To: Josh Poimboeuf, Peter Zijlstra, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H . Peter Anvin, linux-kernel
  Cc: Alex Shi

From: Alex Shi <alexs@kernel.org>

panic() has a uniform preempt, like "Kernel panic - not syncing:". But
die() doesn't have.

We died thousands machine with very different reasons. With current die
messages in dmesg, it's hard to write scripts to collect and anaylis the
die reasons. So we'd better give die() a uniform preempt to make the
life of system administrators a bit easier.

Signed-off-by: Alex Shi <alexs@kernel.org>
To: linux-kernel@vger.kernel.org
To: "H. Peter Anvin" <hpa@zytor.com>
To: x86@kernel.org
To: Dave Hansen <dave.hansen@linux.intel.com>
To: Borislav Petkov <bp@alien8.de>
To: Ingo Molnar <mingo@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
To: Peter Zijlstra <peterz@infradead.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>
---
 arch/x86/kernel/dumpstack.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index f18ca44c904b..00766e7ac077 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -393,6 +393,8 @@ void oops_end(unsigned long flags, struct pt_regs *regs, int signr)
 }
 NOKPROBE_SYMBOL(oops_end);
 
+#define DIE_PREEMPT	"DIE:\n"
+
 static void __die_header(const char *str, struct pt_regs *regs, long err)
 {
 	const char *pr = "";
@@ -405,8 +407,8 @@ static void __die_header(const char *str, struct pt_regs *regs, long err)
 		pr = IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT";
 
 	printk(KERN_DEFAULT
-	       "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff, ++die_counter,
-	       pr,
+	       DIE_PREEMPT "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff,
+	       ++die_counter, pr,
 	       IS_ENABLED(CONFIG_SMP)     ? " SMP"             : "",
 	       debug_pagealloc_enabled()  ? " DEBUG_PAGEALLOC" : "",
 	       IS_ENABLED(CONFIG_KASAN)   ? " KASAN"           : "",
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/dumpstack: uniform die messages
  2024-01-02  7:43 [PATCH] x86/dumpstack: uniform die messages alexs
@ 2024-01-03 12:43 ` Alex Shi
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Shi @ 2024-01-03 12:43 UTC (permalink / raw)
  To: alexs
  Cc: Josh Poimboeuf, Peter Zijlstra, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen, x86, H . Peter Anvin, linux-kernel

On Tue, Jan 2, 2024 at 3:42 PM <alexs@kernel.org> wrote:
>
> From: Alex Shi <alexs@kernel.org>
>
> panic() has a uniform preempt, like "Kernel panic - not syncing:". But
> die() doesn't have.
>
> We died thousands machine with very different reasons. With current die
> messages in dmesg, it's hard to write scripts to collect and anaylis the
> die reasons. So we'd better give die() a uniform preempt to make the
> life of system administrators a bit easier.

Sorry for the typo, s/preempt/prompt/,
And any comments are appreciated!

>
> Signed-off-by: Alex Shi <alexs@kernel.org>
> To: linux-kernel@vger.kernel.org
> To: "H. Peter Anvin" <hpa@zytor.com>
> To: x86@kernel.org
> To: Dave Hansen <dave.hansen@linux.intel.com>
> To: Borislav Petkov <bp@alien8.de>
> To: Ingo Molnar <mingo@redhat.com>
> To: Thomas Gleixner <tglx@linutronix.de>
> To: Peter Zijlstra <peterz@infradead.org>
> To: Josh Poimboeuf <jpoimboe@kernel.org>
> ---
>  arch/x86/kernel/dumpstack.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
> index f18ca44c904b..00766e7ac077 100644
> --- a/arch/x86/kernel/dumpstack.c
> +++ b/arch/x86/kernel/dumpstack.c
> @@ -393,6 +393,8 @@ void oops_end(unsigned long flags, struct pt_regs *regs, int signr)
>  }
>  NOKPROBE_SYMBOL(oops_end);
>
> +#define DIE_PREEMPT    "DIE:\n"
> +
>  static void __die_header(const char *str, struct pt_regs *regs, long err)
>  {
>         const char *pr = "";
> @@ -405,8 +407,8 @@ static void __die_header(const char *str, struct pt_regs *regs, long err)
>                 pr = IS_ENABLED(CONFIG_PREEMPT_RT) ? " PREEMPT_RT" : " PREEMPT";
>
>         printk(KERN_DEFAULT
> -              "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff, ++die_counter,
> -              pr,
> +              DIE_PREEMPT "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff,
> +              ++die_counter, pr,
>                IS_ENABLED(CONFIG_SMP)     ? " SMP"             : "",
>                debug_pagealloc_enabled()  ? " DEBUG_PAGEALLOC" : "",
>                IS_ENABLED(CONFIG_KASAN)   ? " KASAN"           : "",
> --
> 2.43.0
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-03 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-02  7:43 [PATCH] x86/dumpstack: uniform die messages alexs
2024-01-03 12:43 ` Alex Shi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®