Skip to content

Commit 219d720

Browse files
anakryikoacmel
authored andcommitted
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 <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: [email protected] LPU-Reference: [email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent aba5dae commit 219d720

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/perf/util/bpf-event.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424
struct btf * __weak btf__load_from_kernel_by_id(__u32 id)
2525
{
2626
struct btf *btf;
27+
#pragma GCC diagnostic push
28+
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2729
int err = btf__get_from_id(id, &btf);
30+
#pragma GCC diagnostic pop
2831

2932
return err ? ERR_PTR(err) : btf;
3033
}

0 commit comments

Comments
 (0)