summaryrefslogtreecommitdiff
path: root/tools/perf/Makefile.config
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2023-01-16 04:01:14 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-03-14 14:29:45 +0300
commit76a97cf2e169851ff8e3fd9d27028168eff81e37 (patch)
tree280bd94d29a2fc63f355cdc19385984084f58d8b /tools/perf/Makefile.config
parent56d5229471ee1634bd0eb029f1aa82a8d87c6fed (diff)
downloadlinux-76a97cf2e169851ff8e3fd9d27028168eff81e37.tar.xz
perf build: Remove libbpf pre-1.0 feature tests
The feature tests were necessary for libbpf pre-1.0, but as the libbpf implies at least 1.0 we can remove these now. Committer notes: Modified tools/perf/Makefile.config to better reflect the reason for failure when the libbpf present is < 1.0 and LIBBPF_DYNAMIC=1 was asked for. Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Jiri Olsa <jolsa@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andres Freund <andres@anarazel.de> Cc: Andrii Nakryiko <andrii@kernel.org> Cc: Christy Lee <christylee@fb.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Quentin Monnet <quentin@isovalent.com> Cc: Roberto Sassu <roberto.sassu@huawei.com> Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230116010115.490713-2-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/Makefile.config')
-rw-r--r--tools/perf/Makefile.config50
1 files changed, 11 insertions, 39 deletions
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 3519a0139026..b715cd4f43f4 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -565,54 +565,26 @@ ifndef NO_LIBELF
# detecting libbpf without LIBBPF_DYNAMIC, so make VF=1 shows libbpf detection status
$(call feature_check,libbpf)
+
+ # Feature test requires libbpf 1.0 so we can assume the following:
+ CFLAGS += -DHAVE_LIBBPF_BTF__LOAD_FROM_KERNEL_BY_ID
+ CFLAGS += -DHAVE_LIBBPF_BPF_PROG_LOAD
+ CFLAGS += -DHAVE_LIBBPF_BPF_OBJECT__NEXT_PROGRAM
+ CFLAGS += -DHAVE_LIBBPF_BPF_OBJECT__NEXT_MAP
+ CFLAGS += -DHAVE_LIBBPF_BPF_PROGRAM__SET_INSNS
+ CFLAGS += -DHAVE_LIBBPF_BTF__RAW_DATA
+ CFLAGS += -DHAVE_LIBBPF_BPF_MAP_CREATE
+
ifdef LIBBPF_DYNAMIC
ifeq ($(feature-libbpf), 1)
EXTLIBS += -lbpf
$(call detected,CONFIG_LIBBPF_DYNAMIC)
-
- $(call feature_check,libbpf-btf__load_from_kernel_by_id)
- ifeq ($(feature-libbpf-btf__load_from_kernel_by_id), 1)
- CFLAGS += -DHAVE_LIBBPF_BTF__LOAD_FROM_KERNEL_BY_ID
- endif
- $(call feature_check,libbpf-bpf_prog_load)
- ifeq ($(feature-libbpf-bpf_prog_load), 1)
- CFLAGS += -DHAVE_LIBBPF_BPF_PROG_LOAD
- endif
- $(call feature_check,libbpf-bpf_object__next_program)
- ifeq ($(feature-libbpf-bpf_object__next_program), 1)
- CFLAGS += -DHAVE_LIBBPF_BPF_OBJECT__NEXT_PROGRAM
- endif
- $(call feature_check,libbpf-bpf_object__next_map)
- ifeq ($(feature-libbpf-bpf_object__next_map), 1)
- CFLAGS += -DHAVE_LIBBPF_BPF_OBJECT__NEXT_MAP
- endif
- $(call feature_check,libbpf-bpf_program__set_insns)
- ifeq ($(feature-libbpf-bpf_program__set_insns), 1)
- CFLAGS += -DHAVE_LIBBPF_BPF_PROGRAM__SET_INSNS
- else
- dummy := $(error Error: libbpf devel library needs to be >= 0.8.0 to build with LIBBPF_DYNAMIC, update or build statically with the version that comes with the kernel sources);
- endif
- $(call feature_check,libbpf-btf__raw_data)
- ifeq ($(feature-libbpf-btf__raw_data), 1)
- CFLAGS += -DHAVE_LIBBPF_BTF__RAW_DATA
- endif
- $(call feature_check,libbpf-bpf_map_create)
- ifeq ($(feature-libbpf-bpf_map_create), 1)
- CFLAGS += -DHAVE_LIBBPF_BPF_MAP_CREATE
- endif
else
- dummy := $(error Error: No libbpf devel library found, please install libbpf-devel);
+ dummy := $(error Error: No libbpf devel library found or older than v1.0, please install/update libbpf-devel);
endif
else
# Libbpf will be built as a static library from tools/lib/bpf.
LIBBPF_STATIC := 1
- CFLAGS += -DHAVE_LIBBPF_BTF__LOAD_FROM_KERNEL_BY_ID
- CFLAGS += -DHAVE_LIBBPF_BPF_PROG_LOAD
- CFLAGS += -DHAVE_LIBBPF_BPF_OBJECT__NEXT_PROGRAM
- CFLAGS += -DHAVE_LIBBPF_BPF_OBJECT__NEXT_MAP
- CFLAGS += -DHAVE_LIBBPF_BPF_PROGRAM__SET_INSNS
- CFLAGS += -DHAVE_LIBBPF_BTF__RAW_DATA
- CFLAGS += -DHAVE_LIBBPF_BPF_MAP_CREATE
endif
endif