diff mbox series

kconfig: prefer toolchain default for debug information choice

Message ID 20241124-kbuild-allconfig_debug_info-v1-1-07a7ac8d9a73@weissschuh.net (mailing list archive)
State New
Headers show
Series kconfig: prefer toolchain default for debug information choice | expand

Commit Message

Thomas Weißschuh Nov. 24, 2024, 3:58 p.m. UTC
Kconfig by default chooses the first entry of a choice setting.
For the "debug information" choice this is DEBUG_INFO_NONE which
disables debug information completely.

The kconfig choice itself recommends to use "Toolchain default":

	Choose which version of DWARF debug info to emit. If unsure,
	select "Toolchain default".

Align the actual configuration with the recommendation by providing an
explicit default.

This also enables more codepaths from allmodconfig/allyesconfig which
depend on debug information being available.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
 lib/Kconfig.debug | 1 +
 1 file changed, 1 insertion(+)


---
base-commit: 9f16d5e6f220661f73b36a4be1b21575651d8833
change-id: 20241124-kbuild-allconfig_debug_info-f7449ba15be6

Best regards,

Comments

Masahiro Yamada Nov. 25, 2024, 1:27 a.m. UTC | #1
On Mon, Nov 25, 2024 at 12:59 AM Thomas Weißschuh <linux@weissschuh.net> wrote:
>
> Kconfig by default chooses the first entry of a choice setting.
> For the "debug information" choice this is DEBUG_INFO_NONE which
> disables debug information completely.
>
> The kconfig choice itself recommends to use "Toolchain default":
>
>         Choose which version of DWARF debug info to emit. If unsure,
>         select "Toolchain default".
>
> Align the actual configuration with the recommendation by providing an
> explicit default.
>
> This also enables more codepaths from allmodconfig/allyesconfig which
> depend on debug information being available.

Please give me some examples for "more codepaths" enabled by DEBUG_INFO
because this is the opposite to the previous decision.


Commit f9b3cd24578401e7a392974b3353277286e49cee mentions:

  all*config target ends up taking much longer and the output is much larger.
  Having this be "default off" makes sense.



allmodconfig is often used for compile testing in CI/CD.
We need to see the sufficient gain that sacrifices
the build speed.



--
Best Regards
Masahiro Yamada
Masahiro Yamada Nov. 25, 2024, 1:36 a.m. UTC | #2
On Mon, Nov 25, 2024 at 10:27 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Mon, Nov 25, 2024 at 12:59 AM Thomas Weißschuh <linux@weissschuh.net> wrote:
> >
> > Kconfig by default chooses the first entry of a choice setting.
> > For the "debug information" choice this is DEBUG_INFO_NONE which
> > disables debug information completely.
> >
> > The kconfig choice itself recommends to use "Toolchain default":
> >
> >         Choose which version of DWARF debug info to emit. If unsure,
> >         select "Toolchain default".
> >
> > Align the actual configuration with the recommendation by providing an
> > explicit default.
> >
> > This also enables more codepaths from allmodconfig/allyesconfig which
> > depend on debug information being available.
>
> Please give me some examples for "more codepaths" enabled by DEBUG_INFO
> because this is the opposite to the previous decision.
>
>
> Commit f9b3cd24578401e7a392974b3353277286e49cee mentions:
>
>   all*config target ends up taking much longer and the output is much larger.
>   Having this be "default off" makes sense.
>
>
>
> allmodconfig is often used for compile testing in CI/CD.
> We need to see the sufficient gain that sacrifices
> the build speed.
>

Presumably, DEBUG_INFO_BTF is the one because you submitted
some patches at the same time.

Are there some compile errors that are not detected
when DEBUG_INFO_BTF is disabled?
Thomas Weißschuh Nov. 25, 2024, 8:45 a.m. UTC | #3
On 2024-11-25 10:36:45+0900, Masahiro Yamada wrote:
> On Mon, Nov 25, 2024 at 10:27 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > On Mon, Nov 25, 2024 at 12:59 AM Thomas Weißschuh <linux@weissschuh.net> wrote:
> > >
> > > Kconfig by default chooses the first entry of a choice setting.
> > > For the "debug information" choice this is DEBUG_INFO_NONE which
> > > disables debug information completely.
> > >
> > > The kconfig choice itself recommends to use "Toolchain default":
> > >
> > >         Choose which version of DWARF debug info to emit. If unsure,
> > >         select "Toolchain default".
> > >
> > > Align the actual configuration with the recommendation by providing an
> > > explicit default.
> > >
> > > This also enables more codepaths from allmodconfig/allyesconfig which
> > > depend on debug information being available.
> >
> > Please give me some examples for "more codepaths" enabled by DEBUG_INFO
> > because this is the opposite to the previous decision.

It's really only the BTF stuff. IIRC there was some very minor
arch-specific things, too but these should not matter.

> > Commit f9b3cd24578401e7a392974b3353277286e49cee mentions:
> >
> >   all*config target ends up taking much longer and the output is much larger.
> >   Having this be "default off" makes sense.
> >
> >
> >
> > allmodconfig is often used for compile testing in CI/CD.
> > We need to see the sufficient gain that sacrifices
> > the build speed.

Thanks for that pointer.
It feels wrong to me to deviate from the pure meaning of "allyesconfig"
for one specific usecase.
The CI systems presumably have to adapt the configs to various
constraint anyways (the thread in [0] comes to mind).
So they can disable debuginfo if they so desire.

Especially as the kconfig help text explicitly recommends to enable this
if unsure.

> Presumably, DEBUG_INFO_BTF is the one because you submitted
> some patches at the same time.

Yes, it's about DEBUG_INFO_BTF.
But it was not the first series where the BTF stuff was surprisingly not
compiled in an all{yes,mod}config.

> Are there some compile errors that are not detected
> when DEBUG_INFO_BTF is disabled?

Not in the current kernel, these would have been detected by at least
the randconfig builds.

[0] https://lore.kernel.org/lkml/202411221744.1a298e1e-lkp@intel.com/
Nathan Chancellor Nov. 25, 2024, 2:52 p.m. UTC | #4
Hi Thomas,

On Sun, Nov 24, 2024 at 04:58:04PM +0100, Thomas Weißschuh wrote:
> Kconfig by default chooses the first entry of a choice setting.
> For the "debug information" choice this is DEBUG_INFO_NONE which
> disables debug information completely.
> 
> The kconfig choice itself recommends to use "Toolchain default":
> 
> 	Choose which version of DWARF debug info to emit. If unsure,
> 	select "Toolchain default".
> 
> Align the actual configuration with the recommendation by providing an
> explicit default.
> 
> This also enables more codepaths from allmodconfig/allyesconfig which
> depend on debug information being available.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
>  lib/Kconfig.debug | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index 5d9eca035d470f7ba0c5ff932c37fd5869174269..0aefcd103d9012cd8067e5594404358b0e977644 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -240,6 +240,7 @@ config AS_HAS_NON_CONST_ULEB128
>  choice
>  	prompt "Debug information"
>  	depends on DEBUG_KERNEL
> +	default DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
>  	help
>  	  Selecting something other than "None" results in a kernel image
>  	  that will include debugging info resulting in a larger kernel image.
> 
> ---
> base-commit: 9f16d5e6f220661f73b36a4be1b21575651d8833
> change-id: 20241124-kbuild-allconfig_debug_info-f7449ba15be6
> 
> Best regards,
> -- 
> Thomas Weißschuh <linux@weissschuh.net>
> 

I am not the biggest fan of this because it appears to have around a 5%
penalty in compilation times when I benchmarked building allmodconfig
with and without this change.

With LLVM 19.1.4:

  Benchmark 1: DEBUG_INFO_NONE
    Time (mean ± σ):     715.858 s ±  0.531 s    [User: 38038.311 s, System: 3718.784 s]
    Range (min … max):   715.271 s … 716.307 s    3 runs

  Benchmark 2: DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
    Time (mean ± σ):     760.749 s ±  0.172 s    [User: 40699.800 s, System: 3817.819 s]
    Range (min … max):   760.617 s … 760.943 s    3 runs

  Summary
    DEBUG_INFO_NONE ran
      1.06 ± 0.00 times faster than DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT

With GCC 14.2.0:

  Benchmark 1: DEBUG_INFO_NONE
    Time (mean ± σ):     830.524 s ±  0.342 s    [User: 43901.642 s, System: 4515.917 s]
    Range (min … max):   830.135 s … 830.777 s    3 runs

  Benchmark 2: DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
    Time (mean ± σ):     873.663 s ±  0.150 s    [User: 46102.416 s, System: 4968.065 s]
    Range (min … max):   873.565 s … 873.836 s    3 runs

  Summary
    DEBUG_INFO_NONE ran
      1.05 ± 0.00 times faster than DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT

I understand the desire to have CONFIG_DEBUG_INFO_BTF be selected with
allmodconfig for the sake of coverage but that is going to add up for
builders doing many builds a day.

Maybe we could add a fragment to kernel/configs for easily flipping
this? Another alternative that I have thought about recently is allowing
developers to specify a directory that holds out of tree config
fragments (KBUILD_FRAGMENTS_DIR?) that would be searched like
kernel/configs and arch/*/configs, so that people could maintain their
own fragments for easily doing something like:

  allmodconfig debug_info_btf.config

during configuration. Regardless though, if others find this new default
desirable, I am fine with it.

Cheers,
Nathan
Thomas Weißschuh Nov. 25, 2024, 3:46 p.m. UTC | #5
Hi Nathan,

On 2024-11-25 07:52:51-0700, Nathan Chancellor wrote:
> On Sun, Nov 24, 2024 at 04:58:04PM +0100, Thomas Weißschuh wrote:
> > Kconfig by default chooses the first entry of a choice setting.
> > For the "debug information" choice this is DEBUG_INFO_NONE which
> > disables debug information completely.
> > 
> > The kconfig choice itself recommends to use "Toolchain default":
> > 
> > 	Choose which version of DWARF debug info to emit. If unsure,
> > 	select "Toolchain default".
> > 
> > Align the actual configuration with the recommendation by providing an
> > explicit default.
> > 
> > This also enables more codepaths from allmodconfig/allyesconfig which
> > depend on debug information being available.
> > 
> > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> > ---
> >  lib/Kconfig.debug | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > index 5d9eca035d470f7ba0c5ff932c37fd5869174269..0aefcd103d9012cd8067e5594404358b0e977644 100644
> > --- a/lib/Kconfig.debug
> > +++ b/lib/Kconfig.debug
> > @@ -240,6 +240,7 @@ config AS_HAS_NON_CONST_ULEB128
> >  choice
> >  	prompt "Debug information"
> >  	depends on DEBUG_KERNEL
> > +	default DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> >  	help
> >  	  Selecting something other than "None" results in a kernel image
> >  	  that will include debugging info resulting in a larger kernel image.
> > 
> > ---
> > base-commit: 9f16d5e6f220661f73b36a4be1b21575651d8833
> > change-id: 20241124-kbuild-allconfig_debug_info-f7449ba15be6
> > 
> > Best regards,
> > -- 
> > Thomas Weißschuh <linux@weissschuh.net>
> > 
> 
> I am not the biggest fan of this because it appears to have around a 5%
> penalty in compilation times when I benchmarked building allmodconfig
> with and without this change.
> 
> With LLVM 19.1.4:
> 
>   Benchmark 1: DEBUG_INFO_NONE
>     Time (mean ± σ):     715.858 s ±  0.531 s    [User: 38038.311 s, System: 3718.784 s]
>     Range (min … max):   715.271 s … 716.307 s    3 runs
> 
>   Benchmark 2: DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
>     Time (mean ± σ):     760.749 s ±  0.172 s    [User: 40699.800 s, System: 3817.819 s]
>     Range (min … max):   760.617 s … 760.943 s    3 runs
> 
>   Summary
>     DEBUG_INFO_NONE ran
>       1.06 ± 0.00 times faster than DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> 
> With GCC 14.2.0:
> 
>   Benchmark 1: DEBUG_INFO_NONE
>     Time (mean ± σ):     830.524 s ±  0.342 s    [User: 43901.642 s, System: 4515.917 s]
>     Range (min … max):   830.135 s … 830.777 s    3 runs
> 
>   Benchmark 2: DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
>     Time (mean ± σ):     873.663 s ±  0.150 s    [User: 46102.416 s, System: 4968.065 s]
>     Range (min … max):   873.565 s … 873.836 s    3 runs
> 
>   Summary
>     DEBUG_INFO_NONE ran
>       1.05 ± 0.00 times faster than DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> 
> I understand the desire to have CONFIG_DEBUG_INFO_BTF be selected with
> allmodconfig for the sake of coverage but that is going to add up for
> builders doing many builds a day.

No argument on the increased cost.

But it's called "allyesconfig" not "ciconfig".
I do realize that technically it is a Kconfig "choice" which
does not have a "yes" answer. However I think it does fit the spirit.

> Maybe we could add a fragment to kernel/configs for easily flipping
> this? Another alternative that I have thought about recently is allowing
> developers to specify a directory that holds out of tree config
> fragments (KBUILD_FRAGMENTS_DIR?) that would be searched like
> kernel/configs and arch/*/configs, so that people could maintain their
> own fragments for easily doing something like:
> 
>   allmodconfig debug_info_btf.config
> 
> during configuration. Regardless though, if others find this new default
> desirable, I am fine with it.

The same could be used by the CI setups :-)

There should be less CI setups than regular developers, they known more
about special or expensive configuration quirks and they should already
have logic to filter and customize build configurations.

While I'm arguing here to accomodate for my personal laziness, I also do
think that these are generally valid arguments.
But if there if it's not convincing enough, I'll drop it.

The out of tree fragments idea sounds personally useful but a bit
inconsistent with the rest of kbuild.
AFAIK there is nothing similar; for thing like CFLAGS etc.


Thomas
Nathan Chancellor Nov. 25, 2024, 6:58 p.m. UTC | #6
On Mon, Nov 25, 2024 at 04:46:53PM +0100, Thomas Weißschuh wrote:
> Hi Nathan,
> 
> On 2024-11-25 07:52:51-0700, Nathan Chancellor wrote:
> > On Sun, Nov 24, 2024 at 04:58:04PM +0100, Thomas Weißschuh wrote:
> > > Kconfig by default chooses the first entry of a choice setting.
> > > For the "debug information" choice this is DEBUG_INFO_NONE which
> > > disables debug information completely.
> > > 
> > > The kconfig choice itself recommends to use "Toolchain default":
> > > 
> > > 	Choose which version of DWARF debug info to emit. If unsure,
> > > 	select "Toolchain default".
> > > 
> > > Align the actual configuration with the recommendation by providing an
> > > explicit default.
> > > 
> > > This also enables more codepaths from allmodconfig/allyesconfig which
> > > depend on debug information being available.
> > > 
> > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> > > ---
> > >  lib/Kconfig.debug | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > > index 5d9eca035d470f7ba0c5ff932c37fd5869174269..0aefcd103d9012cd8067e5594404358b0e977644 100644
> > > --- a/lib/Kconfig.debug
> > > +++ b/lib/Kconfig.debug
> > > @@ -240,6 +240,7 @@ config AS_HAS_NON_CONST_ULEB128
> > >  choice
> > >  	prompt "Debug information"
> > >  	depends on DEBUG_KERNEL
> > > +	default DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> > >  	help
> > >  	  Selecting something other than "None" results in a kernel image
> > >  	  that will include debugging info resulting in a larger kernel image.
> > > 
> > > ---
> > > base-commit: 9f16d5e6f220661f73b36a4be1b21575651d8833
> > > change-id: 20241124-kbuild-allconfig_debug_info-f7449ba15be6
> > > 
> > > Best regards,
> > > -- 
> > > Thomas Weißschuh <linux@weissschuh.net>
> > > 
> > 
> > I am not the biggest fan of this because it appears to have around a 5%
> > penalty in compilation times when I benchmarked building allmodconfig
> > with and without this change.
> > 
> > With LLVM 19.1.4:
> > 
> >   Benchmark 1: DEBUG_INFO_NONE
> >     Time (mean ± σ):     715.858 s ±  0.531 s    [User: 38038.311 s, System: 3718.784 s]
> >     Range (min … max):   715.271 s … 716.307 s    3 runs
> > 
> >   Benchmark 2: DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> >     Time (mean ± σ):     760.749 s ±  0.172 s    [User: 40699.800 s, System: 3817.819 s]
> >     Range (min … max):   760.617 s … 760.943 s    3 runs
> > 
> >   Summary
> >     DEBUG_INFO_NONE ran
> >       1.06 ± 0.00 times faster than DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> > 
> > With GCC 14.2.0:
> > 
> >   Benchmark 1: DEBUG_INFO_NONE
> >     Time (mean ± σ):     830.524 s ±  0.342 s    [User: 43901.642 s, System: 4515.917 s]
> >     Range (min … max):   830.135 s … 830.777 s    3 runs
> > 
> >   Benchmark 2: DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> >     Time (mean ± σ):     873.663 s ±  0.150 s    [User: 46102.416 s, System: 4968.065 s]
> >     Range (min … max):   873.565 s … 873.836 s    3 runs
> > 
> >   Summary
> >     DEBUG_INFO_NONE ran
> >       1.05 ± 0.00 times faster than DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> > 
> > I understand the desire to have CONFIG_DEBUG_INFO_BTF be selected with
> > allmodconfig for the sake of coverage but that is going to add up for
> > builders doing many builds a day.
> 
> No argument on the increased cost.
> 
> But it's called "allyesconfig" not "ciconfig".
> I do realize that technically it is a Kconfig "choice" which
> does not have a "yes" answer. However I think it does fit the spirit.

Sure, I do not really disagree there. I more interpret allmodconfig and
allyesconfig to mean "build all code" not "build with every option
possible", which is a small distinction but meaningful in this case. Not
saying one is more correct than the other, just saying where I come from
:)

> > Maybe we could add a fragment to kernel/configs for easily flipping
> > this? Another alternative that I have thought about recently is allowing
> > developers to specify a directory that holds out of tree config
> > fragments (KBUILD_FRAGMENTS_DIR?) that would be searched like
> > kernel/configs and arch/*/configs, so that people could maintain their
> > own fragments for easily doing something like:
> > 
> >   allmodconfig debug_info_btf.config
> > 
> > during configuration. Regardless though, if others find this new default
> > desirable, I am fine with it.
> 
> The same could be used by the CI setups :-)
> 
> There should be less CI setups than regular developers, they known more
> about special or expensive configuration quirks and they should already
> have logic to filter and customize build configurations.
> 
> While I'm arguing here to accomodate for my personal laziness, I also do
> think that these are generally valid arguments.
> But if there if it's not convincing enough, I'll drop it.

Yes, I think there is definitely a fine argument here. I am certainly
not here to block anything, just giving my opinion as someone who does a
lot of builds every day :)

> The out of tree fragments idea sounds personally useful but a bit
> inconsistent with the rest of kbuild.
> AFAIK there is nothing similar; for thing like CFLAGS etc.

KCFLAGS in Makefile or Documentation/kbuild/kbuild.rst?

Cheers,
Nathan
Thomas Weißschuh Dec. 1, 2024, 8:58 a.m. UTC | #7
On 2024-11-25 11:58:37-0700, Nathan Chancellor wrote:
> On Mon, Nov 25, 2024 at 04:46:53PM +0100, Thomas Weißschuh wrote:
> > On 2024-11-25 07:52:51-0700, Nathan Chancellor wrote:
> > > On Sun, Nov 24, 2024 at 04:58:04PM +0100, Thomas Weißschuh wrote:
> > > > Kconfig by default chooses the first entry of a choice setting.
> > > > For the "debug information" choice this is DEBUG_INFO_NONE which
> > > > disables debug information completely.
> > > > 
> > > > The kconfig choice itself recommends to use "Toolchain default":
> > > > 
> > > > 	Choose which version of DWARF debug info to emit. If unsure,
> > > > 	select "Toolchain default".
> > > > 
> > > > Align the actual configuration with the recommendation by providing an
> > > > explicit default.
> > > > 
> > > > This also enables more codepaths from allmodconfig/allyesconfig which
> > > > depend on debug information being available.
> > > > 
> > > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> > > > ---
> > > >  lib/Kconfig.debug | 1 +
> > > >  1 file changed, 1 insertion(+)
> > > > 
> > > > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > > > index 5d9eca035d470f7ba0c5ff932c37fd5869174269..0aefcd103d9012cd8067e5594404358b0e977644 100644
> > > > --- a/lib/Kconfig.debug
> > > > +++ b/lib/Kconfig.debug
> > > > @@ -240,6 +240,7 @@ config AS_HAS_NON_CONST_ULEB128
> > > >  choice
> > > >  	prompt "Debug information"
> > > >  	depends on DEBUG_KERNEL
> > > > +	default DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> > > >  	help
> > > >  	  Selecting something other than "None" results in a kernel image
> > > >  	  that will include debugging info resulting in a larger kernel image.
> > > > 
> > > > ---
> > > > base-commit: 9f16d5e6f220661f73b36a4be1b21575651d8833
> > > > change-id: 20241124-kbuild-allconfig_debug_info-f7449ba15be6
> > > > 
> > > > Best regards,
> > > > -- 
> > > > Thomas Weißschuh <linux@weissschuh.net>
> > > > 
> > > 
> > > I am not the biggest fan of this because it appears to have around a 5%
> > > penalty in compilation times when I benchmarked building allmodconfig
> > > with and without this change.
> > > 
> > > With LLVM 19.1.4:
> > > 
> > >   Benchmark 1: DEBUG_INFO_NONE
> > >     Time (mean ± σ):     715.858 s ±  0.531 s    [User: 38038.311 s, System: 3718.784 s]
> > >     Range (min … max):   715.271 s … 716.307 s    3 runs
> > > 
> > >   Benchmark 2: DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> > >     Time (mean ± σ):     760.749 s ±  0.172 s    [User: 40699.800 s, System: 3817.819 s]
> > >     Range (min … max):   760.617 s … 760.943 s    3 runs
> > > 
> > >   Summary
> > >     DEBUG_INFO_NONE ran
> > >       1.06 ± 0.00 times faster than DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> > > 
> > > With GCC 14.2.0:
> > > 
> > >   Benchmark 1: DEBUG_INFO_NONE
> > >     Time (mean ± σ):     830.524 s ±  0.342 s    [User: 43901.642 s, System: 4515.917 s]
> > >     Range (min … max):   830.135 s … 830.777 s    3 runs
> > > 
> > >   Benchmark 2: DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> > >     Time (mean ± σ):     873.663 s ±  0.150 s    [User: 46102.416 s, System: 4968.065 s]
> > >     Range (min … max):   873.565 s … 873.836 s    3 runs
> > > 
> > >   Summary
> > >     DEBUG_INFO_NONE ran
> > >       1.05 ± 0.00 times faster than DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
> > > 
> > > I understand the desire to have CONFIG_DEBUG_INFO_BTF be selected with
> > > allmodconfig for the sake of coverage but that is going to add up for
> > > builders doing many builds a day.
> > 
> > No argument on the increased cost.
> > 
> > But it's called "allyesconfig" not "ciconfig".
> > I do realize that technically it is a Kconfig "choice" which
> > does not have a "yes" answer. However I think it does fit the spirit.
> 
> Sure, I do not really disagree there. I more interpret allmodconfig and
> allyesconfig to mean "build all code" not "build with every option
> possible", which is a small distinction but meaningful in this case. Not
> saying one is more correct than the other, just saying where I come from
> :)

FWIW SCHED_CLASS_EXT and some netfilter components also depend on debug
info and are therefore currently not part of all{mod,yes}config.
Looking at current trends I expect more subsystems to be in the same
boat over time.

The (small) BTF support code is also affected.

> > > Maybe we could add a fragment to kernel/configs for easily flipping
> > > this? Another alternative that I have thought about recently is allowing
> > > developers to specify a directory that holds out of tree config
> > > fragments (KBUILD_FRAGMENTS_DIR?) that would be searched like
> > > kernel/configs and arch/*/configs, so that people could maintain their
> > > own fragments for easily doing something like:
> > > 
> > >   allmodconfig debug_info_btf.config
> > > 
> > > during configuration. Regardless though, if others find this new default
> > > desirable, I am fine with it.
> > 
> > The same could be used by the CI setups :-)
> > 
> > There should be less CI setups than regular developers, they known more
> > about special or expensive configuration quirks and they should already
> > have logic to filter and customize build configurations.
> > 
> > While I'm arguing here to accomodate for my personal laziness, I also do
> > think that these are generally valid arguments.
> > But if there if it's not convincing enough, I'll drop it.
> 
> Yes, I think there is definitely a fine argument here. I am certainly
> not here to block anything, just giving my opinion as someone who does a
> lot of builds every day :)

Thanks for your input!
The general interest seems to be very limited.

> > The out of tree fragments idea sounds personally useful but a bit
> > inconsistent with the rest of kbuild.
> > AFAIK there is nothing similar; for thing like CFLAGS etc.
> 
> KCFLAGS in Makefile or Documentation/kbuild/kbuild.rst?

Indeed. I meant for "similar" to mean "pointing to file locations
outside of the source tree".
But looking at it again, this is probably not a good argument.
Having such a feature would also help us for the nolibc testsuite.
diff mbox series

Patch

diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 5d9eca035d470f7ba0c5ff932c37fd5869174269..0aefcd103d9012cd8067e5594404358b0e977644 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -240,6 +240,7 @@  config AS_HAS_NON_CONST_ULEB128
 choice
 	prompt "Debug information"
 	depends on DEBUG_KERNEL
+	default DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT
 	help
 	  Selecting something other than "None" results in a kernel image
 	  that will include debugging info resulting in a larger kernel image.