[RFC PATCH 10/20] tools/build: Add a feature test for bpftool-btf
From: Gabriele Monaco
Date: Mon Aug 31 2026 - 05:14:03 EST
RV can run bpf monitors and also build them, only the latter requires
the vmlinux.h from bpftool btf.
Add a feature so that RV can be built with BPF support without having to
build in-tree BPF monitors if not supported on the system.
Signed-off-by: Gabriele Monaco <gmonaco@xxxxxxxxxx>
---
tools/build/Makefile.feature | 1 +
tools/build/feature/Makefile | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/tools/build/Makefile.feature b/tools/build/Makefile.feature
index 99eb0ea09537..18e3a7ae893a 100644
--- a/tools/build/Makefile.feature
+++ b/tools/build/Makefile.feature
@@ -129,6 +129,7 @@ FEATURE_TESTS_EXTRA := \
libdebuginfod \
clang-bpf-co-re \
bpftool-skeletons \
+ bpftool-btf \
libunwind \
libunwind-debug-frame \
$(foreach arch,$(LIBUNWIND_ARCHS),libunwind-$(arch) libunwind-debug-frame-$(arch))
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 7d165018116a..2f01203dda5c 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -71,7 +71,8 @@ FILES= \
test-libpfm4.bin \
test-rust.bin \
test-libopenssl.bin \
- test-bpftool-skeletons.bin
+ test-bpftool-skeletons.bin \
+ test-bpftool-btf.bin
FILES := $(addprefix $(OUTPUT),$(FILES))
@@ -383,6 +384,10 @@ $(OUTPUT)test-bpftool-skeletons.bin:
{ $(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons'; } \
> $(@:.bin=.make.output) 2>&1 && touch $@
+$(OUTPUT)test-bpftool-btf.bin:
+ $(SYSTEM_BPFTOOL) btf help \
+ > $(@:.bin=.make.output) 2>&1 && touch $@
+
# Testing Rust is special: we don't compile anything, it's enough to check the
# compiler presence. Compiling a test code for this purposes is problematic,
# because Rust will emit a dependency file without any external references,
--
2.55.0