[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aEaSr7XkRT9icKZ7@gmail.com>
Date: Mon, 9 Jun 2025 09:52:15 +0200
From: Ingo Molnar <mingo@...nel.org>
To: David Laight <david.laight.linux@...il.com>
Cc: linux-kernel@...r.kernel.org,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>, linux-arch@...r.kernel.org
Subject: Re: [PATCH 00/15] Implement CONFIG_DEBUG_BUGVERBOSE_DETAILED=y, to
improve WARN_ON_ONCE() output by adding the condition string
* David Laight <david.laight.linux@...il.com> wrote:
> On Thu, 15 May 2025 14:46:29 +0200
> Ingo Molnar <mingo@...nel.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
Powered by blists - more mailing lists