Commit 875612a7 authored by Hari Bathini's avatar Hari Bathini Committed by Madhavan Srinivasan
Browse files

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: default avatarHari Bathini <hbathini@linux.ibm.com>
Tested-by: default avatarVenkat Rao Bagalkote <venkat88@linux.ibm.com>
Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260127084926.34497-3-hbathini@linux.ibm.com
parent 73cdf24e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -15,9 +15,9 @@ if [ -z "$is_64bit" ]; then
	RELOCATION=R_PPC_ADDR32
fi

num_ool_stubs_total=$($objdump -r -j __patchable_function_entries "$vmlinux_o" |
num_ool_stubs_total=$($objdump -r -j __patchable_function_entries -d "$vmlinux_o" |
		      grep -c "$RELOCATION")
num_ool_stubs_inittext=$($objdump -r -j __patchable_function_entries "$vmlinux_o" |
num_ool_stubs_inittext=$($objdump -r -j __patchable_function_entries -d "$vmlinux_o" |
			 grep -e ".init.text" -e ".text.startup" | grep -c "$RELOCATION")
num_ool_stubs_text=$((num_ool_stubs_total - num_ool_stubs_inittext))