[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240102074351.1528009-1-alexs@kernel.org>
Date: Tue, 2 Jan 2024 15:43:51 +0800
From: alexs@...nel.org
To: Josh Poimboeuf <jpoimboe@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org,
"H . Peter Anvin" <hpa@...or.com>,
linux-kernel@...r.kernel.org
Cc: Alex Shi <alexs@...nel.org>
Subject: [PATCH] x86/dumpstack: uniform die messages
From: Alex Shi <alexs@...nel.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@...nel.org>
To: linux-kernel@...r.kernel.org
To: "H. Peter Anvin" <hpa@...or.com>
To: x86@...nel.org
To: Dave Hansen <dave.hansen@...ux.intel.com>
To: Borislav Petkov <bp@...en8.de>
To: Ingo Molnar <mingo@...hat.com>
To: Thomas Gleixner <tglx@...utronix.de>
To: Peter Zijlstra <peterz@...radead.org>
To: Josh Poimboeuf <jpoimboe@...nel.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
Powered by blists - more mailing lists