x86/dumpstack: uniform die messages
Subsystems (2)
PATCH 1/1 x86/dumpstack: uniform die messages
From: Alex Shi <[email protected]>
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.
To: [email protected]
To: "H. Peter Anvin" <[email protected]>
To: [email protected]
To: Dave Hansen <[email protected]>
To: Borislav Petkov <[email protected]>
To: Ingo Molnar <[email protected]>
To: Thomas Gleixner <[email protected]>
To: Peter Zijlstra <[email protected]>
To: Josh Poimboeuf <[email protected]>
--- arch/x86/kernel/dumpstack.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/x86/kernel/dumpstack.c +4 -2
@@ -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" : "",
Signature · 1 line
2.43.0
Quoted 10 lines · On Tue, Jan 2, 2024 at 3:42 PM <[email protected]> wrote:
From: Alex Shi <[email protected]>
panic()has a uniform preempt, like "Kernel panic - not syncing:". Butdie()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!
Quoted 42 lines
Signed-off-by Alex Shi <[email protected]>To: [email protected]
To: "H. Peter Anvin" <[email protected]>
To: [email protected]
To: Dave Hansen <[email protected]>
To: Borislav Petkov <[email protected]>
To: Ingo Molnar <[email protected]>
To: Thomas Gleixner <[email protected]>
To: Peter Zijlstra <[email protected]>
To: Josh Poimboeuf <[email protected]>--- arch/x86/kernel/dumpstack.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)arch/x86/kernel/dumpstack.c +4
-3@@ -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