From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Alan Maguire <alan.maguire@oracle.com>,
Jiri Olsa <jolsa@kernel.org>,
Clark Williams <williams@redhat.com>,
dwarves@vger.kernel.org, bpf@vger.kernel.org,
Andrii Nakryiko <andrii@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Mark Wieelard <mjw@redhat.com>,
rust-for-linux <rust-for-linux@vger.kernel.org>,
Gary Guo <gary@garyguo.net>
Subject: Re: [PATCHES 00/12] pahole: Support more rust tags and references to dwz alternate debug files
Date: Fri, 7 Aug 2026 15:53:53 -0300 [thread overview]
Message-ID: <anYpwcDBtkzE3WIt@x1> (raw)
In-Reply-To: <CANiq72nHWY638h4mxJCfh_HFtzhwFEPyo6a-7k_3CxZsRV+Jiw@mail.gmail.com>
On Fri, Aug 07, 2026 at 07:34:10PM +0200, Miguel Ojeda wrote:
> On Fri, Aug 7, 2026 at 2:43 PM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
> >
> > Adding Miguel to the CC list, Miguel we're trying to improve BTF support
> > for Rust, this series handles multiple enabling fixes/improvements that
> > gets us to the next level, i.e. we can load everything from DWARF, now
>
> Thanks for the Cc! Cc'ing rust-for-linux and Gary.
>
> > its time to try to map it to existing BTF kinds and propose BTF
> > extensions when we can't use existing encodings.
>
> Sounds cool :)
>
> > Inferring from "does any member have a niche layout" means
> > reverse-engineering rustc's layout algorithm, which is explicitly
> > unstable and unspecified. It'd break silently on a compiler bump, with
> > no way to tell from the DWARF that you got it wrong.
>
> Yeah, the LLM is correct here: the Rust compiler gives very few
> guarantees for the default `repr`, i.e. in common cases it has the
> freedom to use whatever layout it wants (i.e. even for essentially
> equivalent types in the same compilation unit) -- the official docs
> are at:
>
> https://doc.rust-lang.org/reference/type-layout.html
>
> > u8 __discriminant; /* 0 1 */
>
> For the niche cases like `Option<NonZero<u32>>`, what would be printed?
Can you think about one such niche case that is present in the kernel
rust .o files right now? I tried finding the `Option<NonZero<u32>>` to
look at its DWARF but couldn't find one.
- Arnaldo
next prev parent reply other threads:[~2026-08-07 18:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260731193102.110693-1-acme@kernel.org>
[not found] ` <18b557a8-e1ca-46cf-b03f-5e68490c9229@oracle.com>
[not found] ` <anXTAComw6XAvnXU@x1>
2026-08-07 17:34 ` [PATCHES 00/12] pahole: Support more rust tags and references to dwz alternate debug files Miguel Ojeda
2026-08-07 18:53 ` Arnaldo Carvalho de Melo [this message]
2026-08-07 19:26 ` Gary Guo
2026-08-07 20:30 ` 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=anYpwcDBtkzE3WIt@x1 \
--to=acme@kernel.org \
--cc=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=dwarves@vger.kernel.org \
--cc=gary@garyguo.net \
--cc=jolsa@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=mjw@redhat.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=williams@redhat.com \
--cc=yonghong.song@linux.dev \
/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