diff options
author | Ian Rogers <[email protected]> | 2023-01-15 17:01:13 -0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2023-03-14 08:29:33 -0300 |
commit | 56d5229471ee1634bd0eb029f1aa82a8d87c6fed (patch) | |
tree | 4ba02d9e51535e9b4be67d044ebeee172bef4661 | |
parent | 17535a33a9c1e4fb52f3db1d72a7ddbe4cea1a2e (diff) |
tools build: Pass libbpf feature only if libbpf 1.0+
libbpf 1.0 represented a cleanup and stabilization of APIs. Simplify
development by only passing the feature test if libbpf 1.0 is installed.
Committer notes:
Change 'make -C tools/perf build-test' so that the LIBBPF_DYNAMIC=1 test
runs only if libbpf is >= 1.0.
Signed-off-by: Ian Rogers <[email protected]>
Tested-by: Jiri Olsa <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: Andrii Nakryiko <[email protected]>
Cc: Christy Lee <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Quentin Monnet <[email protected]>
Cc: Roberto Sassu <[email protected]>
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r-- | tools/build/feature/test-libbpf.c | 4 | ||||
-rw-r--r-- | tools/perf/tests/make | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/tools/build/feature/test-libbpf.c b/tools/build/feature/test-libbpf.c index a508756cf4cc..cd9989f52119 100644 --- a/tools/build/feature/test-libbpf.c +++ b/tools/build/feature/test-libbpf.c @@ -1,6 +1,10 @@ // SPDX-License-Identifier: GPL-2.0 #include <bpf/libbpf.h> +#if !defined(LIBBPF_MAJOR_VERSION) || (LIBBPF_MAJOR_VERSION < 1) +#error At least libbpf 1.0 is required for Linux tools. +#endif + int main(void) { return bpf_object__open("test") ? 0 : -1; diff --git a/tools/perf/tests/make b/tools/perf/tests/make index 009d6efb673c..b4d64fdf4aef 100644 --- a/tools/perf/tests/make +++ b/tools/perf/tests/make @@ -150,7 +150,6 @@ run += make_no_libaudit run += make_no_libbionic run += make_no_auxtrace run += make_no_libbpf -run += make_libbpf_dynamic run += make_no_libbpf_DEBUG run += make_no_libcrypto run += make_no_sdt @@ -176,6 +175,12 @@ run += make_install_prefix_slash # run += make_install_pdf run += make_minimal +old_libbpf := $(shell echo "#include <bpf/libbpf.h>" | $(CC) -E -dM -x c -| egrep -q "define[[:space:]]+LIBBPF_MAJOR_VERSION[[:space:]]+0{1}") + +ifneq ($(old_libbpf),) +run += make_libbpf_dynamic +endif + ifneq ($(call has,ctags),) run += make_tags endif |