[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEf4BzaTyaD4Mz_tVc9WbP9Qv+oAmQNsG--OPwJCJf51xrFK7w@mail.gmail.com>
Date: Mon, 9 Nov 2020 09:58:28 -0800
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: Alan Maguire <alan.maguire@...cle.com>
Cc: Andrii Nakryiko <andrii@...nel.org>, bpf <bpf@...r.kernel.org>,
Networking <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...com>,
Daniel Borkmann <daniel@...earbox.net>,
Kernel Team <kernel-team@...com>,
open list <linux-kernel@...r.kernel.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Jessica Yu <jeyu@...nel.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH bpf-next 5/5] tools/bpftool: add support for in-kernel and
named BTF in `btf show`
On Mon, Nov 9, 2020 at 8:43 AM Alan Maguire <alan.maguire@...cle.com> wrote:
>
> On Thu, 5 Nov 2020, Andrii Nakryiko wrote:
>
> > Display vmlinux BTF name and kernel module names when listing available BTFs
> > on the system.
> >
> > In human-readable output mode, module BTFs are reported with "name
> > [module-name]", while vmlinux BTF will be reported as "name [vmlinux]".
> > Square brackets are added by bpftool and follow kernel convention when
> > displaying modules in human-readable text outputs.
> >
>
> I had a go at testing this and all looks good, but I was curious
> if "bpftool btf dump" is expected to work with module BTF? I see
> the various modules in /sys/kernel/btf, but if I run:
>
> # bpftool btf dump file /sys/kernel/btf/ixgbe
You need to specify vmlinux as a base BTF. There is a -B flag for
that, added in [0]. So just add -B /sys/kernel/btf/vmlinux. I think we
might want to teach bpftool to do this automatically if we see that
file points at module BTF in /sys/kernel/btf, as a convenience
feature.
[0] https://patchwork.kernel.org/project/netdevbpf/patch/20201105043402.2530976-12-andrii@kernel.org/
> Error: failed to load BTF from /sys/kernel/btf/ixgbe: Invalid argument
>
> ...while it still works for vmlinux:
>
> # bpftool btf dump file /sys/kernel/btf/vmlinux
> [1] INT '(anon)' size=4 bits_offset=0 nr_bits=32 encoding=(none)
> [2] INT 'long unsigned int' size=8 bits_offset=0 nr_bits=64
> encoding=(none)
> ...
>
> "bpftool btf show" works for ixgbe:
>
> # bpftool btf show|grep ixgbe
> 19: name [ixgbe] size 182074B
>
> Is this perhaps not expected to work yet? (I updated pahole
> to the latest changes etc and BTF generation seemed to work
> fine for modules during kernel build).
>
> For the "bpftool btf show" functionality, feel free to add
>
> Tested-by: Alan Maguire <alan.maguire@...cle.com>
Ok, thanks.
>
> Thanks!
>
> Alan
Powered by blists - more mailing lists