bpftool: Add support for subskeletons
authorDelyan Kratunov <delyank@fb.com>
Wed, 16 Mar 2022 23:37:28 +0000 (23:37 +0000)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 18 Mar 2022 06:12:39 +0000 (23:12 -0700)
commit00389c58ffe993782a8ba4bb5a34a102b1f6fe24
tree0ffa1555b105f3f55fa2187075c9eaf460bf6784
parent430025e5dca5ad8902e7c3092b7c975acae154c5
bpftool: Add support for subskeletons

Subskeletons are headers which require an already loaded program to
operate.

For example, when a BPF library is linked into a larger BPF object file,
the library userspace needs a way to access its own global variables
without requiring knowledge about the larger program at build time.

As a result, subskeletons require a loaded bpf_object to open().
Further, they find their own symbols in the larger program by
walking BTF type data at run time.

At this time, programs, maps, and globals are supported through
non-owning pointers.

Signed-off-by: Delyan Kratunov <delyank@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/ca8a48b4841c72d285ecce82371bef4a899756cb.1647473511.git.delyank@fb.com
tools/bpf/bpftool/Documentation/bpftool-gen.rst
tools/bpf/bpftool/bash-completion/bpftool
tools/bpf/bpftool/gen.c