x86/dumpstack: uniform die messages prompt
Subsystems (2)
PATCH v2 1/1 x86/dumpstack: uniform die messages prompt
From: Alex Shi <[email protected]>
panic() has a uniform prompt, like "Kernel panic - not syncing:". That's easy to indicate a panic there. But die() message doesn't have.
We died thousands machine with very different reasons weekly. w/o a prompt in dmesg, it's hard to write scripts to collect and anaylis the die reasons. That makes admins' life pretty hard.
A uniform die() prompt could make the life of system administrators far more 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_PROMPT "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_PROMPT "%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
Borislav Petkov
maintainerarch/x86/kernel/dumpstack.c static void __die_header(const char *str, struct pt_regs *regs, long err) · line 410
Quoted 7 lines · On Fri, Feb 02, 2024 at 03:45:12PM +0800, [email protected] wrote:
arch/x86/kernel/dumpstack.c +1
-2@@ -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_PROMPT "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff,
Why do you need this DIE_PROMPT if you can simply do:
"Oops: %s: %04lx... "
?
And yes, I think I'd prefer having an "oops" in there as it is a lot more prominent. It is called a "kernel oops" everywhere.
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteQuoted 11 lines · Borislav Petkov
arch/x86/kernel/dumpstack.c static void __die_header(const char *str, struct pt_regs *regs, long err) · line 410
Quoted 7 lines · On Fri, Feb 02, 2024 at 03:45:12PM +0800, [email protected] wrote:
arch/x86/kernel/dumpstack.c +1
-2@@ -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_PROMPT "%s: %04lx [#%d]%s%s%s%s%s\n", str, err & 0xffff,Why do you need this
DIE_PROMPTif you can simply do:
Quoted 6 lines
"Oops: %s: %04lx... "?
And yes, I think I'd prefer having an "oops" in there as it is a lot more prominent. It is called a "kernel oops" everywhere.
Uh, 'Oops' is also a good preempt. If no other objection, I'd like to change this. :)
Thank a lot!
Quoted 3 lines
Thx.