diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2021-09-14 19:00:04 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2021-09-15 23:06:08 +0200 |
commit | 00e0ca3721cf2ddcb38cf676a3de61933640d31d (patch) | |
tree | fddd8d3c2d5994eb9f052b52bdff4a24fde88375 /tools/perf/util/bpf-event.c | |
parent | perf bpf: Deprecate bpf_map__resize() in favor of bpf_map_set_max_entries() (diff) | |
download | linux-00e0ca3721cf2ddcb38cf676a3de61933640d31d.tar.xz linux-00e0ca3721cf2ddcb38cf676a3de61933640d31d.zip |
perf bpf: Ignore deprecation warning when using libbpf's btf__get_from_id()
Perf code re-implements libbpf's btf__load_from_kernel_by_id() API as
a weak function, presumably to dynamically link against old version of
libbpf shared library. Unfortunately this causes compilation warning
when perf is compiled against libbpf v0.6+.
For now, just ignore deprecation warning, but there might be a better
solution, depending on perf's needs.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: kernel-team@fb.com
LPU-Reference: 20210914170004.4185659-1-andrii@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/bpf-event.c')
-rw-r--r-- | tools/perf/util/bpf-event.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c index 683f6d63560e..1a7112a87736 100644 --- a/tools/perf/util/bpf-event.c +++ b/tools/perf/util/bpf-event.c @@ -24,7 +24,10 @@ struct btf * __weak btf__load_from_kernel_by_id(__u32 id) { struct btf *btf; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" int err = btf__get_from_id(id, &btf); +#pragma GCC diagnostic pop return err ? ERR_PTR(err) : btf; } |