From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
Clark Williams <williams@redhat.com>,
Kate Carcia <kcarcia@redhat.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Matthias Schwarzott <zzam@gentoo.org>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>, Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
dwarves@vger.kernel.org
Subject: Re: [PATCH 1/5] core: Add method to get the vmlinux BTF filename, allow overriding it via env var
Date: Tue, 19 Nov 2024 14:48:02 -0300 [thread overview]
Message-ID: <ZzzPUhCaew6rHwL_@x1> (raw)
In-Reply-To: <ZzyO9aibti18J6sK@x1>
On Tue, Nov 19, 2024 at 10:13:32AM -0300, Arnaldo Carvalho de Melo wrote:
> On Tue, Nov 19, 2024 at 12:57:44PM +0000, Alan Maguire wrote:
> > On 18/11/2024 20:41, Arnaldo Carvalho de Melo wrote:
> > > In systems where BTF isn't available there were reports that the
> > > simplest pahole call, without any args, segfaults.
>
> > > To have a proper test before fixing this problem, allow overriding the
> > > /sys/kernel/btf/vmlinux filename, so that even in systems with BTF we an
> > > point it to a invalid location, making pahole think that there is no BTF
> > > available and thus fallback to something that currently segfaults.
>
> <SNIP>
>
> > Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
>
> Thanks!
Ah, thanks, added to the cset,
- Arnaldo
> > Small thing - would it be worth dropping the _FILENAME suffix of the
> > envvar to just have PAHOLE_VMLINUX_BTF? One other thing below..
>
> See below ends up being related to the other point you made.
>
> > > +++ b/pahole.c
> > > @@ -3754,7 +3754,7 @@ try_sole_arg_as_class_names:
> > > if (filename &&
> > > strstarts(filename, "/sys/kernel/btf/") &&
> > > strstr(filename, "/vmlinux") == NULL) {
> > > - base_btf_file = "/sys/kernel/btf/vmlinux";
> > > + base_btf_file = vmlinux_path__btf_filename();
> >
> > so in this case, we are specifying a module in /sys/kernel/btf and
> > implicitly we use /sys/kernel/btf/vmlinux as the base. I wonder if
> > there's much value for the envvar override here; I guess it might allow
> > us to test using a mismatched base vmlinux with split BTF?
>
> Right, that would be possible with this patch as-is, which may be
> useful, we may want to have PAHOLE_VMLINUX_BTF_DIR as a counterpart to
> PAHOLE_VMLINUX_BTF_FILENAME, that would allow us to use some different
> directory with both vmlinux and modules.
>
> Having both allows more flexibility, picking some arbitrary vmlinux
> plust some arbitrary directory with modules, etc. So I'd keep the patch
> as is and at some point add the PAHOLE_VMLINUX_BTF_DIR knob.
>
> - Arnaldo
>
> > > conf_load.base_btf = btf__parse(base_btf_file, NULL);
> > > if (libbpf_get_error(conf_load.base_btf)) {
> > > fprintf(stderr, "Failed to parse base BTF '%s': %ld\n",
next prev parent reply other threads:[~2024-11-19 17:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 20:41 [PATCH 0/5] Fix segfaults related to missing BTF support Arnaldo Carvalho de Melo
[not found] ` <20241118204146.772762-5-acme@kernel.org>
[not found] ` <20f6d8af-5c4e-4eb4-925e-7a6b10efcb55@oracle.com>
2024-11-19 17:46 ` [PATCH 4/5] tests default_vmlinux_btf: Cover the no args segfault too Arnaldo Carvalho de Melo
2024-11-19 17:51 ` Arnaldo Carvalho de Melo
[not found] ` <20241118204146.772762-6-acme@kernel.org>
[not found] ` <4b465bfc-8214-41ab-8b6d-bbdf7421e19b@oracle.com>
2024-11-19 18:29 ` [PATCH 5/5] core, libctf: Check if constructor arguments are NULL before using them Arnaldo Carvalho de Melo
[not found] ` <20241118204146.772762-2-acme@kernel.org>
[not found] ` <ac93d9fe-2e84-4e00-94ef-50a3074d49fc@oracle.com>
[not found] ` <ZzyO9aibti18J6sK@x1>
2024-11-19 17:48 ` Arnaldo Carvalho de Melo [this message]
[not found] ` <9992d2487775011278aef17d1a2db98b8cc74e7d.camel@gmail.com>
2024-11-19 18:32 ` [PATCH 1/5] core: Add method to get the vmlinux BTF filename, allow overriding it via env var Arnaldo Carvalho de Melo
[not found] ` <20241118204146.772762-3-acme@kernel.org>
[not found] ` <90d7282a-60af-4087-8e08-fed3fbe348ee@oracle.com>
2024-11-19 17:50 ` [PATCH 2/5] tests default_vmlinux_btf: Introduce test for using BTF by default Arnaldo Carvalho de Melo
[not found] ` <33b85d2c1adafb5a46a874dfcfd43682395e1564.camel@gmail.com>
2024-11-19 19:49 ` Arnaldo Carvalho de Melo
2024-11-19 19:54 ` Eduard Zingerman
2024-11-19 19:55 ` Arnaldo Carvalho de Melo
2024-11-19 20:12 ` Arnaldo Carvalho de Melo
2024-11-19 20:13 ` Eduard Zingerman
2024-11-19 20:15 ` Arnaldo Carvalho de Melo
-- strict thread matches above, loose matches on Subject: below --
2024-11-19 13:40 [PATCH 0/5] Fix segfaults related to missing BTF support Arnaldo Carvalho de Melo
2024-11-19 13:40 ` [PATCH 1/5] core: Add method to get the vmlinux BTF filename, allow overriding it via env var Arnaldo Carvalho de Melo
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=ZzzPUhCaew6rHwL_@x1 \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=dwarves@vger.kernel.org \
--cc=eddyz87@gmail.com \
--cc=jolsa@kernel.org \
--cc=kcarcia@redhat.com \
--cc=song@kernel.org \
--cc=williams@redhat.com \
--cc=yonghong.song@linux.dev \
--cc=zzam@gentoo.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.