Commit 65aa7e34 authored by Ard Biesheuvel's avatar Ard Biesheuvel

ARM: ftrace: avoid unnecessary literal loads

Avoid explicit literal loads and instead, use accessor macros that
generate the optimal sequence depending on the architecture revision
being targeted.
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Reviewed-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
parent d1196787
...@@ -35,23 +35,20 @@ ...@@ -35,23 +35,20 @@
.macro __mcount suffix .macro __mcount suffix
mcount_enter mcount_enter
ldr r0, =ftrace_trace_function ldr_va r2, ftrace_trace_function
ldr r2, [r0]
badr r0, .Lftrace_stub badr r0, .Lftrace_stub
cmp r0, r2 cmp r0, r2
bne 1f bne 1f
#ifdef CONFIG_FUNCTION_GRAPH_TRACER #ifdef CONFIG_FUNCTION_GRAPH_TRACER
ldr r1, =ftrace_graph_return ldr_va r2, ftrace_graph_return
ldr r2, [r1] cmp r0, r2
cmp r0, r2 bne ftrace_graph_caller\suffix
bne ftrace_graph_caller\suffix
ldr_va r2, ftrace_graph_entry
ldr r1, =ftrace_graph_entry mov_l r0, ftrace_graph_entry_stub
ldr r2, [r1] cmp r0, r2
ldr r0, =ftrace_graph_entry_stub bne ftrace_graph_caller\suffix
cmp r0, r2
bne ftrace_graph_caller\suffix
#endif #endif
mcount_exit mcount_exit
...@@ -87,8 +84,7 @@ ...@@ -87,8 +84,7 @@
mov r3, sp @ struct pt_regs* mov r3, sp @ struct pt_regs*
ldr r2, =function_trace_op ldr_va r2, function_trace_op @ pointer to the current
ldr r2, [r2] @ pointer to the current
@ function tracing op @ function tracing op
ldr r1, [sp, #S_LR] @ lr of instrumented func ldr r1, [sp, #S_LR] @ lr of instrumented func
...@@ -141,8 +137,7 @@ ftrace_graph_regs_call: ...@@ -141,8 +137,7 @@ ftrace_graph_regs_call:
mcount_adjust_addr r0, lr @ instrumented function mcount_adjust_addr r0, lr @ instrumented function
#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
ldr r2, =function_trace_op ldr_va r2, function_trace_op @ pointer to the current
ldr r2, [r2] @ pointer to the current
@ function tracing op @ function tracing op
mov r3, #0 @ regs is NULL mov r3, #0 @ regs is NULL
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment