Linux kbuild/kconfig development
 help / color / mirror / Atom feed
From: "Leon Romanovsky" <leon@kernel.org>
To: "Masahiro Yamada" <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH rdma-next] kbuild: Respect request to silent output when merging configs
Date: Mon, 09 Dec 2024 10:43:17 +0200	[thread overview]
Message-ID: <c73891e5-13f6-4ca4-964a-a453a24cd6b8@app.fastmail.com> (raw)
In-Reply-To: <CAK7LNASYp+LWyfF78rc3V=ZpR1iu9gZBj4npuE6Md86X0KcWOQ@mail.gmail.com>



On Mon, Dec 9, 2024, at 07:34, Masahiro Yamada wrote:
> On Mon, Dec 9, 2024 at 1:36 AM Leon Romanovsky <leon@kernel.org> wrote:
>>
>> On Sun, Dec 08, 2024 at 11:49:12PM +0900, Masahiro Yamada wrote:
>> > On Wed, Dec 4, 2024 at 5:49 PM Leon Romanovsky <leon@kernel.org> wrote:
>> > >
>> > > On Wed, Dec 04, 2024 at 05:25:50PM +0900, Masahiro Yamada wrote:
>> > > > On Tue, Dec 3, 2024 at 10:55 PM Leon Romanovsky <leon@kernel.org> wrote:
>> > > > >
>> > > > > From: Leon Romanovsky <leonro@nvidia.com>
>> > > > >
>> > > > > Builds with -s option (silent) are supposed to silence all output
>> > > > > which is not an error. It is the case for target builds but not
>> > > > > for configs. These builds generate prints like this:
>> > > > >
>> > > > > ➜  kernel git:(rdma-next) make -s defconfig debug.config
>> > > > >  Using .config as base
>> > > > >  Merging ./kernel/configs/debug.config
>> > > > >  #
>> > > > >  # merged configuration written to .config (needs make)
>> > > > >  #
>> > > > >  ...
>> > > > >  Value of CONFIG_FUNCTION_TRACER is redefined by fragment ./kernel/configs/debug.config:
>> > > > >  Previous value: # CONFIG_FUNCTION_TRACER is not set
>> > > > >  New value: CONFIG_FUNCTION_TRACER=y
>> > > > >  ----
>> > > > >
>> > > > > Let's honor -s option and hide all non-error output.
>> > > >
>> > > >
>> > > > Is it necessary to add the --quiet option to every script?
>> > > >
>> > > > Kbuild already provides a generic way to suppress the stdout
>> > > > with 'make -s'.
>> > > >
>> > > > The following code works for me.
>> > > > 'make defconfig debug.config' is as verbose as before.
>> > > > 'make -s defconfig debug.config' is really silent.
>> > >
>> > > This is exactly what I'm doing. I'm using -s option and added -q to very
>> > > specific merge_config script, because "-s" is already in use in that
>> > > script.
>> > >
>> > > Before my change on 40384c840ea1 ("Linux 6.13-rc1"):
>> > > [leonro@e534d5fa4327 kernel]$ make -s defconfig debug.config
>> > > Using .config as base
>> > > Merging ./kernel/configs/debug.config
>> > > Value of CONFIG_DYNAMIC_DEBUG is redefined by fragment ./kernel/configs/debug.config:
>> > > Previous value: # CONFIG_DYNAMIC_DEBUG is not set
>> > > New value: CONFIG_DYNAMIC_DEBUG=y
>> > >
>> > > Value of CONFIG_PRINTK_CALLER is redefined by fragment ./kernel/configs/debug.config:
>> > > Previous value: # CONFIG_PRINTK_CALLER is not set
>> > > New value: CONFIG_PRINTK_CALLER=y
>> > > ...
>> > >
>> > > After my change:
>> > > [leonro@4dd2c2078dff kernel]$ make -s defconfig debug.config <--- silent
>> >
>> >
>> > Not sure if you checked the attached code diff in my previous reply.
>> >
>> > To make my question clearer, does this suffice your needs?
>> > https://lore.kernel.org/all/20241208144622.605523-1-masahiroy@kernel.org/T/#u
>>
>> Unfortunately no, as both my development suite and our CI rely on
>> merge_config script to create right config.
>>
>> In CI, they run add very specific config options to already
>> well-established .config.
>> In my development suite, I'm removing extra options with merge_config
>> script.
>>
>>         subprocess.call(cmd + ['defconfig', 'kvm_guest.config', 'nopm.config', 'debug.config'])
>>         subprocess.call(['scripts/kconfig/merge_config.sh', '-y', '-m', '-q',
>>                          '.config', '/plugins/kernel.config'])
>>         subprocess.call(cmd + ['olddefconfig'])
>>
>> https://github.com/Mellanox/mkt/blob/master/plugins/do-build.py#L19
>> https://github.com/Mellanox/mkt/commit/26d7cbd776f508ab506f6d33cfe0e9b0bf44d557
>>
>> I need both chunks, silence make ... and silence merge_config script.
>
>
> You are no longer talking about 'make -s'.

Yes, I killed two birds with one stone.

>
> "> /dev/null" is the standard way to suppress stdout, but you do not use it.
>
> Similarly, subprocess.call() supports stdout=subprocess.DEVNULL
>  https://docs.python.org/3.13/library/subprocess.html#subprocess.call

No problem, will do it.

>
>
>
>
>
>
>
>> Thanks
>>
>> >
>> >
>> > --
>> > Best Regards
>> > Masahiro Yamada
>
>
>
> --
> Best Regards
> Masahiro Yamada

      reply	other threads:[~2024-12-09  8:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03 13:55 [PATCH rdma-next] kbuild: Respect request to silent output when merging configs Leon Romanovsky
2024-12-03 13:59 ` Leon Romanovsky
2024-12-04  8:25 ` Masahiro Yamada
2024-12-04  8:49   ` Leon Romanovsky
2024-12-08 14:49     ` Masahiro Yamada
2024-12-08 16:35       ` Leon Romanovsky
2024-12-09  5:34         ` Masahiro Yamada
2024-12-09  8:43           ` Leon Romanovsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c73891e5-13f6-4ca4-964a-a453a24cd6b8@app.fastmail.com \
    --to=leon@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox