Skip to contentSkip to conversation

bpf: Add --skip_encoding_btf_inconsistent_proto, --btf_gen_optimized to pahole flags for v1.25

PATCH In review Jiri Olsa 2 participants 2 messages Jan 22, 2024

Subsystems (2)
lore
Share & tools
lore

Jiri Olsa

author reviewer
#0 lore raw

PATCH 1/1 bpf: Add --skip_encoding_btf_inconsistent_proto, --btf_gen_optimized to pahole flags for v1.25

From: Alan Maguire <[email protected]>

commit 7b99f75942da332e3f4f865e55a10fec95a30d4f upstream.

[ small context conflict because of not backported --lang_exclude=rust option, which is not needed in 5.15 ]

v1.25 of pahole supports filtering out functions with multiple inconsistent function prototypes or optimized-out parameters from the BTF representation. These present problems because there is no additional info in BTF saying which inconsistent prototype matches which function instance to help guide attachment, and functions with optimized-out parameters can lead to incorrect assumptions about register contents.

So for now, filter out such functions while adding BTF representations for functions that have "."-suffixes (foo.isra.0) but not optimized-out parameters. This patch assumes that below linked changes land in pahole for v1.25.

Issues with pahole filtering being too aggressive in removing functions appear to be resolved now, but CI and further testing will confirm.

---
 scripts/pahole-flags.sh | 3 +++
 1 file changed, 3 insertions(+)
scripts/pahole-flags.sh +3 -0
index d38fa6d84d62..5c724f697100 100755
@@ -20,5 +20,8 @@ fi
 if [ "${pahole_ver}" -ge "124" ]; then
 	extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_enum64"
 fi
+if [ "${pahole_ver}" -ge "125" ]; then
+	extra_paholeopt="${extra_paholeopt} --skip_encoding_btf_inconsistent_proto --btf_gen_optimized"
+fi
 
 echo ${extra_paholeopt}
Signature · 1 line
2.43.0
#1 lore raw
Quoted 21 lines · Jiri Olsa

From: Alan Maguire <[email protected]>

commit 7b99f75942da332e3f4f865e55a10fec95a30d4f upstream.

[ small context conflict because of not backported --lang_exclude=rust option, which is not needed in 5.15 ]

v1.25 of pahole supports filtering out functions with multiple inconsistent function prototypes or optimized-out parameters from the BTF representation. These present problems because there is no additional info in BTF saying which inconsistent prototype matches which function instance to help guide attachment, and functions with optimized-out parameters can lead to incorrect assumptions about register contents.

So for now, filter out such functions while adding BTF representations for functions that have "."-suffixes (foo.isra.0) but not optimized-out parameters. This patch assumes that below linked changes land in pahole for v1.25.

Issues with pahole filtering being too aggressive in removing functions appear to be resolved now, but CI and further testing will confirm.

Quoted 8 lines
---
 scripts/pahole-flags.sh | 3 +++
 1 file changed, 3 insertions(+)

Now queued up, thanks.

greg k-h