diff options
author | 2021-11-01 15:43:55 -0700 | |
---|---|---|
committer | 2021-11-03 11:25:32 -0700 | |
commit | c59765cfd193382b00454b1a4424cb78d4c065e2 (patch) | |
tree | c08e469e99d51288789eedaf3e2400f4663de90a /tools/lib/bpf | |
parent | bpftool: Migrate -1 err checks of libbpf fn calls (diff) | |
download | linux-dev-c59765cfd193382b00454b1a4424cb78d4c065e2.tar.xz linux-dev-c59765cfd193382b00454b1a4424cb78d4c065e2.zip |
bpftool: Use bpf_obj_get_info_by_fd directly
To prepare for impending deprecation of libbpf's
bpf_program__get_prog_info_linear, migrate uses of this function to use
bpf_obj_get_info_by_fd.
Since the profile_target_name and dump_prog_id_as_func_ptr helpers were
only looking at the first func_info, avoid grabbing the rest to save a
malloc. For do_dump, add a more full-featured helper, but avoid
free/realloc of buffer when possible for multi-prog dumps.
Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20211101224357.2651181-3-davemarchevsky@fb.com
Diffstat (limited to 'tools/lib/bpf')
0 files changed, 0 insertions, 0 deletions