]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: Switch to libbpf's hashmap for programs/maps in BTF listing
authorQuentin Monnet <quentin@isovalent.com>
Sat, 23 Oct 2021 20:51:53 +0000 (21:51 +0100)
committerAndrii Nakryiko <andrii@kernel.org>
Tue, 26 Oct 2021 00:31:39 +0000 (17:31 -0700)
commitd46c449b41c08bf5a94698139b6a4f6d143ac1a1
treee8c565cc5d3daebca3f065a1e82e5ce4f4568f20
parentff4de3bd9024be75a228a26902c94d354e8e5d55
bpftool: Switch to libbpf's hashmap for programs/maps in BTF listing

In order to show BPF programs and maps using BTF objects when the latter
are being listed, bpftool creates hash maps to store all relevant items.
This commit is part of a set that transitions from the kernel's hash map
implementation to the one coming with libbpf.

The motivation is to make bpftool less dependent of kernel headers, to
ease the path to a potential out-of-tree mirror, like libbpf has.

This commit focuses on the two hash maps used by bpftool when listing
BTF objects to store references to programs and maps, and convert them
to the libbpf's implementation.

Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20211023205154.6710-5-quentin@isovalent.com
tools/bpf/bpftool/btf.c
tools/bpf/bpftool/main.h