lkml.org 
[lkml]   [2022]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] bpftool: Use sysfs vmlinux when dumping BTF by ID
Date
On Thu, 28 Apr 2022 21:58:58 -0700 Andrii Nakryiko <andrii@kernel.org> wrote:
> On Thu, Apr 28, 2022 at 4:17 AM Larysa Zaremba <larysa.zaremba@intel.com> wrote:
> >
> > Currently, dumping almost all BTFs specified by id requires
>
> It should and will work only for kernel modules. It won't and
> shouldn't work for BTFs coming from BPF programs. We shouldn't blindly
> guess and substitute vmlinux BTF as base BTF, let's fetch
> bpf_btf_info, check that BTF is from kernel and is not vmlinux, and
> only in such case substitute vmlinux BTF as base BTF.

I agree, this is taken into account in v2

> > using the -B option to pass the base BTF. For most cases
> > the vmlinux BTF sysfs path should work.
> >
> > This patch simplifies dumping by ID usage by attempting to
> > use vmlinux BTF from sysfs, if the first try of loading BTF by ID
> > fails with certain conditions.
> >
> > Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
> > Reviewed-by: Alexander Lobakin <alexandr.lobakin@intel.com>
> > ---
> > tools/bpf/bpftool/btf.c | 35 ++++++++++++++++++++++++++---------
> > 1 file changed, 26 insertions(+), 9 deletions(-)
> >

Best Regards,
Larysa Zaremba

\
 
 \ /
  Last update: 2022-05-05 16:07    [W:0.108 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site