Skip to contentSkip to conversation

scripts: require pahole v1.16 when generating BTF

PATCH Applied Lorenz Bauer 3 participants 3 messages Jun 8, 2020 – Jun 9, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts: require pahole v1.16 when generating BTF

bpf_iter requires the kernel BTF to be generated with pahole >= 1.16, since otherwise the function definitions that the iterator attaches to are not included. This failure mode is indistiguishable from trying to attach to an iterator that really doesn't exist.

Since it's really easy to miss this requirement, bump the pahole version check used at build time to at least 1.16.

Fixes 15d83c4d7cef ("bpf: Allow loading of a bpf_iter program")
---
 scripts/link-vmlinux.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/link-vmlinux.sh +2 -2
index 3adef49250af..a37875904ca6 100755
@@ -143,8 +143,8 @@ gen_btf()
 	fi
 
 	pahole_ver=$(${PAHOLE} --version | sed -E 's/v([0-9]+)\.([0-9]+)/\1\2/')
-	if [ "${pahole_ver}" -lt "113" ]; then
-		echo >&2 "BTF: ${1}: pahole version $(${PAHOLE} --version) is too old, need at least v1.13"
+	if [ "${pahole_ver}" -lt "116" ]; then
+		echo >&2 "BTF: ${1}: pahole version $(${PAHOLE} --version) is too old, need at least v1.16"
 		return 1
 	fi
 
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Lorenz Bauer

bpf_iter requires the kernel BTF to be generated with pahole >= 1.16, since otherwise the function definitions that the iterator attaches to are not included. This failure mode is indistiguishable from trying to attach to an iterator that really doesn't exist.

Quoted 6 lines

Since it's really easy to miss this requirement, bump the pahole version check used at build time to at least 1.16.

Fixes 15d83c4d7cef ("bpf: Allow loading of a bpf_iter program")
#2 lore raw
Quoted 9 lines · Yonghong Song
Quoted 6 lines · Lorenz Bauer

bpf_iter requires the kernel BTF to be generated with pahole >= 1.16, since otherwise the function definitions that the iterator attaches to are not included. This failure mode is indistiguishable from trying to attach to an iterator that really doesn't exist.

Quoted 8 lines
Quoted 6 lines

Since it's really easy to miss this requirement, bump the pahole version check used at build time to at least 1.16.

Fixes 15d83c4d7cef ("bpf: Allow loading of a bpf_iter program")

Applied. Thanks