Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc64/ftrace: fix OOL stub count with clang

The total number of out-of-line (OOL) stubs required for function
tracing is determined using the following command:

$(OBJDUMP) -r -j __patchable_function_entries vmlinux.o

While this works correctly with GNU objdump, llvm-objdump does not
list the expected relocation records for this section. Fix this by
using the -d option and counting R_PPC64_ADDR64 relocation entries.
This works as desired with both objdump and llvm-objdump.

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260127084926.34497-3-hbathini@linux.ibm.com

authored by

Hari Bathini and committed by
Madhavan Srinivasan
875612a7 73cdf24e

+2 -2
+2 -2
arch/powerpc/tools/ftrace-gen-ool-stubs.sh
··· 15 15 RELOCATION=R_PPC_ADDR32 16 16 fi 17 17 18 - num_ool_stubs_total=$($objdump -r -j __patchable_function_entries "$vmlinux_o" | 18 + num_ool_stubs_total=$($objdump -r -j __patchable_function_entries -d "$vmlinux_o" | 19 19 grep -c "$RELOCATION") 20 - num_ool_stubs_inittext=$($objdump -r -j __patchable_function_entries "$vmlinux_o" | 20 + num_ool_stubs_inittext=$($objdump -r -j __patchable_function_entries -d "$vmlinux_o" | 21 21 grep -e ".init.text" -e ".text.startup" | grep -c "$RELOCATION") 22 22 num_ool_stubs_text=$((num_ool_stubs_total - num_ool_stubs_inittext)) 23 23