summaryrefslogtreecommitdiff
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/Makefile.config5
-rw-r--r--tools/perf/util/bpf-event.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 046e10f65ae7..a7a80e2280bd 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -581,6 +581,10 @@ ifndef NO_LIBELF
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
else
dummy := $(error Error: No libbpf devel library found, please install libbpf-devel);
endif
@@ -588,6 +592,7 @@ ifndef NO_LIBELF
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
endif
endif
diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c
index c68d88ca1ece..91c4c5dcab7f 100644
--- a/tools/perf/util/bpf-event.c
+++ b/tools/perf/util/bpf-event.c
@@ -61,7 +61,8 @@ bpf_object__next_program(const struct bpf_object *obj, struct bpf_program *prev)
}
#endif
-struct bpf_map * __weak
+#ifndef HAVE_LIBBPF_BPF_OBJECT__NEXT_MAP
+struct bpf_map *
bpf_object__next_map(const struct bpf_object *obj, const struct bpf_map *prev)
{
#pragma GCC diagnostic push
@@ -69,6 +70,7 @@ bpf_object__next_map(const struct bpf_object *obj, const struct bpf_map *prev)
return bpf_map__next(prev, obj);
#pragma GCC diagnostic pop
}
+#endif
const void * __weak
btf__raw_data(const struct btf *btf_ro, __u32 *size)