From: Christoph Hellwig <hch@lst.de>
To: dwarves@vger.kernel.org
Subject: pahole treats embedded structures a holes
Date: Thu, 28 May 2026 07:11:52 +0200 [thread overview]
Message-ID: <20260528051152.GA27820@lst.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 969 bytes --]
Hi all,
this is a pretty old bug as far as I can tell, but I finally tried to
track it down and failed.
When running dwarves, both the package in Debian testing and a build of
todays git tree on Debian testing, it treats a lot of C structures
embedded into others as holes instead of having a size for them. I
think this generally structures defined in other header files and
not the file containing the offending struct.
E.g. if I run pahole on fs/xfs/xfs_buf.o on a current mainline kernel,
the output for struct xfs_buf starts like this:
struct xfs_buf {
struct rhash_head b_rhash_head; /* 0 0 */
/* XXX 8 bytes hole, try to pack */
xfs_daddr_t b_rhash_key; /* 8 8 */
struct rhash_head is a single pointer, so 8 bytes on x86-64, and
xfs_daddr_t is also a 64-bit type, so both the 0 size and the 8
byte hole are clearly wrong. The kernel .config is attached in case
it matter.
[-- Attachment #2: config.gz --]
[-- Type: application/x-gzip, Size: 26863 bytes --]
next reply other threads:[~2026-05-28 5:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 5:11 Christoph Hellwig [this message]
2026-05-28 13:39 ` pahole treats embedded structures a holes Arnaldo Carvalho de Melo
2026-05-28 13:58 ` Christoph Hellwig
2026-05-28 19:48 ` Arnaldo Carvalho de Melo
2026-05-29 4:02 ` Christoph Hellwig
2026-05-29 19:28 ` Arnaldo Carvalho de Melo
-- strict thread matches above, loose matches on Subject: below --
2026-06-05 19:28 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=20260528051152.GA27820@lst.de \
--to=hch@lst.de \
--cc=dwarves@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox