mbox series

[bpf-next,0/3] bpftool: improve split BTF support

Message ID 20201202065244.530571-1-andrii@kernel.org (mailing list archive)
Headers show
Series bpftool: improve split BTF support | expand

Message

Andrii Nakryiko Dec. 2, 2020, 6:52 a.m. UTC
Few follow up improvements to bpftool for split BTF support:
  - emit "name <anon>" for non-named BTFs in `bpftool btf show` command;
  - when dumping /sys/kernel/btf/<module> use /sys/kernel/btf/vmlinux as the
    base BTF, unless base BTF is explicitly specified with -B flag.

This patch set also adds btf__base_btf() getter to access base BTF of the
struct btf.

Andrii Nakryiko (3):
  tools/bpftool: emit name <anon> for anonymous BTFs
  libbpf: add base BTF accessor
  tools/bpftool: auto-detect split BTFs in common cases

 tools/bpf/bpftool/btf.c  | 27 +++++++++++++++++++++++----
 tools/lib/bpf/btf.c      |  5 +++++
 tools/lib/bpf/btf.h      |  1 +
 tools/lib/bpf/libbpf.map |  1 +
 4 files changed, 30 insertions(+), 4 deletions(-)

Comments

Alexei Starovoitov Dec. 3, 2020, 6:31 p.m. UTC | #1
On Tue, Dec 01, 2020 at 10:52:40PM -0800, Andrii Nakryiko wrote:
> Few follow up improvements to bpftool for split BTF support:
>   - emit "name <anon>" for non-named BTFs in `bpftool btf show` command;
>   - when dumping /sys/kernel/btf/<module> use /sys/kernel/btf/vmlinux as the
>     base BTF, unless base BTF is explicitly specified with -B flag.
> 
> This patch set also adds btf__base_btf() getter to access base BTF of the
> struct btf.

Applied, Thanks