From: Larysa Zaremba <larysa.zaremba@intel.com>
To: andrii.nakryiko@gmail.com
Cc: alexandr.lobakin@intel.com, andrii@kernel.org, ast@kernel.org,
bpf@vger.kernel.org, daniel@iogearbox.net, kafai@fb.com,
larysa.zaremba@intel.com, linux-kernel@vger.kernel.org,
maciej.fijalkowski@intel.com, netdev@vger.kernel.org,
songliubraving@fb.com, yhs@fb.com
Subject: Re: [PATCH] bpftool: Use sysfs vmlinux when dumping BTF by ID
Date: Thu, 5 May 2022 15:56:26 +0200 [thread overview]
Message-ID: <20220505135626.137133-1-larysa.zaremba@intel.com> (raw)
In-Reply-To: <CAEf4BzZRioYpgsUFP1TLsqtjtvA3WLyuWjSyq12ctUoMqkUorg@mail.gmail.com>
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
next prev parent reply other threads:[~2022-05-05 14:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-28 11:08 [PATCH] bpftool: Use sysfs vmlinux when dumping BTF by ID Larysa Zaremba
2022-04-29 4:58 ` Andrii Nakryiko
2022-05-05 13:56 ` Larysa Zaremba [this message]
2022-05-06 1:32 ` Milan Landaverde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220505135626.137133-1-larysa.zaremba@intel.com \
--to=larysa.zaremba@intel.com \
--cc=alexandr.lobakin@intel.com \
--cc=andrii.nakryiko@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kafai@fb.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox