Commit bfe42797 authored by Toke Høiland-Jørgensen's avatar Toke Høiland-Jørgensen Committed by Alexei Starovoitov
Browse files

selftests: Pass VMLINUX_BTF to runqslower Makefile



Add a VMLINUX_BTF variable with the locally-built path when calling the
runqslower Makefile from selftests. This makes sure a simple 'make'
invocation in the selftests dir works even when there is no BTF information
for the running kernel. Do a wildcard expansion and include the same paths
for BTF for the running kernel as in the runqslower Makefile, to make it
possible to build selftests without having a vmlinux in the local tree.

Also fix the make invocation to use $(OUTPUT)/tools as the destination
directory instead of $(CURDIR)/tools.

Fixes: 3a0d3092 ("selftests/bpf: Build runqslower from selftests")
Signed-off-by: default avatarToke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Acked-by: default avatarAndrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/157952560344.1683545.2723631988771664417.stgit@toke.dk
parent a835d38d
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -124,10 +124,14 @@ $(OUTPUT)/test_stub.o: test_stub.c
	$(call msg,CC,,$@)
	$(CC) -c $(CFLAGS) -o $@ $<

VMLINUX_BTF_PATHS := $(abspath ../../../../vmlinux)			\
			       /sys/kernel/btf/vmlinux			\
			       /boot/vmlinux-$(shell uname -r)
VMLINUX_BTF:= $(firstword $(wildcard $(VMLINUX_BTF_PATHS)))
.PHONY: $(OUTPUT)/runqslower
$(OUTPUT)/runqslower: force
	$(Q)$(MAKE) $(submake_extras) -C $(TOOLSDIR)/bpf/runqslower	\
		    OUTPUT=$(CURDIR)/tools/
		    OUTPUT=$(OUTPUT)/tools/ VMLINUX_BTF=$(VMLINUX_BTF)

BPFOBJ := $(OUTPUT)/libbpf.a