[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250529090129.GZ24938@noisy.programming.kicks-ass.net>
Date: Thu, 29 May 2025 11:01:29 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Alessandro Carminati <acarmina@...hat.com>
Cc: linux-kselftest@...r.kernel.org,
Dan Carpenter <dan.carpenter@...aro.org>,
Kees Cook <keescook@...omium.org>,
Daniel Diaz <daniel.diaz@...aro.org>,
David Gow <davidgow@...gle.com>,
Arthur Grillo <arthurgrillo@...eup.net>,
Brendan Higgins <brendan.higgins@...ux.dev>,
Naresh Kamboju <naresh.kamboju@...aro.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Maxime Ripard <mripard@...nel.org>,
Ville Syrjala <ville.syrjala@...ux.intel.com>,
Daniel Vetter <daniel@...ll.ch>, Guenter Roeck <linux@...ck-us.net>,
Alessandro Carminati <alessandro.carminati@...il.com>,
Jani Nikula <jani.nikula@...el.com>,
Jeff Johnson <jeff.johnson@....qualcomm.com>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Shuah Khan <skhan@...uxfoundation.org>,
Linux Kernel Functional Testing <lkft@...aro.org>,
dri-devel@...ts.freedesktop.org, kunit-dev@...glegroups.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 1/5] bug/kunit: Core support for suppressing warning
backtraces
On Mon, May 26, 2025 at 01:27:51PM +0000, Alessandro Carminati wrote:
> #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));\
> - instrumentation_end(); \
> + if (!KUNIT_IS_SUPPRESSED_WARNING(__func__)) { \
> + instrumentation_begin(); \
> + __warn_printk(arg); \
> + __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)) \
> + if (unlikely(__ret_warn_on) && !KUNIT_IS_SUPPRESSED_WARNING(__func__)) \
> __WARN_FLAGS(BUGFLAG_ONCE | \
> BUGFLAG_TAINT(TAINT_WARN)); \
> unlikely(__ret_warn_on); \
> @@ -121,7 +130,7 @@ extern __printf(1, 2) void __warn_printk(const char *fmt, ...);
> #ifndef WARN_ON
> #define WARN_ON(condition) ({ \
> int __ret_warn_on = !!(condition); \
> - if (unlikely(__ret_warn_on)) \
> + if (unlikely(__ret_warn_on) && !KUNIT_IS_SUPPRESSED_WARNING(__func__)) \
> __WARN(); \
> unlikely(__ret_warn_on); \
> })
> @@ -138,7 +147,7 @@ extern __printf(1, 2) void __warn_printk(const char *fmt, ...);
>
> #define WARN_TAINT(condition, taint, format...) ({ \
> int __ret_warn_on = !!(condition); \
> - if (unlikely(__ret_warn_on)) \
> + if (unlikely(__ret_warn_on) && !KUNIT_IS_SUPPRESSED_WARNING(__func__)) \
> __WARN_printf(taint, format); \
> unlikely(__ret_warn_on); \
> })
> @@ -157,8 +166,10 @@ extern __printf(1, 2) void __warn_printk(const char *fmt, ...);
> #else /* !CONFIG_BUG */
> #ifndef HAVE_ARCH_BUG
> #define BUG() do { \
> - do {} while (1); \
> - unreachable(); \
> + if (!KUNIT_IS_SUPPRESSED_WARNING(__func__)) { \
> + do {} while (1); \
> + unreachable(); \
> + } \
> } while (0)
> #endif
NAK
This is again doing it wrong -- this will bloat every frigging bug/warn
site for no reason.
Like I said before; you need to do this on the report_bug() size of
things.
Powered by blists - more mailing lists