]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'btf_get_next_id'
authorAlexei Starovoitov <ast@kernel.org>
Tue, 20 Aug 2019 16:51:07 +0000 (09:51 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 20 Aug 2019 16:51:07 +0000 (09:51 -0700)
commitc460c54ce1da4a632954af6d661e49d4c660747d
tree30a08257f3e2b40204d52143a4219d022675a82e
parentf52773555a26da86c5e283ec15aaef1de35b3654
parentdc9db49b0bd104f3a79aa1a5e7770fd76a3aaa92
Merge branch 'btf_get_next_id'

Quentin Monnet says:

====================
This set adds a new command BPF_BTF_GET_NEXT_ID to the bpf() system call,
adds the relevant API function in libbpf, and uses it in bpftool to list
all BTF objects loaded on the system (and to dump the ids of maps and
programs associated with them, if any).

The main motivation of listing BTF objects is introspection and debugging
purposes. By getting BPF program and map information, it should already be
possible to list all BTF objects associated to at least one map or one
program. But there may be unattached BTF objects, held by a file descriptor
from a user space process only, and we may want to list them too.

As a side note, it also turned useful for examining the BTF objects
attached to offloaded programs, which would not show in program information
because the BTF id is not copied when retrieving such info. A fix is in
progress on that side.

v2:
- Rebase patch with new libbpf function on top of Andrii's changes
  regarding libbpf versioning.
====================

Signed-off-by: Alexei Starovoitov <ast@kernel.org>