@@ -56,7 +56,8 @@ FEATURE_TESTS_BASIC := \
zlib \
lzma \
get_cpuid \
- bpf
+ bpf \
+ ubpf
# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
# of all feature tests
@@ -96,7 +97,8 @@ FEATURE_DISPLAY ?= \
zlib \
lzma \
get_cpuid \
- bpf
+ bpf \
+ ubpf
# Set FEATURE_CHECK_(C|LD)FLAGS-all for all FEATURE_TESTS features.
# If in the future we need per-feature checks/flags for features not
@@ -37,7 +37,8 @@ FILES= \
test-zlib.bin \
test-lzma.bin \
test-bpf.bin \
- test-get_cpuid.bin
+ test-get_cpuid.bin \
+ test-ubpf.bin
FILES := $(addprefix $(OUTPUT),$(FILES))
@@ -182,6 +183,9 @@ $(OUTPUT)test-get_cpuid.bin:
$(OUTPUT)test-bpf.bin:
$(BUILD)
+$(OUTPUT)test-ubpf.bin:
+ $(BUILD) -lubpf
+
-include $(OUTPUT)*.d
###############################
new file mode 100644
@@ -0,0 +1,11 @@
+#include <stdlib.h>
+#include <ubpf.h>
+
+int main(void)
+{
+ struct ubpf_vm *vm;
+
+ vm = ubpf_create();
+ ubpf_destroy(vm);
+ return 0;
+}
@@ -65,8 +65,8 @@ ifndef VERBOSE
endif
FEATURE_USER = .libbpf
-FEATURE_TESTS = libelf libelf-getphdrnum libelf-mmap bpf
-FEATURE_DISPLAY = libelf bpf
+FEATURE_TESTS = libelf libelf-getphdrnum libelf-mmap bpf ubpf
+FEATURE_DISPLAY = libelf bpf ubpf
INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/arch/$(ARCH)/include/uapi -I$(srctree)/include/uapi
FEATURE_CHECK_CFLAGS-bpf = $(INCLUDES)
Add test-ubpf.c to find libubpf, which can be found from [1]. ubpf is user space BPF engine. Following commits will utilize ubpf to make perf dynamically run some profiling scripts in user space. [1] https://github.com/iovisor/ubpf.git Signed-off-by: Wang Nan <wangnan0@huawei.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Brendan Gregg <brendan.d.gregg@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Li Zefan <lizefan@huawei.com> --- tools/build/Makefile.feature | 6 ++++-- tools/build/feature/Makefile | 6 +++++- tools/build/feature/test-ubpf.c | 11 +++++++++++ tools/lib/bpf/Makefile | 4 ++-- 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 tools/build/feature/test-ubpf.c -- 1.8.3.4