aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/entry_64.S
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2008-11-20 16:18:55 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-28 08:07:45 -0500
commitc7b0d17366d6e04a11470fc8d85f9fbac02671b9 (patch)
tree1725700cb0d4e8b58aec37d64f350a093e64e3cd /arch/powerpc/kernel/entry_64.S
parent813b8520f5c240c71df55d14095a7b171de264ce (diff)
powerpc: ftrace, do nothing in mcount call for dyn ftrace
Impact: quicken mcount calls that are not replaced by dyn ftrace Dynamic ftrace no longer does on the fly recording of mcount locations. The mcount locations are now found at compile time. The mcount function no longer needs to store registers and call a stub function. It can now just simply return. Since there are some functions that do not get converted to a nop (.init sections and other code that may disappear), this patch should help speed up that code. Also, the stub for mcount on PowerPC 32 can not be a simple branch link register like it is on PowerPC 64. According to the ABI specification: "The _mcount routine is required to restore the link register from the stack so that the profiling code can be inserted transparently, whether or not the profiled function saves the link register itself." This means that we must restore the link register that was used to make the call to mcount. The minimal mcount function for PPC32 ends up being: mcount: mflr r0 mtctr r0 lwz r0, 4(r1) mtlr r0 bctr Where we move the link register used to call mcount into the ctr register, and then restore the link register from the stack. Then we use the ctr register to jump back to the mcount caller. The r0 register is free for us to use. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/powerpc/kernel/entry_64.S')
-rw-r--r--arch/powerpc/kernel/entry_64.S12
1 files changed, 0 insertions, 12 deletions
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index e6d52845854f..b00982e0d1ee 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -888,18 +888,6 @@ _GLOBAL(enter_prom)
888#ifdef CONFIG_DYNAMIC_FTRACE 888#ifdef CONFIG_DYNAMIC_FTRACE
889_GLOBAL(mcount) 889_GLOBAL(mcount)
890_GLOBAL(_mcount) 890_GLOBAL(_mcount)
891 /* Taken from output of objdump from lib64/glibc */
892 mflr r3
893 stdu r1, -112(r1)
894 std r3, 128(r1)
895 subi r3, r3, MCOUNT_INSN_SIZE
896 .globl mcount_call
897mcount_call:
898 bl ftrace_stub
899 nop
900 ld r0, 128(r1)
901 mtlr r0
902 addi r1, r1, 112
903 blr 891 blr
904 892
905_GLOBAL(ftrace_caller) 893_GLOBAL(ftrace_caller)