tools: Replace btf__get_from_id() with btf__load_from_kernel_by_id()
authorQuentin Monnet <quentin@isovalent.com>
Thu, 29 Jul 2021 16:20:25 +0000 (17:20 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 30 Jul 2021 00:23:52 +0000 (17:23 -0700)
commit86f4b7f2578f69284fa782be54e700c42c757897
tree9944eb0e0bfd66dae5ccbe9d91b8c0beed0ace82
parent369e955b3d1c12f6ec2e51a95911bb80ada55d79
tools: Replace btf__get_from_id() with btf__load_from_kernel_by_id()

Replace the calls to function btf__get_from_id(), which we plan to
deprecate before the library reaches v1.0, with calls to
btf__load_from_kernel_by_id() in tools/ (bpftool, perf, selftests).
Update the surrounding code accordingly (instead of passing a pointer to
the btf struct, get it as a return value from the function).

Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20210729162028.29512-6-quentin@isovalent.com
tools/bpf/bpftool/btf.c
tools/bpf/bpftool/btf_dumper.c
tools/bpf/bpftool/map.c
tools/bpf/bpftool/prog.c
tools/perf/util/bpf-event.c
tools/perf/util/bpf_counter.c
tools/testing/selftests/bpf/prog_tests/btf.c