[PATCH 3/8] powerpc/ftrace: Remove redundant saving of LR in ftrace[_graph]_caller
Naveen N. Rao
naveen.n.rao at linux.vnet.ibm.com
Thu May 4 14:36:16 AEST 2017
For -mprofile-kernel, there is no need to save LR into the ABI save
location on entry into ftrace_caller(). It is sufficient to have the
(possibly updated) return address in LR (and r0?). On return from
ftrace, this value is stored in the ABI save location if necessary.
Furthermore, we can also remove the redundant saving of LR in
ftrace_graph_caller() for similar reasons. It is sufficient to ensure
LR and r0 point to the new return address.
Signed-off-by: Naveen N. Rao <naveen.n.rao at linux.vnet.ibm.com>
---
arch/powerpc/kernel/trace/ftrace_64_mprofile.S | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/powerpc/kernel/trace/ftrace_64_mprofile.S b/arch/powerpc/kernel/trace/ftrace_64_mprofile.S
index fa0921410fa4..d8d75f4eb853 100644
--- a/arch/powerpc/kernel/trace/ftrace_64_mprofile.S
+++ b/arch/powerpc/kernel/trace/ftrace_64_mprofile.S
@@ -38,9 +38,6 @@
* and then arrange for the ftrace function to be called.
*/
_GLOBAL(ftrace_caller)
- /* Save the original return address in A's stack frame */
- std r0,LRSAVE(r1)
-
/* Create our stack frame + pt_regs */
stdu r1,-SWITCH_FRAME_SIZE(r1)
@@ -271,6 +268,5 @@ _GLOBAL(ftrace_graph_caller)
addi r1, r1, 112
mflr r0
- std r0, LRSAVE(r1)
bctr
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
--
2.12.2
More information about the Linuxppc-dev
mailing list