[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdmcLCV6J+PYXCugH=0Pt_=yARZ-Y3SEmYy8F+oBpb1UYw@mail.gmail.com>
Date: Tue, 14 Jun 2022 11:59:41 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Michal Marek <michal.lkml@...kovi.net>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] kbuild: remove sed command from cmd_ar_builtin
On Mon, Jun 13, 2022 at 10:53 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> Replace a pipeline of echo and sed with printf to decrease process forks.
If you're trying to minimize process forks, is it possible to remove
the use of xargs as well and just invoke $(AR) with the parameters
splatted out? I don't know myself, but maybe you're creative enough?
Otherwise,
Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> ---
>
> Changes in v2:
> - Avoid the pipeline if there is no object to put in the archive
>
> scripts/Makefile.build | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index cac070aee791..784f46d41959 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -358,9 +358,8 @@ $(subdir-modorder): $(obj)/%/modules.order: $(obj)/% ;
>
> quiet_cmd_ar_builtin = AR $@
> cmd_ar_builtin = rm -f $@; \
> - echo $(patsubst $(obj)/%,%,$(real-prereqs)) | \
> - sed -E 's:([^ ]+):$(obj)/\1:g' | \
> - xargs $(AR) cDPrST $@
> + $(if $(real-prereqs), printf "$(obj)/%s " $(patsubst $(obj)/%,%,$(real-prereqs)) | xargs) \
> + $(AR) cDPrST $@
>
> $(obj)/built-in.a: $(real-obj-y) FORCE
> $(call if_changed,ar_builtin)
> --
> 2.32.0
>
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists