Merge branch 'libbpf: rename btf__get_from_id() and btf__load() APIs, support split...
authorAndrii Nakryiko <andrii@kernel.org>
Fri, 30 Jul 2021 00:03:42 +0000 (17:03 -0700)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 30 Jul 2021 00:24:50 +0000 (17:24 -0700)
commitf309b4ba989d96c192edd0d730d85bc1dd92a64a
tree185f4f21dd1eeacc5048b3ad4884a2ceefa3bef2
parentd36216429ff3e69db4f6ea5e0c86b80010f5f30b
parent211ab78f7658b50ea10c4569be63ca5009fd39b4
Merge branch 'libbpf: rename btf__get_from_id() and btf__load() APIs, support split BTF'

Quentin Monnet says:

====================

As part of the effort to move towards a v1.0 for libbpf [0], this set
improves some confusing function names related to BTF loading from and to
the kernel:

- btf__load() becomes btf__load_into_kernel().
- btf__get_from_id becomes btf__load_from_kernel_by_id().
- A new version btf__load_from_kernel_by_id_split() extends the former to
  add support for split BTF.

The last patch is a trivial change to bpftool to add support for dumping
split BTF objects by referencing them by their id (and not only by their
BTF path).

[0] https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0#btfh-apis

v3:
- Use libbpf_err_ptr() in btf__load_from_kernel_by_id(), ERR_PTR() in
  bpftool's get_map_kv_btf().
- Move the definition of btf__load_from_kernel_by_id() closer to the
  btf__parse() group in btf.h (move the legacy function with it).
- Fix a bug on the return value in libbpf_find_prog_btf_id(), as a new
  patch.
- Move the btf__free() fixes to their own patch.
- Add "Fixes:" tags to relevant patches.

v2:
- Remove deprecation marking of legacy functions (patch 4/6 from v1).
- Make btf__load_from_kernel_by_id{,_split}() return the btf struct, adjust
  surrounding code and call btf__free() when missing.
- Add new functions to v0.5.0 API (and not v0.6.0).
====================

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>