[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdmq-6poADRajPi6CXuKsYYEPEe1tjXFuLEH6kHprerUdw@mail.gmail.com>
Date: Wed, 24 Aug 2022 16:25:19 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Dmitrii Bundin <dmitrii.bundin.a@...il.com>
Cc: Masahiro Yamada <masahiroy@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Eric Dumazet <edumazet@...gle.com>,
Isabella Basso <isabbasso@...eup.net>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Kees Cook <keescook@...omium.org>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Fangrui Song <maskray@...gle.com>,
Michal Marek <michal.lkml@...kovi.net>,
Nathan Chancellor <nathan@...nel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Vlastimil Babka <vbabka@...e.cz>,
Doug Anderson <dianders@...omium.org>
Subject: Re: [PATCH v3] kbuild: add debug level and macro defs options
On Mon, Aug 22, 2022 at 3:42 PM Dmitrii Bundin
<dmitrii.bundin.a@...il.com> wrote:
>
> On Tue, Aug 23, 2022 at 12:36 AM Nick Desaulniers
> <ndesaulniers@...gle.com> wrote:
> >
> > or perhaps that simply needs to be `-g -gsplit-dwarf`? In which case,
> > that if/else could just be re-arranged.
>
> How about simply assigning DEBUG_CFLAGS := -g at the very beginning
> without any conditions? This would provide the default with the
> possibility of overriding later and -gsplit-dwarf does not necessarily
> come with -g implicitly.
SGTM; I'd accept such a patch.
> > Honestly, I really don't think we need to be wrapping every compiler
> > command line flag under the sun in a kconfig option.
>
> This indeed sounds reasonable to me. So the key point here is to not
> bloat the kconfig with options related to every compiler flag. But I
> think it still might be useful to provide some option that would
> include sort of full debug information compilers may produce. With
> this approach there would be, in fact 3 different levels of debug
> information supported by Kconfig: reduced, default and full. The full
> level would increase everything like -g3, and -fdebug-macro for Clang,
> and probably others.
Has anyone asked for that though? It seems like your intent with this
patch is to fix the surprising+user hostile behavior of compilers
requiring -g to be used when -gsplit-dwarf is used.
If someone using GDB_SCRIPTS or KGDB was like "man, I wish I could
debug macros" then sure I'd be more likely to accept this. Without the
need, this is just wrapping every compiler option in a kconfig, which
frustrates randconfig testing bots. This will slow them down and
bloat their artifacts when randconfig selects -g3, so I'd like someone
to come forward saying they need this and why.
>
> > Or add -g1 to CONFIG_DEBUG_INFO_REDUCED.
>
> I ran some tests and there was indeed some decrease in size. That
> combination probably might be useful.
>
> Any thoughts?
I think there's also -gmlt; when that is preferable to -g1 IDK. Why
either of those weren't used in the first place, IDK.
The help text in DEBUG_INFO_REDUCED in lib/Kconfig.debug makes it
sound like -gmlt is what is wanted. Maybe that should be updated.
But I think DEBUG_INFO_REDUCED is redundant if we were to accept
DEBUG_INFO_LEVEL. Both don't need to exist IMO.
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists