Re: [PATCH v2 bpf-next 3/4] bpf: runqslower: prefer use local KBUILD_OUTPUT/vmlinux or vmlinux

From: Andrii Nakryiko
Date: Wed Jan 27 2021 - 16:24:18 EST


On Tue, Jan 26, 2021 at 1:11 AM Song Liu <songliubraving@xxxxxx> wrote:
>
> Update the Makefile to prefer using KBUILD_OUTPUT/vmlinux (for selftests)
> or ../../../vmlinux. These two files should have latest definitions for
> vmlinux.h.
>
> Signed-off-by: Song Liu <songliubraving@xxxxxx>
> ---
> tools/bpf/runqslower/Makefile | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/bpf/runqslower/Makefile b/tools/bpf/runqslower/Makefile
> index 4d5ca54fcd4c8..1f75c95d4d023 100644
> --- a/tools/bpf/runqslower/Makefile
> +++ b/tools/bpf/runqslower/Makefile
> @@ -19,7 +19,9 @@ CFLAGS := -g -Wall
>
> # Try to detect best kernel BTF source
> KERNEL_REL := $(shell uname -r)
> -VMLINUX_BTF_PATHS := /sys/kernel/btf/vmlinux /boot/vmlinux-$(KERNEL_REL)
> +VMLINUX_BTF_PATHS := $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux) \

O= overrides KBUILD_OUTPUT=, so please handle it first. See
selftests/bpf/Makefile.

> + ../../../vmlinux /sys/kernel/btf/vmlinux \
> + /boot/vmlinux-$(KERNEL_REL)
> VMLINUX_BTF_PATH := $(or $(VMLINUX_BTF),$(firstword \
> $(wildcard $(VMLINUX_BTF_PATHS))))
>
> --
> 2.24.1
>