mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Larsson <andreas@gaisler.com>
To: Mikko Rapeli <mikko.rapeli@linaro.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nsc@kernel.org>,
	Anders Roxell <anders.roxell@linaro.org>,
	linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] scripts: kconfig: merge_config.sh: refactor from shell/sed/grep to awk
Date: Mon, 9 Mar 2026 17:38:58 +0100	[thread overview]
Message-ID: <acb36651-449a-43e4-afe2-ba42a435cbb0@gaisler.com> (raw)
In-Reply-To: <20260122105751.2186609-1-mikko.rapeli@linaro.org>

On 2026-01-22 11:57, Mikko Rapeli wrote:
> From: Anders Roxell <anders.roxell@linaro.org>
> 
> merge_config.sh shell/sed/grep loop scales poorly and is slow.
> With Yocto genericarm64 kernel and around 190 config fragments
> the script takes more than 20 minutes to run on a fast build machine.
> Re-implementation with awk does the same job in 10 seconds.
> Using awk since it is likely available in the build environments
> and using perl, python etc would introduce more complex runtime
> dependencies. awk is good enough and lot better than shell/sed/grep.
> 
> Output stays the same but changed execution time means that
> parallel job output may be ordered differently.
> 
> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> ---
>  scripts/kconfig/merge_config.sh | 168 ++++++++++++++++++++++++--------
>  1 file changed, 128 insertions(+), 40 deletions(-)

Hi,

Commit 5fa9b82cbcfc ("scripts: kconfig: merge_config.sh: refactor from
shell/sed/grep to awk") breaks merge_config.sh for me:

---------->%----------
$ make tiny.config
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
The base file '.config' does not exist. Creating one...
Using .config as base
Merging ./kernel/configs/tiny.config
awk: cannot open ./.tmp.config.U9SROCKTBj.new (No such file or directory)
mv: cannot stat './.tmp.config.U9SROCKTBj.new': No such file or directory
make[2]: *** [scripts/kconfig/Makefile:112: tiny.config] Error 1
make[1]: *** [<kernel-source-top-dir>/Makefile:744: tiny.config] Error 2
make: *** [Makefile:248: __sub-make] Error 2
---------->%----------

with this underlying call to merge_config.sh, an empty .config and where
my awk is GNU Awk 5.1.0:

---------->%----------
$ make tiny.config V=1
make --no-print-directory -C <kernel-source-top-dir> \
-f <kernel-source-top-dir>/Makefile tiny.config
make -f ./scripts/Makefile.build obj=scripts/basic
make -f ./scripts/Makefile.build obj=scripts/kconfig tiny.config
# cmd_merge_fragments tiny.config
  ./scripts/kconfig/merge_config.sh -m .config ./kernel/configs/tiny.config ./arch/x86/configs/tiny.config
...

$ awk --version
GNU Awk 5.1.0, API: 3.0 (GNU MPFR 4.1.0, GNU MP 6.2.1)
---------->%----------

At 5fa9b82cbcfc~ things works as expected.

Cheers,
Andreas


  parent reply	other threads:[~2026-03-09 16:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-22 10:57 Mikko Rapeli
2026-01-22 10:57 ` [PATCH v3 2/3] scripts: kconfig: merge_config.sh: use awk in checks too Mikko Rapeli
2026-01-22 10:57 ` [PATCH v3 3/3] scripts: kconfig: merge_config.sh: warn on duplicate input files Mikko Rapeli
2026-01-30  0:10 ` [PATCH v3 1/3] scripts: kconfig: merge_config.sh: refactor from shell/sed/grep to awk Nathan Chancellor
2026-03-09 16:38 ` Andreas Larsson [this message]
2026-03-09 17:09   ` Nathan Chancellor
2026-03-10  7:50     ` Mikko Rapeli
2026-03-10  9:55       ` Andreas Larsson
2026-03-10 10:01         ` Mikko Rapeli
2026-03-10 10:25           ` Andreas Larsson

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=acb36651-449a-43e4-afe2-ba42a435cbb0@gaisler.com \
    --to=andreas@gaisler.com \
    --cc=anders.roxell@linaro.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikko.rapeli@linaro.org \
    --cc=nathan@kernel.org \
    --cc=nsc@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

all inboxes | Powered by JetHome®