Skip to content

pahole: BTF alignment inference improvements

Antoine Tenart dwarves 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 1 replyIn review
  2. v12 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- Added comments in both patches to help future readers.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2btf_loader: infer alignment for zero-length arraysbtf_loader.c+8 -20 replies
2/2btf_loader: fix smallest offset in case of bitfieldsbtf_loader.c+12 -10 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAlan Maguire
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] pahole: BTF alignment inference improvements

Hello,

While generating C code using pahole we noticed alignment issues in rare
cases: when having variable size and 0-length arrays, and when a hole follows a bitfield. It's worth noticing alignment is inferred when using BTF as a source as the format does not contain such information. As such the logic is tricky.

The first patch fixes alignment inference for zero-length and variable length arrays. The second patch fixes alignment when a hole follows a bitfield.

I generated a full vmlinux.h using pahole --compile before and after the changes, the differences looked reasonable to me. I've also ran the project's tests using GH actions.

Thanks,
Antoine

Since v1:
- Added comments in both patches to help future readers.

Antoine Tenart (2):
btf_loader: infer alignment for zero-length arrays
btf_loader: fix smallest offset in case of bitfields

 btf_loader.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)
Signature · 1 line
2.50.0