Re: pahole treats embedded structures a holes

Christoph Hellwig <[email protected]> Thu, 28 May 2026 15:58:52 +0200
Newsgroups org.kernel.vger.dwarves
Message-ID <[email protected]>
On Thu, May 28, 2026 at 10:39:34AM -0300, Arnaldo Carvalho de Melo wrote:
> > 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.
> 
> Starting from using the BTF info, that becomes available thru sysfs as
> soon as we load the xfs kernel module:

This works fine on my installed distro kernel as well.  But this is
for test builds which are only going to run in a VM.  I don't really
care about DWARF vs BTF, but I do care about not having to run the
kernel :)

Note that I'm also seeing this for other code than XFS, e.g. the nvme
driver or block layer code.

> Now I'll try with a fresh kernel build, with a default fedora kernel
> config, will take a while, but having access to a separate .o file from
> the kernel build process, with just DWARF info is what we need to get to
> the state you're in, that should work, lets see why you're getting the
> unsatisfactory results you're getting, maybe we need further info about
> compiler versions, etc, but lets see...

gcc (Debian 15.2.0-17) 15.2.0