Skip to contentSkip to conversation

pahole: upgrade 1.25 -> 1.29

PATCH In review Xiangyu Chen 3 participants 3 messages Apr 22 – Apr 30

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pahole: upgrade 1.25 -> 1.29

From: Xiangyu Chen <[email protected]>

pahole v1.25 in scarthgap non-deterministic BTF type ID ordering when using its parallel mode (-j).
The kernel build system (scripts/pahole-flags.sh) automatically passes -j to pahole for versions >= 1.22. This means two builds from identical source produce different vmlinux binaries with different .BTF sections, even though the bitBake task hash is the same.

It was fixed in pahole v1.29 (Jan 2025, commit 4c916259) which made reproducible builds always-on by default.

Since Scarthgap is a stable release, the current v1.25 is retained to support users who require the older version. Users can revert to it by setting PREFERRED_VERSION_pahole = "1.25".

Additionally, the patches:
0001-Use-usr-bin-env-python3-instead-of-just-usr-bin-pyth.patch 0001-btf_encoder-Fix-elf_functions-cleanup-on-error.patch are backported from Walnasacar to resolve specific issues in v1.29.

---
 ...python3-instead-of-just-usr-bin-pyth.patch | 34 ++++++++++++
 ...r-Fix-elf_functions-cleanup-on-error.patch | 55 +++++++++++++++++++
 .../recipes-devtools/pahole/pahole_1.29.bb    | 33 +++++++++++
 3 files changed, 122 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/pahole/files/0001-Use-usr-bin-env-python3-instead-of-just-usr-bin-pyth.patch
 create mode 100644 meta-oe/recipes-devtools/pahole/files/0001-btf_encoder-Fix-elf_functions-cleanup-on-error.patch
 create mode 100644 meta-oe/recipes-devtools/pahole/pahole_1.29.bb
meta-oe/recipes-devtools/pahole/files/0001-Use-usr-bin-env-python3-instead-of-just-usr-bin-pyth.patch new file +34 -0
new file mode 100644
index 0000000000..7dc18d7aa2
@@ -0,0 +1,34 @@
+From 436163ab845c263312cf3d4717a43727cf5f0747 Mon Sep 17 00:00:00 2001
+From: Matteo Croce <[email protected]>
+Date: Wed, 15 Sep 2021 17:54:01 +0200
+Subject: [PATCH] Use /usr/bin/env python3 instead of just /usr/bin/python3
+
+Upstream-Status: Inappropriate [OE specific]
+---
+ ostra/ostra-cg        | 2 +-
+ ostra/python/ostra.py | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ostra/ostra-cg b/ostra/ostra-cg
+index 52c902e..8142e67 100755
+--- a/ostra/ostra-cg
++++ b/ostra/ostra-cg
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/env python3
+ # ostra-cg - generate callgraphs from encoded trace
+ #
+ # Arnaldo Carvalho de Melo <[email protected]>
+diff --git a/ostra/python/ostra.py b/ostra/python/ostra.py
+index 86fe079..9bb5ad1 100755
+--- a/ostra/python/ostra.py
++++ b/ostra/python/ostra.py
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/env python3
+ #
+ # Copyright (C) 2005, 2006, 2007 Arnaldo Carvalho de Melo
+ #
+-- 
+2.31.1
+
meta-oe/recipes-devtools/pahole/files/0001-btf_encoder-Fix-elf_functions-cleanup-on-error.patch new file +55 -0

55 lines not on this page · raw message

meta-oe/recipes-devtools/pahole/pahole_1.29.bb new file +33 -0
new file mode 100644
index 0000000000..b5110d05f5
@@ -0,0 +1,33 @@
+SUMMARY = "Shows and manipulates data structure layout"
+
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS = "elfutils zlib libbpf"
+
+# Depends on MACHINE_ARCH libbpf
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+COMPATIBLE_HOST = "(x86_64|i.86|arm|aarch64|riscv64|powerpc|powerpc64|mips64).*-linux"
+
+SRCREV = "b9cc7963051b2099795129450f9b70c81950d02f"
+SRC_URI = "git://git.kernel.org/pub/scm/devel/pahole/pahole.git;branch=master \
+           file://0001-Use-usr-bin-env-python3-instead-of-just-usr-bin-pyth.patch \
+           file://0001-btf_encoder-Fix-elf_functions-cleanup-on-error.patch"
+
+S = "${WORKDIR}/git"
+
+inherit cmake pkgconfig
+
+PACKAGECONFIG[python3] = ",,python3,python3-core"
+
+EXTRA_OECMAKE = "-D__LIB=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix') + '/')} -DCMAKE_BUILD_TYPE=Release -DLIBBPF_EMBEDDED=OFF"
+
+FILES:${PN} =  "${bindir}/pahole \
+		${libdir}/libdwarves.so* \
+		${libdir}/libdwarves_reorganize.so*"
+
+PACKAGES += "${PN}-extra"
+FILES:${PN}-extra = "${datadir} ${bindir} ${libdir}/libdwarves_emit.so*"
+RDEPENDS:${PN}-extra += "bash python3-core"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.34.1
#1 lore raw
Quoted 10 lines · Xiangyu Chen via lists.openembedded.org

From: Xiangyu Chen <[email protected]>

pahole v1.25 in scarthgap non-deterministic BTF type ID ordering when using its parallel mode (-j).
The kernel build system (scripts/pahole-flags.sh) automatically passes -j to pahole for versions >= 1.22. This means two builds from identical source produce different vmlinux binaries with different .BTF sections, even though the bitBake task hash is the same.

Quoted 6 lines

It was fixed in pahole v1.29 (Jan 2025, commit 4c916259) which made reproducible builds always-on by default.

Since Scarthgap is a stable release, the current v1.25 is retained to support users who require the older version. Users can revert to it by setting PREFERRED_VERSION_pahole = "1.25".

You seem to have sent this 3 times without revisions. Are all patches same? Also, can't the fix be backported instead?

Thanks,

Anuj

#2 lore raw
Quoted 15 lines · Anuj Mittal

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 9 lines · Xiangyu Chen via lists.openembedded.org

From: Xiangyu Chen <[email protected]>

pahole v1.25 in scarthgap non-deterministic BTF type ID ordering when using its parallel mode (-j).
The kernel build system (scripts/pahole-flags.sh) automatically passes -j to pahole for versions >= 1.22. This means two builds from identical source produce different vmlinux binaries with different .BTF sections, even though the bitBake task hash is the same.

Quoted 8 lines
Quoted 6 lines

It was fixed in pahole v1.29 (Jan 2025, commit 4c916259) which made reproducible builds always-on by default.

Since Scarthgap is a stable release, the current v1.25 is retained to support users who require the older version. Users can revert to it by setting PREFERRED_VERSION_pahole = "1.25".

You seem to have sent this 3 times without revisions. Are all patches same? Also, can't the fix be backported instead?

Sorry for that, seems something wrong with my network, send-email service always

report failure at that day, I tried to re-send, but in fact, the patch has already sent.

Regarding to backport, the aim is keep both version of pahole in a stable branch.

If backport the upgrade commit, it not very clearly for others who want to know what happen.

Br,

Xiangyu

Quoted 4 lines

Thanks,

Anuj