From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
Martin Rodriguez Reboredo <yakoyoku@gmail.com>,
linux-kernel@vger.kernel.org, Neal Gompa <neal@gompa.dev>,
Eric Curtin <ecurtin@redhat.com>,
bpf@vger.kernel.org, rust-for-linux@vger.kernel.org,
Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
Yonghong Song <yhs@fb.com>
Subject: Re: [PATCH 1/1] pahole/Rust: Check that we're adding DW_TAG_member sorted by byte offset
Date: Tue, 14 Feb 2023 18:22:24 -0300 [thread overview]
Message-ID: <Y+v7kNNoRC2ql/a0@kernel.org> (raw)
In-Reply-To: <Y+atpJV5rqo08dQJ@kernel.org>
Em Fri, Feb 10, 2023 at 05:48:36PM -0300, Arnaldo Carvalho de Melo escreveu:
> Hi Miguel, after a long winter, I'm trying to get Rust properly
> supported on pahole, please check that this specific use case is working
> for you as well.
>
> I'll go thru the others to see if they are easy (or at least restricted
> to Rust CUs) as this one.
I needed to add this one on top:
From 1231b6b9b4d88e0084bef4254eb1a05eb9935c99 Mon Sep 17 00:00:00 2001
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Tue, 14 Feb 2023 18:13:59 -0300
Subject: [PATCH 1/1] dwarf_loader: Fix sorting of Rust structs
We may have structs with fields on the same offset, don't move anything
in that case, otherwise we get into an eternal loop, doh.
Tested with the Linux kernel built with CONFIG_RUST + all the code
examples, first Rust struct where this happened was:
(gdb) p type->namespace.name
$2 = 0x7fffda938497 "((), char)"
(gdb) p type->nr_members
$3 = 2
(gdb) p current_member->name
$4 = 0x7fffda918f36 "__1"
(gdb) p next_member->name
$5 = 0x7fffda91765c "__0"
(gdb) p current_member->byte_offset
$6 = 0
(gdb) p next_member->byte_offset
$7 = 0
But this shows that --lang_exclude should be better positioned as we're
now needlessly loading all the tags for Rust DWARF to then just trow it
away at the cu__filter() in pahole :-\
Too late in the 1.25 release cycle for that, optimize it in 1.26.
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
dwarf_loader.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dwarf_loader.c b/dwarf_loader.c
index a77598dc3affca88..acdb68d5dd33f148 100644
--- a/dwarf_loader.c
+++ b/dwarf_loader.c
@@ -2857,7 +2857,7 @@ restart:
struct class_member *next_member = list_entry(current_member->tag.node.next, typeof(*current_member), tag.node);
- if (current_member->byte_offset < next_member->byte_offset)
+ if (current_member->byte_offset <= next_member->byte_offset)
continue;
list_del(¤t_member->tag.node);
--
2.39.1
next prev parent reply other threads:[~2023-02-14 21:22 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-11 15:20 [PATCH v3] scripts: Exclude Rust CUs with pahole Martin Rodriguez Reboredo
2023-01-11 15:22 ` Eric Curtin
2023-01-11 15:34 ` Neal Gompa
2023-01-11 16:16 ` Eric Curtin
2023-01-11 16:21 ` Neal Gompa
2023-01-16 16:37 ` Daniel Borkmann
2023-01-16 16:52 ` Miguel Ojeda
2023-01-16 17:06 ` Daniel Borkmann
2023-01-16 17:19 ` Miguel Ojeda
2023-02-10 20:48 ` [PATCH 1/1] pahole/Rust: Check that we're adding DW_TAG_member sorted by byte offset Arnaldo Carvalho de Melo
2023-02-13 12:09 ` pahole issues with Rust DWARF was: " Arnaldo Carvalho de Melo
2023-02-13 12:45 ` Miguel Ojeda
2023-02-13 12:53 ` Eric Curtin
2023-02-13 21:53 ` Arnaldo Carvalho de Melo
2023-02-13 21:05 ` Arnaldo Carvalho de Melo
2023-02-14 21:22 ` Arnaldo Carvalho de Melo [this message]
2023-01-16 19:22 ` [PATCH v3] scripts: Exclude Rust CUs with pahole Arnaldo Carvalho de Melo
2023-01-17 16:40 ` patchwork-bot+netdevbpf
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=Y+v7kNNoRC2ql/a0@kernel.org \
--to=acme@kernel.org \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=ecurtin@redhat.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=neal@gompa.dev \
--cc=rust-for-linux@vger.kernel.org \
--cc=yakoyoku@gmail.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;
as well as URLs for NNTP newsgroup(s).