mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 22:34:33 +01:00
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 <[email protected]> Acked-by: Jiri Olsa <[email protected]> Tested-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]>
This commit is contained in:
1 parent
56d5229471
commit
76a97cf2e1
9 files changed
+11
-103
No files matched your search
@@ -58,13 +58,6 @@ FILES= \
|
||||
test-lzma.bin \
|
||||
test-bpf.bin \
|
||||
test-libbpf.bin \
|
||||
test-libbpf-btf__load_from_kernel_by_id.bin \
|
||||
test-libbpf-bpf_prog_load.bin \
|
||||
test-libbpf-bpf_map_create.bin \
|
||||
test-libbpf-bpf_object__next_program.bin \
|
||||
test-libbpf-bpf_object__next_map.bin \
|
||||
test-libbpf-bpf_program__set_insns.bin \
|
||||
test-libbpf-btf__raw_data.bin \
|
||||
test-get_cpuid.bin \
|
||||
test-sdt.bin \
|
||||
test-cxx.bin \
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <bpf/bpf.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return bpf_map_create(0 /* map_type */, NULL /* map_name */, 0, /* key_size */,
|
||||
0 /* value_size */, 0 /* max_entries */, NULL /* opts */);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <bpf/libbpf.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
bpf_object__next_map(NULL /* obj */, NULL /* prev */);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <bpf/libbpf.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
bpf_object__next_program(NULL /* obj */, NULL /* prev */);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <bpf/bpf.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
return bpf_prog_load(0 /* prog_type */, NULL /* prog_name */,
|
||||
NULL /* license */, NULL /* insns */,
|
||||
0 /* insn_cnt */, NULL /* opts */);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <bpf/libbpf.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
bpf_program__set_insns(NULL /* prog */, NULL /* new_insns */, 0 /* new_insn_cnt */);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <bpf/btf.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
btf__load_from_kernel_by_id(20151128);
|
||||
return 0;
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <bpf/btf.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
btf__raw_data(NULL /* btf_ro */, NULL /* size */);
|
||||
return 0;
|
||||
}
|
||||
+11
-39
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user