bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Jiri Olsa <olsajiri@gmail.com>,
	linux-kbuild@vger.kernel.org,  linux-kernel@vger.kernel.org,
	Nathan Chancellor <nathan@kernel.org>,
	 Nick Desaulniers <ndesaulniers@google.com>,
	Nicolas Schier <nicolas@fjasle.eu>,
	bpf@vger.kernel.org
Subject: Re: [bpf-next PATCH v2 4/4] kbuild: refactor module BTF rule
Date: Fri, 20 Oct 2023 16:03:07 +0900	[thread overview]
Message-ID: <CAK7LNAR2kKwbzdFxfVXDxsy8pfyQDCR-BN=zpbcZg0JS9RpsKQ@mail.gmail.com> (raw)
In-Reply-To: <CAEf4BzZm4h4q6k9ZhuT5qiWC9PYA+c7XwVFd68iAq4mtMJ-qhw@mail.gmail.com>

On Fri, Oct 20, 2023 at 7:55 AM Andrii Nakryiko
<andrii.nakryiko@gmail.com> wrote:
>
> On Thu, Oct 19, 2023 at 1:15 AM Jiri Olsa <olsajiri@gmail.com> wrote:
> >
> > On Thu, Oct 19, 2023 at 12:19:50AM +0900, Masahiro Yamada wrote:
> > > newer_prereqs_except and if_changed_except are ugly hacks of the
> > > newer-prereqs and if_changed in scripts/Kbuild.include.
> > >
> > > Remove.
> > >
> > > Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> > > ---
> > >
> > > Changes in v2:
> > >   - Fix if_changed_except to if_changed
> > >
> > >  scripts/Makefile.modfinal | 25 ++++++-------------------
> > >  1 file changed, 6 insertions(+), 19 deletions(-)
> > >
> > > diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal
> > > index 9fd7a26e4fe9..fc07854bb7b9 100644
> > > --- a/scripts/Makefile.modfinal
> > > +++ b/scripts/Makefile.modfinal
> > > @@ -19,6 +19,9 @@ vmlinux :=
> > >  ifdef CONFIG_DEBUG_INFO_BTF_MODULES
> > >  ifneq ($(wildcard vmlinux),)
> > >  vmlinux := vmlinux
> > > +cmd_btf = ; \
> > > +     LLVM_OBJCOPY="$(OBJCOPY)" $(PAHOLE) -J $(PAHOLE_FLAGS) --btf_base vmlinux $@; \
> > > +     $(RESOLVE_BTFIDS) -b vmlinux $@
> > >  else
> > >  $(warning Skipping BTF generation due to unavailability of vmlinux)
> > >  endif
> > > @@ -41,27 +44,11 @@ quiet_cmd_ld_ko_o = LD [M]  $@
> > >        cmd_ld_ko_o +=                                                 \
> > >       $(LD) -r $(KBUILD_LDFLAGS)                                      \
> > >               $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE)              \
> > > -             -T scripts/module.lds -o $@ $(filter %.o, $^)
> > > +             -T scripts/module.lds -o $@ $(filter %.o, $^)           \
> > > +     $(cmd_btf)
> > >
> > > -quiet_cmd_btf_ko = BTF [M] $@
> >
> > nit not sure it's intentional but we no longer display 'BTF [M] ...ko' lines,
> > I don't mind not displaying that, but we should mention that in changelog
> >
>
> Thanks for spotting this! I think those messages are useful and
> important to keep. Masahiro, is it possible to preserve them?



No, I do not think so.

Your code is wrong.


To clarify this is a fix,
I will replace the commit as follows:




------------------->8----------------------
kbuild: detect btf command change for modules

Currently, the command change in cmd_btf_ko does not cause to rebuild
the modules because it is not passed to if_changed.

Pass everything to if_change so that the btf command is also recorded
in the .*.cmd files. This removes the hacky newer_prereqs_except and
if_changed_except macros too.
------------------->8----------------------




--
Best Regards

Masahiro Yamada

  reply	other threads:[~2023-10-20  7:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 15:19 [bpf-next PATCH v2 1/4] kbuild: remove ARCH_POSTLINK from module builds Masahiro Yamada
2023-10-18 15:19 ` [bpf-next PATCH v2 2/4] kbuild: avoid too many execution of scripts/pahole-flags.sh Masahiro Yamada
2023-10-19  8:47   ` Jiri Olsa
2023-10-23  0:33   ` Martin Rodriguez Reboredo
2023-10-18 15:19 ` [bpf-next PATCH v2 3/4] kbuild: skip module BTF with one-time check for vmlinux Masahiro Yamada
2023-10-19  8:17   ` Jiri Olsa
2023-10-18 15:19 ` [bpf-next PATCH v2 4/4] kbuild: refactor module BTF rule Masahiro Yamada
2023-10-18 15:49   ` Nicolas Schier
2023-10-19  8:15   ` Jiri Olsa
2023-10-19 22:54     ` Andrii Nakryiko
2023-10-20  7:03       ` Masahiro Yamada [this message]
2023-10-20 20:51         ` Andrii Nakryiko
2023-10-21 11:37           ` Masahiro Yamada
2023-10-21 19:33             ` Andrii Nakryiko
2023-10-22 20:23               ` Masahiro Yamada
2023-10-23  3:19                 ` Andrii Nakryiko
2023-10-28 12:00                   ` Masahiro Yamada
2023-10-28 13:36                     ` Jiri Olsa
2023-10-31 18:44                       ` Andrii Nakryiko

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='CAK7LNAR2kKwbzdFxfVXDxsy8pfyQDCR-BN=zpbcZg0JS9RpsKQ@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=andrii.nakryiko@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=olsajiri@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).