diff options
Diffstat (limited to 'arch/arm/kernel/entry-common.S')
-rw-r--r-- | arch/arm/kernel/entry-common.S | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index a0540c9f1f0c..df19e8bf2e4a 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -118,6 +118,25 @@ ftrace_call: | |||
118 | 118 | ||
119 | #else | 119 | #else |
120 | 120 | ||
121 | ENTRY(__gnu_mcount_nc) | ||
122 | stmdb sp!, {r0-r3, lr} | ||
123 | ldr r0, =ftrace_trace_function | ||
124 | ldr r2, [r0] | ||
125 | adr r0, ftrace_stub | ||
126 | cmp r0, r2 | ||
127 | bne gnu_trace | ||
128 | ldmia sp!, {r0-r3, ip, lr} | ||
129 | bx ip | ||
130 | |||
131 | gnu_trace: | ||
132 | ldr r1, [sp, #20] @ lr of instrumented routine | ||
133 | mov r0, lr | ||
134 | sub r0, r0, #MCOUNT_INSN_SIZE | ||
135 | mov lr, pc | ||
136 | mov pc, r2 | ||
137 | ldmia sp!, {r0-r3, ip, lr} | ||
138 | bx ip | ||
139 | |||
121 | ENTRY(mcount) | 140 | ENTRY(mcount) |
122 | stmdb sp!, {r0-r3, lr} | 141 | stmdb sp!, {r0-r3, lr} |
123 | ldr r0, =ftrace_trace_function | 142 | ldr r0, =ftrace_trace_function |