bpf: runqslower: Prefer using local vmlimux to generate vmlinux.h
authorSong Liu <songliubraving@fb.com>
Thu, 25 Feb 2021 23:43:18 +0000 (15:43 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 26 Feb 2021 19:51:48 +0000 (11:51 -0800)
Update the Makefile to prefer using $(O)/vmlinux, $(KBUILD_OUTPUT)/vmlinux
(for selftests) or ../../../vmlinux. These two files should have latest
definitions for vmlinux.h.

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210225234319.336131-6-songliubraving@fb.com
tools/bpf/runqslower/Makefile

index 9d9fb6209be1bf51f7a09a267eb86046a32c686a..c96ba90c6f018e985dc657d6864a74055b1408be 100644 (file)
@@ -16,7 +16,10 @@ 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 $(O),$(O)/vmlinux)           \
+       $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux) \
+       ../../../vmlinux /sys/kernel/btf/vmlinux        \
+       /boot/vmlinux-$(KERNEL_REL)
 VMLINUX_BTF_PATH := $(or $(VMLINUX_BTF),$(firstword                           \
                                          $(wildcard $(VMLINUX_BTF_PATHS))))