pahole creates BTF with lots of duplicate types

Bug #2025370 reported by Lorenz Bauer
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dwarves (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
Invalid
Undecided
Unassigned
Kinetic
Invalid
Undecided
Unassigned
Lunar
Won't Fix
Undecided
Unassigned
Mantic
Fix Released
Undecided
Unassigned

Bug Description

pahole 1.24-4ubuntu1 creates buggy BTF from vmlinux:

$ bpftool btf dump file 1.24-ubuntu.btf | grep "STRUCT 'net'" | wc -l
44

Upstream pahole from debian doesn't have this problem:

$ bpftool btf dump file 1.24-debian.btf | grep "STRUCT 'net'" | wc -l
1

This is also apparent in the created file sizes:

$ ls -lh *.btf
-rw-r-----. 1 lorenz lorenz 3.6M Jun 29 15:19 1.24.btf
-rw-r-----. 1 lorenz lorenz 3.6M Jun 29 15:26 1.24-debian.btf
-rw-r-----. 1 lorenz lorenz 8.5M Jun 29 15:16 1.24-ubuntu.btf

1.24.btf is created using pahole v1.24 built from source.

Looking at the Debian patch tracker, it seems like you are missing one patch: https://sources.debian.org/patches/dwarves/1.24-4.1/03-dwarves-Zero-initialize-struct-cu-in-cu__new-to-prev.patch/ vs https://git.launchpad.net/ubuntu/+source/dwarves/tree/debian/patches?h=applied/ubuntu/lunar

This causes problems in tools which use vmlinux BTF to do CO-RE relocations against the running kernel. On recent ubuntu kernels these are excruciatingly slow since your pahole creates bloated types.

Changed in dwarves (Ubuntu Mantic):
status: New → Fix Released
Changed in dwarves (Ubuntu Kinetic):
status: New → Invalid
Changed in dwarves (Ubuntu Jammy):
status: New → Invalid
Changed in dwarves (Ubuntu Lunar):
status: New → In Progress
Revision history for this message
Dimitri John Ledkov (xnox) wrote :
Changed in dwarves (Ubuntu Lunar):
status: In Progress → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Ubuntu 23.04 (Lunar Lobster) has reached end of life, so this bug will not be fixed for that specific release.

Changed in dwarves (Ubuntu Lunar):
status: Fix Committed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.