linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] x86/dumpstack: uniform die messages prompt
@ 2024-03-27  2:44 alexs
  2024-03-27 12:40 ` [tip: x86/bugs] x86/dumpstack: Use uniform "Oops: " prefix for die() messages tip-bot2 for Alex Shi
  0 siblings, 1 reply; 2+ messages in thread
From: alexs @ 2024-03-27  2:44 UTC (permalink / raw)
  To: Josh Poimboeuf, Peter Zijlstra, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, Dave Hansen,
	maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	H. Peter Anvin, open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)
  Cc: linux-kernel, Alex Shi

From: Alex Shi <alexs@kernel.org>

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 like "Oops:" could save some hair for admins.

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index f18ca44c904b..e1358ef80b59 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -405,8 +405,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,
+	       "Oops: %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 related	[flat|nested] 2+ messages in thread

* [tip: x86/bugs] x86/dumpstack: Use uniform "Oops: " prefix for die() messages
  2024-03-27  2:44 [PATCH v3] x86/dumpstack: uniform die messages prompt alexs
@ 2024-03-27 12:40 ` tip-bot2 for Alex Shi
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Alex Shi @ 2024-03-27 12:40 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Alex Shi, Ingo Molnar, Linus Torvalds, x86, linux-kernel

The following commit has been merged into the x86/bugs branch of tip:

Commit-ID:     f9f62a877da1e6f6e9d58bd779c1c77052eb04ab
Gitweb:        https://git.kernel.org/tip/f9f62a877da1e6f6e9d58bd779c1c77052eb04ab
Author:        Alex Shi <alexs@kernel.org>
AuthorDate:    Wed, 27 Mar 2024 10:44:19 +08:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 27 Mar 2024 08:45:19 +01:00

x86/dumpstack: Use uniform "Oops: " prefix for die() messages

panic() prints a uniform prompt: "Kernel panic - not syncing:",
but die() messages don't have any of that, the message is the
raw user-defined message with no prefix.

There's companies that collect thousands of die() messages per week,
but w/o a prompt in dmesg, it's hard to write scripts to collect and
analize the reasons.

Add a uniform "Oops:" prefix like other architectures.

[ mingo: Rewrote changelog. ]

Signed-off-by: Alex Shi <alexs@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20240327024419.471433-1-alexs@kernel.org
---
 arch/x86/kernel/dumpstack.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index 44a91ef..a7d5626 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -405,8 +405,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,
+	       "Oops: %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"           : "",

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-27  2:44 [PATCH v3] x86/dumpstack: uniform die messages prompt alexs
2024-03-27 12:40 ` [tip: x86/bugs] x86/dumpstack: Use uniform "Oops: " prefix for die() messages tip-bot2 for Alex Shi

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).