diff mbox series

[bpf-next,3/6] bpftool: Use $(OUTPUT) and not $(O) for VMLINUX_BTF_PATHS in Makefile

Message ID 20211110114632.24537-4-quentin@isovalent.com (mailing list archive)
State Rejected
Delegated to: BPF
Headers show
Series bpftool: miscellaneous fixes | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 6 maintainers not CCed: songliubraving@fb.com john.fastabend@gmail.com yhs@fb.com jean-philippe@linaro.org kpsingh@kernel.org kafai@fb.com
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next success VM_Test

Commit Message

Quentin Monnet Nov. 10, 2021, 11:46 a.m. UTC
The Makefile for bpftool relies on $(OUTPUT), and not on $(O), for
passing the output directory. So $(VMLINUX_BTF_PATHS), used for
searching for kernel BTF info, should use the same variable.

Fixes: 05aca6da3b5a ("tools/bpftool: Generalize BPF skeleton support and generate vmlinux.h")
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
---
 tools/bpf/bpftool/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrii Nakryiko Nov. 11, 2021, 6:59 p.m. UTC | #1
On Wed, Nov 10, 2021 at 3:46 AM Quentin Monnet <quentin@isovalent.com> wrote:
>
> The Makefile for bpftool relies on $(OUTPUT), and not on $(O), for
> passing the output directory. So $(VMLINUX_BTF_PATHS), used for
> searching for kernel BTF info, should use the same variable.
>
> Fixes: 05aca6da3b5a ("tools/bpftool: Generalize BPF skeleton support and generate vmlinux.h")
> Signed-off-by: Quentin Monnet <quentin@isovalent.com>
> ---
>  tools/bpf/bpftool/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> index 2a846cb92120..40abf50b59d4 100644
> --- a/tools/bpf/bpftool/Makefile
> +++ b/tools/bpf/bpftool/Makefile
> @@ -150,7 +150,7 @@ $(BOOTSTRAP_OBJS): $(LIBBPF_BOOTSTRAP)
>  OBJS = $(patsubst %.c,$(OUTPUT)%.o,$(SRCS)) $(OUTPUT)disasm.o
>  $(OBJS): $(LIBBPF) $(LIBBPF_INTERNAL_HDRS)
>
> -VMLINUX_BTF_PATHS ?= $(if $(O),$(O)/vmlinux)                           \
> +VMLINUX_BTF_PATHS ?= $(if $(OUTPUT),$(OUTPUT)/vmlinux)                 \
>                      $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux)    \

But you still check KBUILD_OUTPUT? O overrides KBUILD_OUTPUT as far as
kernel build goes. So if you still support KBUILD_OUTPUT, you should
support O. And the $(OUTPUT) seems to be completely unrelated, as that
defines the output of bpftool build files, not the vmlinux image. Or
am I missing something?

>                      ../../../vmlinux                                   \
>                      /sys/kernel/btf/vmlinux                            \
> --
> 2.32.0
>
Quentin Monnet Nov. 11, 2021, 11:39 p.m. UTC | #2
On Thu, 11 Nov 2021 at 18:59, Andrii Nakryiko <andrii.nakryiko@gmail.com> wrote:
>
> On Wed, Nov 10, 2021 at 3:46 AM Quentin Monnet <quentin@isovalent.com> wrote:
> >
> > The Makefile for bpftool relies on $(OUTPUT), and not on $(O), for
> > passing the output directory. So $(VMLINUX_BTF_PATHS), used for
> > searching for kernel BTF info, should use the same variable.
> >
> > Fixes: 05aca6da3b5a ("tools/bpftool: Generalize BPF skeleton support and generate vmlinux.h")
> > Signed-off-by: Quentin Monnet <quentin@isovalent.com>
> > ---
> >  tools/bpf/bpftool/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> > index 2a846cb92120..40abf50b59d4 100644
> > --- a/tools/bpf/bpftool/Makefile
> > +++ b/tools/bpf/bpftool/Makefile
> > @@ -150,7 +150,7 @@ $(BOOTSTRAP_OBJS): $(LIBBPF_BOOTSTRAP)
> >  OBJS = $(patsubst %.c,$(OUTPUT)%.o,$(SRCS)) $(OUTPUT)disasm.o
> >  $(OBJS): $(LIBBPF) $(LIBBPF_INTERNAL_HDRS)
> >
> > -VMLINUX_BTF_PATHS ?= $(if $(O),$(O)/vmlinux)                           \
> > +VMLINUX_BTF_PATHS ?= $(if $(OUTPUT),$(OUTPUT)/vmlinux)                 \
> >                      $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux)    \
>
> But you still check KBUILD_OUTPUT? O overrides KBUILD_OUTPUT as far as
> kernel build goes. So if you still support KBUILD_OUTPUT, you should
> support O. And the $(OUTPUT) seems to be completely unrelated, as that
> defines the output of bpftool build files, not the vmlinux image. Or
> am I missing something?

OK, I think I'm the one who missed the point. I simply figured we
meant to search the output directory, and that it should be $(OUTPUT)
like everywhere else in the Makefile. But from what I understand now,
it's not the case. Let's drop this patch.

If the rest of the set looks good to you, can you just skip this
patch, or do you prefer me to send a v2?

Quentin
Andrii Nakryiko Nov. 12, 2021, 1:52 a.m. UTC | #3
On Thu, Nov 11, 2021 at 3:39 PM Quentin Monnet <quentin@isovalent.com> wrote:
>
> On Thu, 11 Nov 2021 at 18:59, Andrii Nakryiko <andrii.nakryiko@gmail.com> wrote:
> >
> > On Wed, Nov 10, 2021 at 3:46 AM Quentin Monnet <quentin@isovalent.com> wrote:
> > >
> > > The Makefile for bpftool relies on $(OUTPUT), and not on $(O), for
> > > passing the output directory. So $(VMLINUX_BTF_PATHS), used for
> > > searching for kernel BTF info, should use the same variable.
> > >
> > > Fixes: 05aca6da3b5a ("tools/bpftool: Generalize BPF skeleton support and generate vmlinux.h")
> > > Signed-off-by: Quentin Monnet <quentin@isovalent.com>
> > > ---
> > >  tools/bpf/bpftool/Makefile | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> > > index 2a846cb92120..40abf50b59d4 100644
> > > --- a/tools/bpf/bpftool/Makefile
> > > +++ b/tools/bpf/bpftool/Makefile
> > > @@ -150,7 +150,7 @@ $(BOOTSTRAP_OBJS): $(LIBBPF_BOOTSTRAP)
> > >  OBJS = $(patsubst %.c,$(OUTPUT)%.o,$(SRCS)) $(OUTPUT)disasm.o
> > >  $(OBJS): $(LIBBPF) $(LIBBPF_INTERNAL_HDRS)
> > >
> > > -VMLINUX_BTF_PATHS ?= $(if $(O),$(O)/vmlinux)                           \
> > > +VMLINUX_BTF_PATHS ?= $(if $(OUTPUT),$(OUTPUT)/vmlinux)                 \
> > >                      $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux)    \
> >
> > But you still check KBUILD_OUTPUT? O overrides KBUILD_OUTPUT as far as
> > kernel build goes. So if you still support KBUILD_OUTPUT, you should
> > support O. And the $(OUTPUT) seems to be completely unrelated, as that
> > defines the output of bpftool build files, not the vmlinux image. Or
> > am I missing something?
>
> OK, I think I'm the one who missed the point. I simply figured we
> meant to search the output directory, and that it should be $(OUTPUT)
> like everywhere else in the Makefile. But from what I understand now,
> it's not the case. Let's drop this patch.
>
> If the rest of the set looks good to you, can you just skip this
> patch, or do you prefer me to send a v2?
>

I can just drop it when applying.

> Quentin
diff mbox series

Patch

diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 2a846cb92120..40abf50b59d4 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -150,7 +150,7 @@  $(BOOTSTRAP_OBJS): $(LIBBPF_BOOTSTRAP)
 OBJS = $(patsubst %.c,$(OUTPUT)%.o,$(SRCS)) $(OUTPUT)disasm.o
 $(OBJS): $(LIBBPF) $(LIBBPF_INTERNAL_HDRS)
 
-VMLINUX_BTF_PATHS ?= $(if $(O),$(O)/vmlinux)				\
+VMLINUX_BTF_PATHS ?= $(if $(OUTPUT),$(OUTPUT)/vmlinux)			\
 		     $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux)	\
 		     ../../../vmlinux					\
 		     /sys/kernel/btf/vmlinux				\