linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string
@ 2025-05-15 12:46 Ingo Molnar
  2025-05-15 12:46 ` [PATCH 01/15] bugs/core: Extend __WARN_FLAGS() with the 'cond_str' parameter Ingo Molnar
                   ` (16 more replies)
  0 siblings, 17 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch

Changes in -v2:

 - Incorporated review feedback:

    - Make the expanded strings conditional on the new
      CONFIG_DEBUG_BUGVERBOSE_DETAILED=y switch, to address concerns
      about the +100K kernel size increase, disabled by default.

    - Expanded the Cc: fields

 - Rebased to v6.15-rc6

This tree can also be found at:

	git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git WIP.core/bugs

Thanks,

	Ingo

=========================>
Original -v1 announcement:

This series improves the current WARN_ON_ONCE() output, if
the new CONFIG_DEBUG_BUGVERBOSE_DETAILED=y option is enabled,
from:

  WARN_ON_ONCE(idx < 0 && ptr);
  ...

  WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410

to (on all __WARN_FLAGS() using architectures except S390):

  WARNING: [idx < 0 && ptr] kernel/sched/core.c:8511 at sched_init+0x20/0x410 CPU#0: swapper/0

(Note the addition of the '[condition string]', and a reorganized CPU/comm/PID trailer.)

... and on S390 and non-__WARN_FLAGS architectures to:

  WARNING: kernel/sched/core.c:8511 at sched_init+0x20/0x410 CPU#0: swapper/0

and on non-x86 architectures (the CPU/PID fields in the WARNING line are skipped):

  WARNING: kernel/sched/core.c:8511 sched_init+0x20/0x410
  CPU: 0 UID: 0 PID: 0 Comm: swapper Not tainted 6.14.0-01616-g94d7af2844aa #4 PREEMPT(undef)

The motivation behind this series is the SCHED_WARN_ON() primitive that
got removed in the v6.14 merge window:

  f7d2728cc032 ("sched/debug: Change SCHED_WARN_ON() to WARN_ON_ONCE()")

... which produced more informative debug output, as it included the
WARN_ON_ONCE() condition string - at the expense of worse code generation.

This series, based on Linus's latest Git tree, merges the code generation
benefits of modern WARN_ON_ONCE() bug_entry architecture code with the expanded
information content of SCHED_WARN_ON().

The cost is about +100K more .data on a defconfig kernel, and no runtime
code generation impact:

       text       data        bss         dec        hex    filename
   29523998    7926322    1389904    38840224    250a7a0    vmlinux.x86.defconfig.before
   29523998    8024626    1389904    38938528    25227a0    vmlinue.x86.defconfig.after

On !CONFIG_DEBUG_BUGVERBOSE_DETAILED there's no size difference.

The series was build and boot tested on x86, with an expectation for it to
work on other architectures (with no testing at the moment to back up that
expectation).


    Ingo

================>
Ingo Molnar (15):
  bugs/core: Extend __WARN_FLAGS() with the 'cond_str' parameter
  bugs/core: Pass down the condition string of WARN_ON_ONCE(cond) warnings to __WARN_FLAGS()
  bugs/core: Introduce the CONFIG_DEBUG_BUGVERBOSE_DETAILED Kconfig switch
  bugs/x86: Extend _BUG_FLAGS() with the 'cond_str' parameter
  bugs/x86: Augment warnings output by concatenating 'cond_str' with the regular __FILE__ string in _BUG_FLAGS()
  bugs/powerpc: Pass in 'cond_str' to BUG_ENTRY()
  bugs/powerpc: Concatenate 'cond_str' with '__FILE__' in BUG_ENTRY(), to extend WARN_ON/BUG_ON output
  bugs/LoongArch: Pass in 'cond_str' to __BUG_ENTRY()
  bugs/LoongArch: Concatenate 'cond_str' with '__FILE__' in __BUG_ENTRY(), to extend WARN_ON/BUG_ON output
  bugs/s390: Pass in 'cond_str' to __EMIT_BUG()
  bugs/riscv: Pass in 'cond_str' to __BUG_FLAGS()
  bugs/riscv: Concatenate 'cond_str' with '__FILE__' in __BUG_FLAGS(), to extend WARN_ON/BUG_ON output
  bugs/parisc: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output
  bugs/sh: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output
  bugs/core: Reorganize fields in the first line of WARNING output, add ->comm[] output

 arch/arm64/include/asm/bug.h     |  2 +-
 arch/loongarch/include/asm/bug.h | 25 ++++++++++++-------------
 arch/parisc/include/asm/bug.h    |  6 +++---
 arch/powerpc/include/asm/bug.h   | 12 ++++++------
 arch/riscv/include/asm/bug.h     | 10 +++++-----
 arch/s390/include/asm/bug.h      | 10 +++++-----
 arch/sh/include/asm/bug.h        |  4 ++--
 arch/x86/include/asm/bug.h       | 14 +++++++-------
 include/asm-generic/bug.h        | 13 ++++++++++---
 kernel/panic.c                   | 16 +++++++++-------
 lib/Kconfig.debug                | 10 ++++++++++
 11 files changed, 70 insertions(+), 52 deletions(-)

-- 
2.45.2


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

* [PATCH 01/15] bugs/core: Extend __WARN_FLAGS() with the 'cond_str' parameter
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-15 12:46 ` [PATCH 02/15] bugs/core: Pass down the condition string of WARN_ON_ONCE(cond) warnings to __WARN_FLAGS() Ingo Molnar
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch

Push the new parameter down into every architecture that defines __WARN_FLAGS():

  arm64
  loongarch
  parisc
  powerpc
  riscv
  s390
  sh
  x86

Don't pass anything substantial down yet, just propagate the
new parameter with empty strings, without generating it or
using it.

( The string is never NULL, so it can be concatenated at the
  preprocessor level. )

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: <linux-arch@vger.kernel.org>
---
 arch/arm64/include/asm/bug.h     | 2 +-
 arch/loongarch/include/asm/bug.h | 2 +-
 arch/parisc/include/asm/bug.h    | 4 ++--
 arch/powerpc/include/asm/bug.h   | 2 +-
 arch/riscv/include/asm/bug.h     | 2 +-
 arch/s390/include/asm/bug.h      | 2 +-
 arch/sh/include/asm/bug.h        | 2 +-
 arch/x86/include/asm/bug.h       | 2 +-
 include/asm-generic/bug.h        | 7 ++++---
 9 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/arch/arm64/include/asm/bug.h b/arch/arm64/include/asm/bug.h
index 28be048db3f6..bceeaec21fb9 100644
--- a/arch/arm64/include/asm/bug.h
+++ b/arch/arm64/include/asm/bug.h
@@ -19,7 +19,7 @@
 	unreachable();					\
 } while (0)
 
-#define __WARN_FLAGS(flags) __BUG_FLAGS(BUGFLAG_WARNING|(flags))
+#define __WARN_FLAGS(cond_str, flags) __BUG_FLAGS(BUGFLAG_WARNING|(flags))
 
 #define HAVE_ARCH_BUG
 
diff --git a/arch/loongarch/include/asm/bug.h b/arch/loongarch/include/asm/bug.h
index f6f254f2c5db..51c2cb98d728 100644
--- a/arch/loongarch/include/asm/bug.h
+++ b/arch/loongarch/include/asm/bug.h
@@ -42,7 +42,7 @@
 	asm_inline volatile (__stringify(ASM_BUG_FLAGS(flags))		\
 			     extra);
 
-#define __WARN_FLAGS(flags)					\
+#define __WARN_FLAGS(cond_str, flags)				\
 do {								\
 	instrumentation_begin();				\
 	__BUG_FLAGS(BUGFLAG_WARNING|(flags), ANNOTATE_REACHABLE(10001b));\
diff --git a/arch/parisc/include/asm/bug.h b/arch/parisc/include/asm/bug.h
index 833555f74ffa..1a87cf80ec3c 100644
--- a/arch/parisc/include/asm/bug.h
+++ b/arch/parisc/include/asm/bug.h
@@ -50,7 +50,7 @@
 #endif
 
 #ifdef CONFIG_DEBUG_BUGVERBOSE
-#define __WARN_FLAGS(flags)						\
+#define __WARN_FLAGS(cond_str, flags)					\
 	do {								\
 		asm volatile("\n"					\
 			     "1:\t" PARISC_BUG_BREAK_ASM "\n"		\
@@ -66,7 +66,7 @@
 			     "i" (sizeof(struct bug_entry)) );		\
 	} while(0)
 #else
-#define __WARN_FLAGS(flags)						\
+#define __WARN_FLAGS(cond_str, flags)					\
 	do {								\
 		asm volatile("\n"					\
 			     "1:\t" PARISC_BUG_BREAK_ASM "\n"		\
diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h
index 1db485aacbd9..34d39ec79720 100644
--- a/arch/powerpc/include/asm/bug.h
+++ b/arch/powerpc/include/asm/bug.h
@@ -72,7 +72,7 @@
 } while (0)
 #define HAVE_ARCH_BUG
 
-#define __WARN_FLAGS(flags) BUG_ENTRY("twi 31, 0, 0", BUGFLAG_WARNING | (flags))
+#define __WARN_FLAGS(cond_str, flags) BUG_ENTRY("twi 31, 0, 0", BUGFLAG_WARNING | (flags))
 
 #ifdef CONFIG_PPC64
 #define BUG_ON(x) do {						\
diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h
index 1aaea81fb141..b22ee4d2c882 100644
--- a/arch/riscv/include/asm/bug.h
+++ b/arch/riscv/include/asm/bug.h
@@ -76,7 +76,7 @@ do {								\
 	unreachable();						\
 } while (0)
 
-#define __WARN_FLAGS(flags) __BUG_FLAGS(BUGFLAG_WARNING|(flags))
+#define __WARN_FLAGS(cond_str, flags) __BUG_FLAGS(BUGFLAG_WARNING|(flags))
 
 #define HAVE_ARCH_BUG
 
diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h
index c500d45fb465..ef3e495ec1e3 100644
--- a/arch/s390/include/asm/bug.h
+++ b/arch/s390/include/asm/bug.h
@@ -46,7 +46,7 @@
 	unreachable();					\
 } while (0)
 
-#define __WARN_FLAGS(flags) do {			\
+#define __WARN_FLAGS(cond_str, flags) do {		\
 	__EMIT_BUG(BUGFLAG_WARNING|(flags));		\
 } while (0)
 
diff --git a/arch/sh/include/asm/bug.h b/arch/sh/include/asm/bug.h
index 05a485c4fabc..834c621ab249 100644
--- a/arch/sh/include/asm/bug.h
+++ b/arch/sh/include/asm/bug.h
@@ -52,7 +52,7 @@ do {							\
 	unreachable();					\
 } while (0)
 
-#define __WARN_FLAGS(flags)				\
+#define __WARN_FLAGS(cond_str, flags)			\
 do {							\
 	__asm__ __volatile__ (				\
 		"1:\t.short %O0\n"			\
diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
index f0e9acf72547..413b86b876d9 100644
--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -92,7 +92,7 @@ do {								\
  * were to trigger, we'd rather wreck the machine in an attempt to get the
  * message out than not know about it.
  */
-#define __WARN_FLAGS(flags)					\
+#define __WARN_FLAGS(cond_str, flags)				\
 do {								\
 	__auto_type __flags = BUGFLAG_WARNING|(flags);		\
 	instrumentation_begin();				\
diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 387720933973..af76e4a04b16 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -100,17 +100,18 @@ extern __printf(1, 2) void __warn_printk(const char *fmt, ...);
 		instrumentation_end();					\
 	} while (0)
 #else
-#define __WARN()		__WARN_FLAGS(BUGFLAG_TAINT(TAINT_WARN))
+#define __WARN()		__WARN_FLAGS("", BUGFLAG_TAINT(TAINT_WARN))
 #define __WARN_printf(taint, arg...) do {				\
 		instrumentation_begin();				\
 		__warn_printk(arg);					\
-		__WARN_FLAGS(BUGFLAG_NO_CUT_HERE | BUGFLAG_TAINT(taint));\
+		__WARN_FLAGS("", BUGFLAG_NO_CUT_HERE | BUGFLAG_TAINT(taint));\
 		instrumentation_end();					\
 	} while (0)
 #define WARN_ON_ONCE(condition) ({				\
 	int __ret_warn_on = !!(condition);			\
 	if (unlikely(__ret_warn_on))				\
-		__WARN_FLAGS(BUGFLAG_ONCE |			\
+		__WARN_FLAGS("",				\
+			     BUGFLAG_ONCE |			\
 			     BUGFLAG_TAINT(TAINT_WARN));	\
 	unlikely(__ret_warn_on);				\
 })
-- 
2.45.2


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

* [PATCH 02/15] bugs/core: Pass down the condition string of WARN_ON_ONCE(cond) warnings to __WARN_FLAGS()
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
  2025-05-15 12:46 ` [PATCH 01/15] bugs/core: Extend __WARN_FLAGS() with the 'cond_str' parameter Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-15 12:46 ` [PATCH 03/15] bugs/core: Introduce the CONFIG_DEBUG_BUGVERBOSE_DETAILED Kconfig switch Ingo Molnar
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch

Doing this will allow architecture code to store and print out
this information as part of the WARN_ON and BUG_ON facilities.

The format of the string is '[condition]', for example:

  WARN_ON_ONCE(idx < 0 && ptr);

Will get the '[idx < 0 && ptr]' string literal passed down as 'cond_str'
in __WARN_FLAGS().

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: <linux-arch@vger.kernel.org>
---
 include/asm-generic/bug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index af76e4a04b16..c8e7126bc26e 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -110,7 +110,7 @@ extern __printf(1, 2) void __warn_printk(const char *fmt, ...);
 #define WARN_ON_ONCE(condition) ({				\
 	int __ret_warn_on = !!(condition);			\
 	if (unlikely(__ret_warn_on))				\
-		__WARN_FLAGS("",				\
+		__WARN_FLAGS("["#condition"] ",			\
 			     BUGFLAG_ONCE |			\
 			     BUGFLAG_TAINT(TAINT_WARN));	\
 	unlikely(__ret_warn_on);				\
-- 
2.45.2


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

* [PATCH 03/15] bugs/core: Introduce the CONFIG_DEBUG_BUGVERBOSE_DETAILED Kconfig switch
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
  2025-05-15 12:46 ` [PATCH 01/15] bugs/core: Extend __WARN_FLAGS() with the 'cond_str' parameter Ingo Molnar
  2025-05-15 12:46 ` [PATCH 02/15] bugs/core: Pass down the condition string of WARN_ON_ONCE(cond) warnings to __WARN_FLAGS() Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-15 12:46 ` [PATCH 04/15] bugs/x86: Extend _BUG_FLAGS() with the 'cond_str' parameter Ingo Molnar
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch

Allow configurability of the inclusion of more detailed
WARN_ON() strings, to be implemented in subsequent
commits.

Since the full cost will be around 100K more memory on
an x86 defconfig, disable it by default.

Provide the WARN_CONDITION_STR() macro to allow the conditional
passing of extra strings to lower level BUG/WARN handlers.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: <linux-arch@vger.kernel.org>
---
 include/asm-generic/bug.h |  6 ++++++
 lib/Kconfig.debug         | 10 ++++++++++
 2 files changed, 16 insertions(+)

diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index c8e7126bc26e..bc7a22e2bf49 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -92,6 +92,12 @@ void warn_slowpath_fmt(const char *file, const int line, unsigned taint,
 		       const char *fmt, ...);
 extern __printf(1, 2) void __warn_printk(const char *fmt, ...);
 
+#ifdef CONFIG_DEBUG_BUGVERBOSE_DETAILED
+# define WARN_CONDITION_STR(cond_str) cond_str
+#else
+# define WARN_CONDITION_STR(cond_str) ""
+#endif
+
 #ifndef __WARN_FLAGS
 #define __WARN()		__WARN_printf(TAINT_WARN, NULL)
 #define __WARN_printf(taint, arg...) do {				\
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index f9051ab610d5..59fb70b307e4 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -206,6 +206,16 @@ config DEBUG_BUGVERBOSE
 	  of the BUG call as well as the EIP and oops trace.  This aids
 	  debugging but costs about 70-100K of memory.
 
+config DEBUG_BUGVERBOSE_DETAILED
+	bool "Verbose WARN_ON_ONCE() reporting (adds 100K)" if DEBUG_BUGVERBOSE
+	help
+	  Say Y here to make WARN_ON_ONCE() output the condition string of the
+	  warning, in addition to the file name and line number.
+	  This helps debugging, but costs about 100K of memory.
+
+	  Say N if unsure.
+
+
 endmenu # "printk and dmesg options"
 
 config DEBUG_KERNEL
-- 
2.45.2


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

* [PATCH 04/15] bugs/x86: Extend _BUG_FLAGS() with the 'cond_str' parameter
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (2 preceding siblings ...)
  2025-05-15 12:46 ` [PATCH 03/15] bugs/core: Introduce the CONFIG_DEBUG_BUGVERBOSE_DETAILED Kconfig switch Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-15 12:46 ` [PATCH 05/15] bugs/x86: Augment warnings output by concatenating 'cond_str' with the regular __FILE__ string in _BUG_FLAGS() Ingo Molnar
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch

Just pass down the parameter, don't do anything with it yet.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: <linux-arch@vger.kernel.org>
---
 arch/x86/include/asm/bug.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
index 413b86b876d9..aff1c6b7a7f3 100644
--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -39,7 +39,7 @@
 
 #ifdef CONFIG_DEBUG_BUGVERBOSE
 
-#define _BUG_FLAGS(ins, flags, extra)					\
+#define _BUG_FLAGS(cond_str, ins, flags, extra)				\
 do {									\
 	asm_inline volatile("1:\t" ins "\n"				\
 		     ".pushsection __bug_table,\"aw\"\n"		\
@@ -57,7 +57,7 @@ do {									\
 
 #else /* !CONFIG_DEBUG_BUGVERBOSE */
 
-#define _BUG_FLAGS(ins, flags, extra)					\
+#define _BUG_FLAGS(cond_str, ins, flags, extra)				\
 do {									\
 	asm_inline volatile("1:\t" ins "\n"				\
 		     ".pushsection __bug_table,\"aw\"\n"		\
@@ -74,7 +74,7 @@ do {									\
 
 #else
 
-#define _BUG_FLAGS(ins, flags, extra)  asm volatile(ins)
+#define _BUG_FLAGS(cond_str, ins, flags, extra)  asm volatile(ins)
 
 #endif /* CONFIG_GENERIC_BUG */
 
@@ -82,7 +82,7 @@ do {									\
 #define BUG()							\
 do {								\
 	instrumentation_begin();				\
-	_BUG_FLAGS(ASM_UD2, 0, "");				\
+	_BUG_FLAGS("", ASM_UD2, 0, "");				\
 	__builtin_unreachable();				\
 } while (0)
 
@@ -96,7 +96,7 @@ do {								\
 do {								\
 	__auto_type __flags = BUGFLAG_WARNING|(flags);		\
 	instrumentation_begin();				\
-	_BUG_FLAGS(ASM_UD2, __flags, ANNOTATE_REACHABLE(1b));	\
+	_BUG_FLAGS(cond_str, ASM_UD2, __flags, ANNOTATE_REACHABLE(1b)); \
 	instrumentation_end();					\
 } while (0)
 
-- 
2.45.2


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

* [PATCH 05/15] bugs/x86: Augment warnings output by concatenating 'cond_str' with the regular __FILE__ string in _BUG_FLAGS()
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (3 preceding siblings ...)
  2025-05-15 12:46 ` [PATCH 04/15] bugs/x86: Extend _BUG_FLAGS() with the 'cond_str' parameter Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-15 12:46 ` [PATCH 06/15] bugs/powerpc: Pass in 'cond_str' to BUG_ENTRY() Ingo Molnar
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch

This allows the reuse of the UD2 based 'struct bug_entry' low-overhead
_BUG_FLAGS() implementation and string-printing backend, without
having to add a new field.

An example:

If we have the following WARN_ON_ONCE() in kernel/sched/core.c:

	WARN_ON_ONCE(idx < 0 && ptr);

Then previously _BUG_FLAGS() would store this string in bug_entry::file:

	"kernel/sched/core.c"

After this patch, it would store and print:

	"[idx < 0 && ptr] kernel/sched/core.c"

Which is an extended string that will be printed in warnings.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: <linux-arch@vger.kernel.org>
---
 arch/x86/include/asm/bug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
index aff1c6b7a7f3..8593976b32cb 100644
--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -50,7 +50,7 @@ do {									\
 		     "\t.org 2b+%c3\n"					\
 		     ".popsection\n"					\
 		     extra						\
-		     : : "i" (__FILE__), "i" (__LINE__),		\
+		     : : "i" (WARN_CONDITION_STR(cond_str) __FILE__), "i" (__LINE__),		\
 			 "i" (flags),					\
 			 "i" (sizeof(struct bug_entry)));		\
 } while (0)
-- 
2.45.2


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

* [PATCH 06/15] bugs/powerpc: Pass in 'cond_str' to BUG_ENTRY()
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (4 preceding siblings ...)
  2025-05-15 12:46 ` [PATCH 05/15] bugs/x86: Augment warnings output by concatenating 'cond_str' with the regular __FILE__ string in _BUG_FLAGS() Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-15 12:46 ` [PATCH 07/15] bugs/powerpc: Concatenate 'cond_str' with '__FILE__' in BUG_ENTRY(), to extend WARN_ON/BUG_ON output Ingo Molnar
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, Naveen N Rao, linuxppc-dev

Pass in the condition string from __WARN_FLAGS(), WARN_ON()
and BUG_ON(), but don't use it yet.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Naveen N Rao <naveen@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: <linux-arch@vger.kernel.org>
---
 arch/powerpc/include/asm/bug.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h
index 34d39ec79720..b5537ba176b5 100644
--- a/arch/powerpc/include/asm/bug.h
+++ b/arch/powerpc/include/asm/bug.h
@@ -51,7 +51,7 @@
 	".previous\n"
 #endif
 
-#define BUG_ENTRY(insn, flags, ...)			\
+#define BUG_ENTRY(cond_str, insn, flags, ...)		\
 	__asm__ __volatile__(				\
 		"1:	" insn "\n"			\
 		_EMIT_BUG_ENTRY				\
@@ -67,12 +67,12 @@
  */
 
 #define BUG() do {						\
-	BUG_ENTRY("twi 31, 0, 0", 0);				\
+	BUG_ENTRY("", "twi 31, 0, 0", 0);			\
 	unreachable();						\
 } while (0)
 #define HAVE_ARCH_BUG
 
-#define __WARN_FLAGS(cond_str, flags) BUG_ENTRY("twi 31, 0, 0", BUGFLAG_WARNING | (flags))
+#define __WARN_FLAGS(cond_str, flags) BUG_ENTRY(cond_str, "twi 31, 0, 0", BUGFLAG_WARNING | (flags))
 
 #ifdef CONFIG_PPC64
 #define BUG_ON(x) do {						\
@@ -80,7 +80,7 @@
 		if (x)						\
 			BUG();					\
 	} else {						\
-		BUG_ENTRY(PPC_TLNEI " %4, 0", 0, "r" ((__force long)(x)));	\
+		BUG_ENTRY(#x, PPC_TLNEI " %4, 0", 0, "r" ((__force long)(x)));	\
 	}							\
 } while (0)
 
@@ -90,7 +90,7 @@
 		if (__ret_warn_on)				\
 			__WARN();				\
 	} else {						\
-		BUG_ENTRY(PPC_TLNEI " %4, 0",			\
+		BUG_ENTRY(#x, PPC_TLNEI " %4, 0",			\
 			  BUGFLAG_WARNING | BUGFLAG_TAINT(TAINT_WARN),	\
 			  "r" (__ret_warn_on));	\
 	}							\
-- 
2.45.2


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

* [PATCH 07/15] bugs/powerpc: Concatenate 'cond_str' with '__FILE__' in BUG_ENTRY(), to extend WARN_ON/BUG_ON output
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (5 preceding siblings ...)
  2025-05-15 12:46 ` [PATCH 06/15] bugs/powerpc: Pass in 'cond_str' to BUG_ENTRY() Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-15 12:46 ` [PATCH 08/15] bugs/LoongArch: Pass in 'cond_str' to __BUG_ENTRY() Ingo Molnar
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy, Naveen N Rao, linuxppc-dev

Extend WARN_ON and BUG_ON style output from:

  WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410

to:

  WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched_init+0x20/0x410

Note that the output will be further reorganized later in this series.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Naveen N Rao <naveen@kernel.org>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: <linux-arch@vger.kernel.org>
---
 arch/powerpc/include/asm/bug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/bug.h b/arch/powerpc/include/asm/bug.h
index b5537ba176b5..171b6b2ba100 100644
--- a/arch/powerpc/include/asm/bug.h
+++ b/arch/powerpc/include/asm/bug.h
@@ -55,7 +55,7 @@
 	__asm__ __volatile__(				\
 		"1:	" insn "\n"			\
 		_EMIT_BUG_ENTRY				\
-		: : "i" (__FILE__), "i" (__LINE__),	\
+		: : "i" (WARN_CONDITION_STR(cond_str) __FILE__), "i" (__LINE__),	\
 		  "i" (flags),				\
 		  "i" (sizeof(struct bug_entry)),	\
 		  ##__VA_ARGS__)
-- 
2.45.2


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

* [PATCH 08/15] bugs/LoongArch: Pass in 'cond_str' to __BUG_ENTRY()
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (6 preceding siblings ...)
  2025-05-15 12:46 ` [PATCH 07/15] bugs/powerpc: Concatenate 'cond_str' with '__FILE__' in BUG_ENTRY(), to extend WARN_ON/BUG_ON output Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-15 12:46 ` [PATCH 09/15] bugs/LoongArch: Concatenate 'cond_str' with '__FILE__' in __BUG_ENTRY(), to extend WARN_ON/BUG_ON output Ingo Molnar
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch,
	Huacai Chen, WANG Xuerui, Josh Poimboeuf

Pass in the condition string from __WARN_FLAGS(), but don't use it yet.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: <linux-arch@vger.kernel.org>
---
 arch/loongarch/include/asm/bug.h | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/arch/loongarch/include/asm/bug.h b/arch/loongarch/include/asm/bug.h
index 51c2cb98d728..3c377984457d 100644
--- a/arch/loongarch/include/asm/bug.h
+++ b/arch/loongarch/include/asm/bug.h
@@ -20,39 +20,38 @@
 #endif
 
 #ifndef CONFIG_GENERIC_BUG
-#define __BUG_ENTRY(flags)
+#define __BUG_ENTRY(cond_str, flags)
 #else
-#define __BUG_ENTRY(flags) 					\
+#define __BUG_ENTRY(cond_str, flags)				\
 		.pushsection __bug_table, "aw";			\
 		.align 2;					\
 	10000:	.long 10001f - .;				\
 		_BUGVERBOSE_LOCATION(__FILE__, __LINE__)	\
-		.short flags; 					\
+		.short flags;					\
 		.popsection;					\
 	10001:
 #endif
 
-#define ASM_BUG_FLAGS(flags)					\
-	__BUG_ENTRY(flags)					\
+#define ASM_BUG_FLAGS(cond_str, flags)				\
+	__BUG_ENTRY(cond_str, flags)				\
 	break		BRK_BUG;
 
-#define ASM_BUG()	ASM_BUG_FLAGS(0)
+#define ASM_BUG()	ASM_BUG_FLAGS("", 0)
 
-#define __BUG_FLAGS(flags, extra)					\
-	asm_inline volatile (__stringify(ASM_BUG_FLAGS(flags))		\
-			     extra);
+#define __BUG_FLAGS(cond_str, flags, extra)			\
+	asm_inline volatile (__stringify(ASM_BUG_FLAGS(cond_str, flags)) extra);
 
 #define __WARN_FLAGS(cond_str, flags)				\
 do {								\
 	instrumentation_begin();				\
-	__BUG_FLAGS(BUGFLAG_WARNING|(flags), ANNOTATE_REACHABLE(10001b));\
+	__BUG_FLAGS(cond_str, BUGFLAG_WARNING|(flags), ANNOTATE_REACHABLE(10001b));\
 	instrumentation_end();					\
 } while (0)
 
 #define BUG()							\
 do {								\
 	instrumentation_begin();				\
-	__BUG_FLAGS(0, "");					\
+	__BUG_FLAGS("", 0, "");					\
 	unreachable();						\
 } while (0)
 
-- 
2.45.2


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

* [PATCH 09/15] bugs/LoongArch: Concatenate 'cond_str' with '__FILE__' in __BUG_ENTRY(), to extend WARN_ON/BUG_ON output
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (7 preceding siblings ...)
  2025-05-15 12:46 ` [PATCH 08/15] bugs/LoongArch: Pass in 'cond_str' to __BUG_ENTRY() Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-15 12:46 ` [PATCH 10/15] bugs/s390: Pass in 'cond_str' to __EMIT_BUG() Ingo Molnar
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch,
	Huacai Chen, WANG Xuerui, Josh Poimboeuf

Extend WARN_ON and BUG_ON style output from:

  WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410

to:

  WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched_init+0x20/0x410

Note that the output will be further reorganized later in this series.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: <linux-arch@vger.kernel.org>
---
 arch/loongarch/include/asm/bug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/loongarch/include/asm/bug.h b/arch/loongarch/include/asm/bug.h
index 3c377984457d..cad807b100ad 100644
--- a/arch/loongarch/include/asm/bug.h
+++ b/arch/loongarch/include/asm/bug.h
@@ -26,7 +26,7 @@
 		.pushsection __bug_table, "aw";			\
 		.align 2;					\
 	10000:	.long 10001f - .;				\
-		_BUGVERBOSE_LOCATION(__FILE__, __LINE__)	\
+		_BUGVERBOSE_LOCATION(WARN_CONDITION_STR(cond_str) __FILE__, __LINE__) \
 		.short flags;					\
 		.popsection;					\
 	10001:
-- 
2.45.2


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

* [PATCH 10/15] bugs/s390: Pass in 'cond_str' to __EMIT_BUG()
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (8 preceding siblings ...)
  2025-05-15 12:46 ` [PATCH 09/15] bugs/LoongArch: Concatenate 'cond_str' with '__FILE__' in __BUG_ENTRY(), to extend WARN_ON/BUG_ON output Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-20 13:39   ` Heiko Carstens
  2025-05-15 12:46 ` [PATCH 11/15] bugs/riscv: Pass in 'cond_str' to __BUG_FLAGS() Ingo Molnar
                   ` (6 subsequent siblings)
  16 siblings, 1 reply; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch,
	Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
	Christian Borntraeger, Sven Schnelle, linux-s390

Pass in the condition string from __WARN_FLAGS(), but do not
concatenate it with __FILE__, because the __bug_table is
apparently indexed by 16 bits and increasing string size
overflows it on defconfig builds.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: linux-s390@vger.kernel.org
Cc: <linux-arch@vger.kernel.org>
---
 arch/s390/include/asm/bug.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h
index ef3e495ec1e3..30f8785a01f5 100644
--- a/arch/s390/include/asm/bug.h
+++ b/arch/s390/include/asm/bug.h
@@ -8,7 +8,7 @@
 
 #ifdef CONFIG_DEBUG_BUGVERBOSE
 
-#define __EMIT_BUG(x) do {					\
+#define __EMIT_BUG(cond_str, x) do {				\
 	asm_inline volatile(					\
 		"0:	mc	0,0\n"				\
 		".section .rodata.str,\"aMS\",@progbits,1\n"	\
@@ -27,7 +27,7 @@
 
 #else /* CONFIG_DEBUG_BUGVERBOSE */
 
-#define __EMIT_BUG(x) do {					\
+#define __EMIT_BUG(cond_str, x) do {				\
 	asm_inline volatile(					\
 		"0:	mc	0,0\n"				\
 		".section __bug_table,\"aw\"\n"			\
@@ -42,12 +42,12 @@
 #endif /* CONFIG_DEBUG_BUGVERBOSE */
 
 #define BUG() do {					\
-	__EMIT_BUG(0);					\
+	__EMIT_BUG("", 0);				\
 	unreachable();					\
 } while (0)
 
 #define __WARN_FLAGS(cond_str, flags) do {		\
-	__EMIT_BUG(BUGFLAG_WARNING|(flags));		\
+	__EMIT_BUG(cond_str, BUGFLAG_WARNING|(flags));	\
 } while (0)
 
 #define WARN_ON(x) ({					\
-- 
2.45.2


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

* [PATCH 11/15] bugs/riscv: Pass in 'cond_str' to __BUG_FLAGS()
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (9 preceding siblings ...)
  2025-05-15 12:46 ` [PATCH 10/15] bugs/s390: Pass in 'cond_str' to __EMIT_BUG() Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-15 12:46 ` [PATCH 12/15] bugs/riscv: Concatenate 'cond_str' with '__FILE__' in __BUG_FLAGS(), to extend WARN_ON/BUG_ON output Ingo Molnar
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	linux-riscv

Pass in the condition string from __WARN_FLAGS() to __BUG_FLAGS(),
but don't use it yet.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: linux-riscv@lists.infradead.org
Cc: <linux-arch@vger.kernel.org>
---
 arch/riscv/include/asm/bug.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h
index b22ee4d2c882..feaf456d465b 100644
--- a/arch/riscv/include/asm/bug.h
+++ b/arch/riscv/include/asm/bug.h
@@ -50,7 +50,7 @@ typedef u32 bug_insn_t;
 #endif
 
 #ifdef CONFIG_GENERIC_BUG
-#define __BUG_FLAGS(flags)					\
+#define __BUG_FLAGS(cond_str, flags)				\
 do {								\
 	__asm__ __volatile__ (					\
 		"1:\n\t"					\
@@ -66,17 +66,17 @@ do {								\
 		  "i" (sizeof(struct bug_entry)));              \
 } while (0)
 #else /* CONFIG_GENERIC_BUG */
-#define __BUG_FLAGS(flags) do {					\
+#define __BUG_FLAGS(cond_str, flags) do {			\
 	__asm__ __volatile__ ("ebreak\n");			\
 } while (0)
 #endif /* CONFIG_GENERIC_BUG */
 
 #define BUG() do {						\
-	__BUG_FLAGS(0);						\
+	__BUG_FLAGS("", 0);					\
 	unreachable();						\
 } while (0)
 
-#define __WARN_FLAGS(cond_str, flags) __BUG_FLAGS(BUGFLAG_WARNING|(flags))
+#define __WARN_FLAGS(cond_str, flags) __BUG_FLAGS(cond_str, BUGFLAG_WARNING|(flags))
 
 #define HAVE_ARCH_BUG
 
-- 
2.45.2


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

* [PATCH 12/15] bugs/riscv: Concatenate 'cond_str' with '__FILE__' in __BUG_FLAGS(), to extend WARN_ON/BUG_ON output
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (10 preceding siblings ...)
  2025-05-15 12:46 ` [PATCH 11/15] bugs/riscv: Pass in 'cond_str' to __BUG_FLAGS() Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-16 15:09   ` Alexandre Ghiti
  2025-05-15 12:46 ` [PATCH 13/15] bugs/parisc: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), " Ingo Molnar
                   ` (4 subsequent siblings)
  16 siblings, 1 reply; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
	linux-riscv

Extend WARN_ON and BUG_ON style output from:

  WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410

to:

  WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched_init+0x20/0x410

Note that the output will be further reorganized later in this series.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: linux-riscv@lists.infradead.org
Cc: <linux-arch@vger.kernel.org>
---
 arch/riscv/include/asm/bug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h
index feaf456d465b..da9b8e83934d 100644
--- a/arch/riscv/include/asm/bug.h
+++ b/arch/riscv/include/asm/bug.h
@@ -61,7 +61,7 @@ do {								\
 			".org 2b + %3\n\t"                      \
 			".popsection"				\
 		:						\
-		: "i" (__FILE__), "i" (__LINE__),		\
+		: "i" (WARN_CONDITION_STR(cond_str) __FILE__), "i" (__LINE__),	\
 		  "i" (flags),					\
 		  "i" (sizeof(struct bug_entry)));              \
 } while (0)
-- 
2.45.2


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

* [PATCH 13/15] bugs/parisc: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (11 preceding siblings ...)
  2025-05-15 12:46 ` [PATCH 12/15] bugs/riscv: Concatenate 'cond_str' with '__FILE__' in __BUG_FLAGS(), to extend WARN_ON/BUG_ON output Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-15 15:28   ` Helge Deller
  2025-05-15 12:46 ` [PATCH 14/15] bugs/sh: " Ingo Molnar
                   ` (3 subsequent siblings)
  16 siblings, 1 reply; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch,
	James E.J. Bottomley, Helge Deller, linux-parisc

Extend WARN_ON and BUG_ON style output from:

  WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410

to:

  WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched_init+0x20/0x410

Note that the output will be further reorganized later in this series.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-parisc@vger.kernel.org
Cc: <linux-arch@vger.kernel.org>
---
 arch/parisc/include/asm/bug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/parisc/include/asm/bug.h b/arch/parisc/include/asm/bug.h
index 1a87cf80ec3c..5aa1623e4f2f 100644
--- a/arch/parisc/include/asm/bug.h
+++ b/arch/parisc/include/asm/bug.h
@@ -61,7 +61,7 @@
 			     "\t.short %1, %2\n"			\
 			     "\t.blockz %3-2*4-2*2\n"			\
 			     "\t.popsection"				\
-			     : : "i" (__FILE__), "i" (__LINE__),	\
+			     : : "i" (WARN_CONDITION_STR(cond_str) __FILE__), "i" (__LINE__), \
 			     "i" (BUGFLAG_WARNING|(flags)),		\
 			     "i" (sizeof(struct bug_entry)) );		\
 	} while(0)
-- 
2.45.2


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

* [PATCH 14/15] bugs/sh: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (12 preceding siblings ...)
  2025-05-15 12:46 ` [PATCH 13/15] bugs/parisc: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), " Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-15 12:56   ` John Paul Adrian Glaubitz
  2025-05-15 12:46 ` [PATCH 15/15] bugs/core: Reorganize fields in the first line of WARNING output, add ->comm[] output Ingo Molnar
                   ` (2 subsequent siblings)
  16 siblings, 1 reply; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch,
	Yoshinori Sato, Rich Felker, John Paul Adrian Glaubitz, linux-sh

Extend WARN_ON and BUG_ON style output from:

  WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410

to:

  WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched_init+0x20/0x410

Note that the output will be further reorganized later in this series.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: linux-sh@vger.kernel.org
Cc: <linux-arch@vger.kernel.org>
---
 arch/sh/include/asm/bug.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sh/include/asm/bug.h b/arch/sh/include/asm/bug.h
index 834c621ab249..891276687355 100644
--- a/arch/sh/include/asm/bug.h
+++ b/arch/sh/include/asm/bug.h
@@ -59,7 +59,7 @@ do {							\
 		 _EMIT_BUG_ENTRY			\
 		 :					\
 		 : "n" (TRAPA_BUG_OPCODE),		\
-		   "i" (__FILE__),			\
+		   "i" (WARN_CONDITION_STR(cond_str) __FILE__),	\
 		   "i" (__LINE__),			\
 		   "i" (BUGFLAG_WARNING|(flags)),	\
 		   "i" (sizeof(struct bug_entry)));	\
-- 
2.45.2


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

* [PATCH 15/15] bugs/core: Reorganize fields in the first line of WARNING output, add ->comm[] output
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (13 preceding siblings ...)
  2025-05-15 12:46 ` [PATCH 14/15] bugs/sh: " Ingo Molnar
@ 2025-05-15 12:46 ` Ingo Molnar
  2025-05-22 20:39 ` [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string David Laight
  2025-06-09 11:13 ` Peter Zijlstra
  16 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 12:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Linus Torvalds, Peter Zijlstra, linux-arch

With the introduction of the condition string as part of the 'file'
string output of kernel warnings, the first line has become a bit
harder to read:

   WARNING: CPU: 0 PID: 0 at [ptr == 0 && 1] kernel/sched/core.c:8511 sched_init+0x20/0x410

Re-order the fields by importance (higher to lower), make the 'at' meaningful
again, and add '->comm[]' output which is often more valuable than a PID.

Also, remove the 'PID' prefix - in combination with comm it's clear what it is.

These changes make the output only slightly longer:

   WARNING: [ptr == 0 && 1] kernel/sched/core.c:8511 at sched_init+0x20/0x410 CPU#0: swapper/0

While adding more information and making it better organized.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: <linux-arch@vger.kernel.org>
---
 kernel/panic.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index a3889f38153d..f03fffca7bcb 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -725,13 +725,15 @@ void __warn(const char *file, int line, void *caller, unsigned taint,
 
 	disable_trace_on_warning();
 
-	if (file)
-		pr_warn("WARNING: CPU: %d PID: %d at %s:%d %pS\n",
-			raw_smp_processor_id(), current->pid, file, line,
-			caller);
-	else
-		pr_warn("WARNING: CPU: %d PID: %d at %pS\n",
-			raw_smp_processor_id(), current->pid, caller);
+	if (file) {
+		pr_warn("WARNING: %s:%d at %pS, CPU#%d: %s/%d\n",
+			file, line, caller,
+			raw_smp_processor_id(), current->comm, current->pid);
+	} else {
+		pr_warn("WARNING: at %pS, CPU#%d: %s/%d\n",
+			caller,
+			raw_smp_processor_id(), current->comm, current->pid);
+	}
 
 #pragma GCC diagnostic push
 #ifndef __clang__
-- 
2.45.2


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

* Re: [PATCH 14/15] bugs/sh: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output
  2025-05-15 12:46 ` [PATCH 14/15] bugs/sh: " Ingo Molnar
@ 2025-05-15 12:56   ` John Paul Adrian Glaubitz
  2025-05-15 13:33     ` Ingo Molnar
  0 siblings, 1 reply; 30+ messages in thread
From: John Paul Adrian Glaubitz @ 2025-05-15 12:56 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel
  Cc: Linus Torvalds, Peter Zijlstra, linux-arch, Yoshinori Sato,
	Rich Felker, linux-sh

Hi Ingo,

On Thu, 2025-05-15 at 14:46 +0200, Ingo Molnar wrote:
> Extend WARN_ON and BUG_ON style output from:
> 
>   WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410
> 
> to:
> 
>   WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched_init+0x20/0x410
> 
> Note that the output will be further reorganized later in this series.
> 
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> Cc: Rich Felker <dalias@libc.org>
> Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> Cc: linux-sh@vger.kernel.org
> Cc: <linux-arch@vger.kernel.org>
> ---
>  arch/sh/include/asm/bug.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/sh/include/asm/bug.h b/arch/sh/include/asm/bug.h
> index 834c621ab249..891276687355 100644
> --- a/arch/sh/include/asm/bug.h
> +++ b/arch/sh/include/asm/bug.h
> @@ -59,7 +59,7 @@ do {							\
>  		 _EMIT_BUG_ENTRY			\
>  		 :					\
>  		 : "n" (TRAPA_BUG_OPCODE),		\
> -		   "i" (__FILE__),			\
> +		   "i" (WARN_CONDITION_STR(cond_str) __FILE__),	\
>  		   "i" (__LINE__),			\
>  		   "i" (BUGFLAG_WARNING|(flags)),	\
>  		   "i" (sizeof(struct bug_entry)));	\

Looks good to me, however I'm not happy with the summary line.

It's too long and the prefix "bugs/sh:" is very confusing. I usually just
use "sh:" to mark anything that affects arch/sh.

Can I pick this patch for my sh-linux tree?

Thanks,
Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

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

* Re: [PATCH 14/15] bugs/sh: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output
  2025-05-15 12:56   ` John Paul Adrian Glaubitz
@ 2025-05-15 13:33     ` Ingo Molnar
  2025-05-15 13:35       ` John Paul Adrian Glaubitz
  0 siblings, 1 reply; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 13:33 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz
  Cc: linux-kernel, Linus Torvalds, Peter Zijlstra, linux-arch,
	Yoshinori Sato, Rich Felker, linux-sh


* John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote:

> Hi Ingo,
> 
> On Thu, 2025-05-15 at 14:46 +0200, Ingo Molnar wrote:
> > Extend WARN_ON and BUG_ON style output from:
> > 
> >   WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410
> > 
> > to:
> > 
> >   WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched_init+0x20/0x410
> > 
> > Note that the output will be further reorganized later in this series.
> > 
> > Signed-off-by: Ingo Molnar <mingo@kernel.org>
> > Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
> > Cc: Rich Felker <dalias@libc.org>
> > Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
> > Cc: linux-sh@vger.kernel.org
> > Cc: <linux-arch@vger.kernel.org>
> > ---
> >  arch/sh/include/asm/bug.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/sh/include/asm/bug.h b/arch/sh/include/asm/bug.h
> > index 834c621ab249..891276687355 100644
> > --- a/arch/sh/include/asm/bug.h
> > +++ b/arch/sh/include/asm/bug.h
> > @@ -59,7 +59,7 @@ do {							\
> >  		 _EMIT_BUG_ENTRY			\
> >  		 :					\
> >  		 : "n" (TRAPA_BUG_OPCODE),		\
> > -		   "i" (__FILE__),			\
> > +		   "i" (WARN_CONDITION_STR(cond_str) __FILE__),	\
> >  		   "i" (__LINE__),			\
> >  		   "i" (BUGFLAG_WARNING|(flags)),	\
> >  		   "i" (sizeof(struct bug_entry)));	\
> 
> Looks good to me, however I'm not happy with the summary line.
> 
> It's too long and the prefix "bugs/sh:" is very confusing. I usually just
> use "sh:" to mark anything that affects arch/sh.

Fair enough, I've changed the title to and pushed out the new tree:

  sh: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output

> Can I pick this patch for my sh-linux tree?

So since it depends on the previous patches, in isolation this would 
break the build.

Can I add your Reviewed-by or Acked-by?

Thanks,

	Ingo

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

* Re: [PATCH 14/15] bugs/sh: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output
  2025-05-15 13:33     ` Ingo Molnar
@ 2025-05-15 13:35       ` John Paul Adrian Glaubitz
  2025-05-15 13:43         ` Ingo Molnar
  0 siblings, 1 reply; 30+ messages in thread
From: John Paul Adrian Glaubitz @ 2025-05-15 13:35 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linus Torvalds, Peter Zijlstra, linux-arch,
	Yoshinori Sato, Rich Felker, linux-sh

On Thu, 2025-05-15 at 15:33 +0200, Ingo Molnar wrote:
> > It's too long and the prefix "bugs/sh:" is very confusing. I usually just
> > use "sh:" to mark anything that affects arch/sh.
> 
> Fair enough, I've changed the title to and pushed out the new tree:
> 
>   sh: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output

Thanks! Minor nitpick: I think that comma is wrong and should be removed
(I'm not a native speaker though ;-)).

> > Can I pick this patch for my sh-linux tree?
> 
> So since it depends on the previous patches, in isolation this would 
> break the build.
> 
> Can I add your Reviewed-by or Acked-by?

Yes, sure.

Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

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

* Re: [PATCH 14/15] bugs/sh: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output
  2025-05-15 13:35       ` John Paul Adrian Glaubitz
@ 2025-05-15 13:43         ` Ingo Molnar
  0 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 13:43 UTC (permalink / raw)
  To: John Paul Adrian Glaubitz
  Cc: linux-kernel, Linus Torvalds, Peter Zijlstra, linux-arch,
	Yoshinori Sato, Rich Felker, linux-sh


* John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote:

> On Thu, 2025-05-15 at 15:33 +0200, Ingo Molnar wrote:
> > > It's too long and the prefix "bugs/sh:" is very confusing. I usually just
> > > use "sh:" to mark anything that affects arch/sh.
> > 
> > Fair enough, I've changed the title to and pushed out the new tree:
> > 
> >   sh: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output
> 
> Thanks! Minor nitpick: I think that comma is wrong and should be removed
> (I'm not a native speaker though ;-)).

Yeah, so both with and without a comma this sentence is proper English 
grammar, but a comma before the 'to' adverb slightly emphasizes the 
second part of the sentence, which was my intent with this phrasing.

> > > Can I pick this patch for my sh-linux tree?
> > 
> > So since it depends on the previous patches, in isolation this would 
> > break the build.
> > 
> > Can I add your Reviewed-by or Acked-by?
> 
> Yes, sure.
> 
> Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>

Thanks!

	Ingo

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

* Re: [PATCH 13/15] bugs/parisc: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output
  2025-05-15 12:46 ` [PATCH 13/15] bugs/parisc: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), " Ingo Molnar
@ 2025-05-15 15:28   ` Helge Deller
  2025-05-15 15:31     ` Ingo Molnar
  0 siblings, 1 reply; 30+ messages in thread
From: Helge Deller @ 2025-05-15 15:28 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel
  Cc: Linus Torvalds, Peter Zijlstra, linux-arch, James E.J. Bottomley,
	linux-parisc

On 5/15/25 14:46, Ingo Molnar wrote:
> Extend WARN_ON and BUG_ON style output from:
> 
>    WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410
> 
> to:
> 
>    WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched_init+0x20/0x410
> 
> Note that the output will be further reorganized later in this series.
> 
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> Cc: Helge Deller <deller@gmx.de>
> Cc: linux-parisc@vger.kernel.org
> Cc: <linux-arch@vger.kernel.org>
> ---
>   arch/parisc/include/asm/bug.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Helge Deller <deller@gmx.de>

Thanks!
Helge

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

* Re: [PATCH 13/15] bugs/parisc: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output
  2025-05-15 15:28   ` Helge Deller
@ 2025-05-15 15:31     ` Ingo Molnar
  0 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-15 15:31 UTC (permalink / raw)
  To: Helge Deller
  Cc: linux-kernel, Linus Torvalds, Peter Zijlstra, linux-arch,
	James E.J. Bottomley, linux-parisc


* Helge Deller <deller@gmx.de> wrote:

> On 5/15/25 14:46, Ingo Molnar wrote:
> > Extend WARN_ON and BUG_ON style output from:
> > 
> >    WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410
> > 
> > to:
> > 
> >    WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched_init+0x20/0x410
> > 
> > Note that the output will be further reorganized later in this series.
> > 
> > Signed-off-by: Ingo Molnar <mingo@kernel.org>
> > Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> > Cc: Helge Deller <deller@gmx.de>
> > Cc: linux-parisc@vger.kernel.org
> > Cc: <linux-arch@vger.kernel.org>
> > ---
> >   arch/parisc/include/asm/bug.h | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Acked-by: Helge Deller <deller@gmx.de>

Thanks!

	Ingo

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

* Re: [PATCH 12/15] bugs/riscv: Concatenate 'cond_str' with '__FILE__' in __BUG_FLAGS(), to extend WARN_ON/BUG_ON output
  2025-05-15 12:46 ` [PATCH 12/15] bugs/riscv: Concatenate 'cond_str' with '__FILE__' in __BUG_FLAGS(), to extend WARN_ON/BUG_ON output Ingo Molnar
@ 2025-05-16 15:09   ` Alexandre Ghiti
  2025-05-16 15:45     ` Ingo Molnar
  0 siblings, 1 reply; 30+ messages in thread
From: Alexandre Ghiti @ 2025-05-16 15:09 UTC (permalink / raw)
  To: Ingo Molnar, linux-kernel
  Cc: Linus Torvalds, Peter Zijlstra, linux-arch, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, linux-riscv

Hi Ingo,

On 15/05/2025 14:46, Ingo Molnar wrote:
> Extend WARN_ON and BUG_ON style output from:
>
>    WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410
>
> to:
>
>    WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched_init+0x20/0x410
>
> Note that the output will be further reorganized later in this series.
>
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Cc: Paul Walmsley <paul.walmsley@sifive.com>
> Cc: Palmer Dabbelt <palmer@dabbelt.com>
> Cc: Albert Ou <aou@eecs.berkeley.edu>
> Cc: Alexandre Ghiti <alex@ghiti.fr>
> Cc: linux-riscv@lists.infradead.org
> Cc: <linux-arch@vger.kernel.org>
> ---
>   arch/riscv/include/asm/bug.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h
> index feaf456d465b..da9b8e83934d 100644
> --- a/arch/riscv/include/asm/bug.h
> +++ b/arch/riscv/include/asm/bug.h
> @@ -61,7 +61,7 @@ do {								\
>   			".org 2b + %3\n\t"                      \
>   			".popsection"				\
>   		:						\
> -		: "i" (__FILE__), "i" (__LINE__),		\
> +		: "i" (WARN_CONDITION_STR(cond_str) __FILE__), "i" (__LINE__),	\
>   		  "i" (flags),					\
>   		  "i" (sizeof(struct bug_entry)));              \
>   } while (0)

I have added a dummy WARN_ON_ONCE(pgtable_l5_enabled == true) and I get 
the following output:

WARNING: [pgtable_l5_enabled == true] arch/riscv/kernel/setup.c:364 at 
setup_arch+0x6c4/0x704, CPU#0: swapper/0

So you can add for riscv:

Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com> # riscv

Thanks,

Alex




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

* Re: [PATCH 12/15] bugs/riscv: Concatenate 'cond_str' with '__FILE__' in __BUG_FLAGS(), to extend WARN_ON/BUG_ON output
  2025-05-16 15:09   ` Alexandre Ghiti
@ 2025-05-16 15:45     ` Ingo Molnar
  0 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-05-16 15:45 UTC (permalink / raw)
  To: Alexandre Ghiti
  Cc: linux-kernel, Linus Torvalds, Peter Zijlstra, linux-arch,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv


* Alexandre Ghiti <alex@ghiti.fr> wrote:

> Hi Ingo,
> 
> On 15/05/2025 14:46, Ingo Molnar wrote:
> > Extend WARN_ON and BUG_ON style output from:
> > 
> >    WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410
> > 
> > to:
> > 
> >    WARNING: CPU: 0 PID: 0 at [idx < 0 && ptr] kernel/sched/core.c:8511 sched_init+0x20/0x410
> > 
> > Note that the output will be further reorganized later in this series.
> > 
> > Signed-off-by: Ingo Molnar <mingo@kernel.org>
> > Cc: Paul Walmsley <paul.walmsley@sifive.com>
> > Cc: Palmer Dabbelt <palmer@dabbelt.com>
> > Cc: Albert Ou <aou@eecs.berkeley.edu>
> > Cc: Alexandre Ghiti <alex@ghiti.fr>
> > Cc: linux-riscv@lists.infradead.org
> > Cc: <linux-arch@vger.kernel.org>
> > ---
> >   arch/riscv/include/asm/bug.h | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/riscv/include/asm/bug.h b/arch/riscv/include/asm/bug.h
> > index feaf456d465b..da9b8e83934d 100644
> > --- a/arch/riscv/include/asm/bug.h
> > +++ b/arch/riscv/include/asm/bug.h
> > @@ -61,7 +61,7 @@ do {								\
> >   			".org 2b + %3\n\t"                      \
> >   			".popsection"				\
> >   		:						\
> > -		: "i" (__FILE__), "i" (__LINE__),		\
> > +		: "i" (WARN_CONDITION_STR(cond_str) __FILE__), "i" (__LINE__),	\
> >   		  "i" (flags),					\
> >   		  "i" (sizeof(struct bug_entry)));              \
> >   } while (0)
> 
> I have added a dummy WARN_ON_ONCE(pgtable_l5_enabled == true) and I get the
> following output:
> 
> WARNING: [pgtable_l5_enabled == true] arch/riscv/kernel/setup.c:364 at
> setup_arch+0x6c4/0x704, CPU#0: swapper/0
> 
> So you can add for riscv:
> 
> Tested-by: Alexandre Ghiti <alexghiti@rivosinc.com> # riscv

Thanks, I've updated the tags section of the riscv patches.

BTW., if you tried the WIP.core/bugs tree it has a final (and silly) 
WARN_ON_ONCE()-testing commit as well:

   af0503e693cf ("bugs/core: Test WARN_ON_ONCE()")

   +       WARN_ON_ONCE(ptr == 0 && 1);

:-)

Thanks,

	Ingo

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

* Re: [PATCH 10/15] bugs/s390: Pass in 'cond_str' to __EMIT_BUG()
  2025-05-15 12:46 ` [PATCH 10/15] bugs/s390: Pass in 'cond_str' to __EMIT_BUG() Ingo Molnar
@ 2025-05-20 13:39   ` Heiko Carstens
  2025-06-09  8:27     ` [PATCH 16/15] bugs/s390: Use " Ingo Molnar
  0 siblings, 1 reply; 30+ messages in thread
From: Heiko Carstens @ 2025-05-20 13:39 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linus Torvalds, Peter Zijlstra, linux-arch,
	Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
	Sven Schnelle, linux-s390

On Thu, May 15, 2025 at 02:46:39PM +0200, Ingo Molnar wrote:
> Pass in the condition string from __WARN_FLAGS(), but do not
> concatenate it with __FILE__, because the __bug_table is
> apparently indexed by 16 bits and increasing string size
> overflows it on defconfig builds.

Could you provide your change which didn't work?

I cannot see how anything would overflow. Trying the below on top of
your series seems to work like expected.

In order to keep things easy this drops the mergeable section trick
and results in a small increase of the rodata section, but I doubt
that would explain what you have seen.

Also allyesconfig builds without errors.

diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h
index 30f8785a01f5..837bfbde0c51 100644
--- a/arch/s390/include/asm/bug.h
+++ b/arch/s390/include/asm/bug.h
@@ -11,16 +11,14 @@
 #define __EMIT_BUG(cond_str, x) do {				\
 	asm_inline volatile(					\
 		"0:	mc	0,0\n"				\
-		".section .rodata.str,\"aMS\",@progbits,1\n"	\
-		"1:	.asciz	\""__FILE__"\"\n"		\
-		".previous\n"					\
 		".section __bug_table,\"aw\"\n"			\
-		"2:	.long	0b-.\n"				\
-		"	.long	1b-.\n"				\
-		"	.short	%0,%1\n"			\
-		"	.org	2b+%2\n"			\
+		"1:	.long	0b-.\n"				\
+		"	.long	%0-.\n"				\
+		"	.short	%1,%2\n"			\
+		"	.org	1b+%3\n"			\
 		".previous\n"					\
-		: : "i" (__LINE__),				\
+		: : "i" (WARN_CONDITION_STR(cond_str) __FILE__),\
+		    "i" (__LINE__),				\
 		    "i" (x),					\
 		    "i" (sizeof(struct bug_entry)));		\
 } while (0)

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

* Re: [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (14 preceding siblings ...)
  2025-05-15 12:46 ` [PATCH 15/15] bugs/core: Reorganize fields in the first line of WARNING output, add ->comm[] output Ingo Molnar
@ 2025-05-22 20:39 ` David Laight
  2025-06-09  7:52   ` Ingo Molnar
  2025-06-09 11:13 ` Peter Zijlstra
  16 siblings, 1 reply; 30+ messages in thread
From: David Laight @ 2025-05-22 20:39 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Linus Torvalds, Peter Zijlstra, linux-arch

On Thu, 15 May 2025 14:46:29 +0200
Ingo Molnar <mingo@kernel.org> wrote:

> Changes in -v2:
> 
>  - Incorporated review feedback:
> 
>     - Make the expanded strings conditional on the new
>       CONFIG_DEBUG_BUGVERBOSE_DETAILED=y switch, to address concerns
>       about the +100K kernel size increase, disabled by default.
> 
>     - Expanded the Cc: fields
> 
>  - Rebased to v6.15-rc6
> 
> This tree can also be found at:
> 
> 	git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git WIP.core/bugs
> 
> Thanks,
> 
> 	Ingo
> 
> =========================>  
> Original -v1 announcement:
> 
> This series improves the current WARN_ON_ONCE() output, if
> the new CONFIG_DEBUG_BUGVERBOSE_DETAILED=y option is enabled,
> from:
> 
>   WARN_ON_ONCE(idx < 0 && ptr);
>   ...
> 
>   WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410

What happens if the condition contains #defines?
Does it output what is in the source file, or the (bloated) expanded text?
For instance:
	WARN_ON_ONCE(min(foo, bar) < baz);
doesn't really want to show the expansion of min().

	David

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

* Re: [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string
  2025-05-22 20:39 ` [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string David Laight
@ 2025-06-09  7:52   ` Ingo Molnar
  0 siblings, 0 replies; 30+ messages in thread
From: Ingo Molnar @ 2025-06-09  7:52 UTC (permalink / raw)
  To: David Laight; +Cc: linux-kernel, Linus Torvalds, Peter Zijlstra, linux-arch


* David Laight <david.laight.linux@gmail.com> wrote:

> On Thu, 15 May 2025 14:46:29 +0200
> Ingo Molnar <mingo@kernel.org> wrote:
> 
> > Changes in -v2:
> > 
> >  - Incorporated review feedback:
> > 
> >     - Make the expanded strings conditional on the new
> >       CONFIG_DEBUG_BUGVERBOSE_DETAILED=y switch, to address concerns
> >       about the +100K kernel size increase, disabled by default.
> > 
> >     - Expanded the Cc: fields
> > 
> >  - Rebased to v6.15-rc6
> > 
> > This tree can also be found at:
> > 
> > 	git://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git WIP.core/bugs
> > 
> > Thanks,
> > 
> > 	Ingo
> > 
> > =========================>  
> > Original -v1 announcement:
> > 
> > This series improves the current WARN_ON_ONCE() output, if
> > the new CONFIG_DEBUG_BUGVERBOSE_DETAILED=y option is enabled,
> > from:
> > 
> >   WARN_ON_ONCE(idx < 0 && ptr);
> >   ...
> > 
> >   WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:8511 sched_init+0x20/0x410
> 
> What happens if the condition contains #defines?
> Does it output what is in the source file, or the (bloated) expanded text?
> For instance:
> 	WARN_ON_ONCE(min(foo, bar) < baz);
> doesn't really want to show the expansion of min().

I'm using the '#' 'stringizing' CPP token to stringify the expression, 
which doesn't expand macros but turns macro arguments into string 
literals:

	WARNING: [ptr == 0 && (min(0,1) < 1)] kernel/sched/core.c:8509 at sched_init+0x20/0x410, CPU#0: swapper/0

Thanks,

	Ingo

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

* [PATCH 16/15] bugs/s390: Use in 'cond_str' to __EMIT_BUG()
  2025-05-20 13:39   ` Heiko Carstens
@ 2025-06-09  8:27     ` Ingo Molnar
  2025-06-09 15:56       ` Heiko Carstens
  0 siblings, 1 reply; 30+ messages in thread
From: Ingo Molnar @ 2025-06-09  8:27 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: linux-kernel, Linus Torvalds, Peter Zijlstra, linux-arch,
	Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
	Sven Schnelle, linux-s390


* Heiko Carstens <hca@linux.ibm.com> wrote:

> On Thu, May 15, 2025 at 02:46:39PM +0200, Ingo Molnar wrote:
> > Pass in the condition string from __WARN_FLAGS(), but do not
> > concatenate it with __FILE__, because the __bug_table is
> > apparently indexed by 16 bits and increasing string size
> > overflows it on defconfig builds.
> 
> Could you provide your change which didn't work?
> 
> I cannot see how anything would overflow. Trying the below on top of
> your series seems to work like expected.
> 
> In order to keep things easy this drops the mergeable section trick
> and results in a small increase of the rodata section, but I doubt
> that would explain what you have seen.
> 
> Also allyesconfig builds without errors.
> 
> diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h
> index 30f8785a01f5..837bfbde0c51 100644
> --- a/arch/s390/include/asm/bug.h
> +++ b/arch/s390/include/asm/bug.h
> @@ -11,16 +11,14 @@
>  #define __EMIT_BUG(cond_str, x) do {				\
>  	asm_inline volatile(					\
>  		"0:	mc	0,0\n"				\
> -		".section .rodata.str,\"aMS\",@progbits,1\n"	\
> -		"1:	.asciz	\""__FILE__"\"\n"		\
> -		".previous\n"					\
>  		".section __bug_table,\"aw\"\n"			\
> -		"2:	.long	0b-.\n"				\
> -		"	.long	1b-.\n"				\
> -		"	.short	%0,%1\n"			\
> -		"	.org	2b+%2\n"			\
> +		"1:	.long	0b-.\n"				\
> +		"	.long	%0-.\n"				\
> +		"	.short	%1,%2\n"			\
> +		"	.org	1b+%3\n"			\
>  		".previous\n"					\
> -		: : "i" (__LINE__),				\
> +		: : "i" (WARN_CONDITION_STR(cond_str) __FILE__),\
> +		    "i" (__LINE__),				\
>  		    "i" (x),					\
>  		    "i" (sizeof(struct bug_entry)));		\
>  } while (0)

So I'm not sure what happened: I tried to reproduce what I did 
originally, but my naive patch ran into assembler build errors when a 
WARN_ON() macro tried to use the '%' C operator, such as 
fs/crypto/crypto.c:123:

 include/linux/compiler_types.h:497:20: error: invalid 'asm': invalid %-code
 arch/s390/include/asm/bug.h:12:2: note: in expansion of macro 'asm_inline'
 arch/s390/include/asm/bug.h:50:2: note: in expansion of macro '__EMIT_BUG'
 include/asm-generic/bug.h:119:3: note: in expansion of macro '__WARN_FLAGS'
 fs/crypto/crypto.c:123:6: note: in expansion of macro 'WARN_ON_ONCE'

Which corresponds to:

        if (WARN_ON_ONCE(len % FSCRYPT_CONTENTS_ALIGNMENT != 0))
                return -EINVAL;

I'm quite sure I never saw these build errors - I saw linker errors 
related to the u16 overflow I documented in the changelog. (Note to 
self: copy & paste more of the build error context next time around.)

Your version doesn't have that build problem, so I picked it up with 
the changelog below and your Signed-off-by. Does that look good to you?

Thanks,

	Ingo

===================================>
From 7128294ca8b997efb1d85c7405c8c6e9af1a170d Mon Sep 17 00:00:00 2001
From: Heiko Carstens <hca@linux.ibm.com>
Date: Tue, 20 May 2025 15:39:27 +0200
Subject: [PATCH] bugs/s390: Use 'cond_str' in __EMIT_BUG()

In order to keep things easy this drops the mergeable section trick
and results in a small increase of the rodata section.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arch@vger.kernel.org
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: linux-s390@vger.kernel.org
Link: https://lore.kernel.org/r/20250520133927.7932C19-hca@linux.ibm.com
---
 arch/s390/include/asm/bug.h | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/arch/s390/include/asm/bug.h b/arch/s390/include/asm/bug.h
index 30f8785a01f5..837bfbde0c51 100644
--- a/arch/s390/include/asm/bug.h
+++ b/arch/s390/include/asm/bug.h
@@ -11,16 +11,14 @@
 #define __EMIT_BUG(cond_str, x) do {				\
 	asm_inline volatile(					\
 		"0:	mc	0,0\n"				\
-		".section .rodata.str,\"aMS\",@progbits,1\n"	\
-		"1:	.asciz	\""__FILE__"\"\n"		\
-		".previous\n"					\
 		".section __bug_table,\"aw\"\n"			\
-		"2:	.long	0b-.\n"				\
-		"	.long	1b-.\n"				\
-		"	.short	%0,%1\n"			\
-		"	.org	2b+%2\n"			\
+		"1:	.long	0b-.\n"				\
+		"	.long	%0-.\n"				\
+		"	.short	%1,%2\n"			\
+		"	.org	1b+%3\n"			\
 		".previous\n"					\
-		: : "i" (__LINE__),				\
+		: : "i" (WARN_CONDITION_STR(cond_str) __FILE__),\
+		    "i" (__LINE__),				\
 		    "i" (x),					\
 		    "i" (sizeof(struct bug_entry)));		\
 } while (0)

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

* Re: [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string
  2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
                   ` (15 preceding siblings ...)
  2025-05-22 20:39 ` [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string David Laight
@ 2025-06-09 11:13 ` Peter Zijlstra
  16 siblings, 0 replies; 30+ messages in thread
From: Peter Zijlstra @ 2025-06-09 11:13 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Linus Torvalds, linux-arch



Ingo, have you seen my recent WARN hackery? I'm thinking we can do tihs
on top of those much simpler.

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

* Re: [PATCH 16/15] bugs/s390: Use in 'cond_str' to __EMIT_BUG()
  2025-06-09  8:27     ` [PATCH 16/15] bugs/s390: Use " Ingo Molnar
@ 2025-06-09 15:56       ` Heiko Carstens
  0 siblings, 0 replies; 30+ messages in thread
From: Heiko Carstens @ 2025-06-09 15:56 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Linus Torvalds, Peter Zijlstra, linux-arch,
	Vasily Gorbik, Alexander Gordeev, Christian Borntraeger,
	Sven Schnelle, linux-s390

On Mon, Jun 09, 2025 at 10:27:44AM +0200, Ingo Molnar wrote:
> So I'm not sure what happened: I tried to reproduce what I did 
> originally, but my naive patch ran into assembler build errors when a 
> WARN_ON() macro tried to use the '%' C operator, such as 
> fs/crypto/crypto.c:123:
> 
>  include/linux/compiler_types.h:497:20: error: invalid 'asm': invalid %-code
>  arch/s390/include/asm/bug.h:12:2: note: in expansion of macro 'asm_inline'
>  arch/s390/include/asm/bug.h:50:2: note: in expansion of macro '__EMIT_BUG'
>  include/asm-generic/bug.h:119:3: note: in expansion of macro '__WARN_FLAGS'
>  fs/crypto/crypto.c:123:6: note: in expansion of macro 'WARN_ON_ONCE'
> 
> Which corresponds to:
> 
>         if (WARN_ON_ONCE(len % FSCRYPT_CONTENTS_ALIGNMENT != 0))
>                 return -EINVAL;
> 
> I'm quite sure I never saw these build errors - I saw linker errors 
> related to the u16 overflow I documented in the changelog. (Note to 
> self: copy & paste more of the build error context next time around.)
> 
> Your version doesn't have that build problem, so I picked it up with 
> the changelog below and your Signed-off-by. Does that look good to you?

Yes, fine with me.

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

end of thread, other threads:[~2025-06-09 15:57 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-15 12:46 [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string Ingo Molnar
2025-05-15 12:46 ` [PATCH 01/15] bugs/core: Extend __WARN_FLAGS() with the 'cond_str' parameter Ingo Molnar
2025-05-15 12:46 ` [PATCH 02/15] bugs/core: Pass down the condition string of WARN_ON_ONCE(cond) warnings to __WARN_FLAGS() Ingo Molnar
2025-05-15 12:46 ` [PATCH 03/15] bugs/core: Introduce the CONFIG_DEBUG_BUGVERBOSE_DETAILED Kconfig switch Ingo Molnar
2025-05-15 12:46 ` [PATCH 04/15] bugs/x86: Extend _BUG_FLAGS() with the 'cond_str' parameter Ingo Molnar
2025-05-15 12:46 ` [PATCH 05/15] bugs/x86: Augment warnings output by concatenating 'cond_str' with the regular __FILE__ string in _BUG_FLAGS() Ingo Molnar
2025-05-15 12:46 ` [PATCH 06/15] bugs/powerpc: Pass in 'cond_str' to BUG_ENTRY() Ingo Molnar
2025-05-15 12:46 ` [PATCH 07/15] bugs/powerpc: Concatenate 'cond_str' with '__FILE__' in BUG_ENTRY(), to extend WARN_ON/BUG_ON output Ingo Molnar
2025-05-15 12:46 ` [PATCH 08/15] bugs/LoongArch: Pass in 'cond_str' to __BUG_ENTRY() Ingo Molnar
2025-05-15 12:46 ` [PATCH 09/15] bugs/LoongArch: Concatenate 'cond_str' with '__FILE__' in __BUG_ENTRY(), to extend WARN_ON/BUG_ON output Ingo Molnar
2025-05-15 12:46 ` [PATCH 10/15] bugs/s390: Pass in 'cond_str' to __EMIT_BUG() Ingo Molnar
2025-05-20 13:39   ` Heiko Carstens
2025-06-09  8:27     ` [PATCH 16/15] bugs/s390: Use " Ingo Molnar
2025-06-09 15:56       ` Heiko Carstens
2025-05-15 12:46 ` [PATCH 11/15] bugs/riscv: Pass in 'cond_str' to __BUG_FLAGS() Ingo Molnar
2025-05-15 12:46 ` [PATCH 12/15] bugs/riscv: Concatenate 'cond_str' with '__FILE__' in __BUG_FLAGS(), to extend WARN_ON/BUG_ON output Ingo Molnar
2025-05-16 15:09   ` Alexandre Ghiti
2025-05-16 15:45     ` Ingo Molnar
2025-05-15 12:46 ` [PATCH 13/15] bugs/parisc: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), " Ingo Molnar
2025-05-15 15:28   ` Helge Deller
2025-05-15 15:31     ` Ingo Molnar
2025-05-15 12:46 ` [PATCH 14/15] bugs/sh: " Ingo Molnar
2025-05-15 12:56   ` John Paul Adrian Glaubitz
2025-05-15 13:33     ` Ingo Molnar
2025-05-15 13:35       ` John Paul Adrian Glaubitz
2025-05-15 13:43         ` Ingo Molnar
2025-05-15 12:46 ` [PATCH 15/15] bugs/core: Reorganize fields in the first line of WARNING output, add ->comm[] output Ingo Molnar
2025-05-22 20:39 ` [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to improve WARN_ON_ONCE() output by adding the condition string David Laight
2025-06-09  7:52   ` Ingo Molnar
2025-06-09 11:13 ` Peter Zijlstra

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