diff options
Diffstat (limited to 'arch/x86/kernel/entry_32.S')
-rw-r--r-- | arch/x86/kernel/entry_32.S | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index 9134de814c97..9a0ac85946db 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -1188,6 +1188,10 @@ ENTRY(mcount) | |||
1188 | 1188 | ||
1189 | cmpl $ftrace_stub, ftrace_trace_function | 1189 | cmpl $ftrace_stub, ftrace_trace_function |
1190 | jnz trace | 1190 | jnz trace |
1191 | #ifdef CONFIG_FUNCTION_RET_TRACER | ||
1192 | cmpl $ftrace_stub, ftrace_function_return | ||
1193 | jnz trace_return | ||
1194 | #endif | ||
1191 | .globl ftrace_stub | 1195 | .globl ftrace_stub |
1192 | ftrace_stub: | 1196 | ftrace_stub: |
1193 | ret | 1197 | ret |
@@ -1206,8 +1210,37 @@ trace: | |||
1206 | popl %edx | 1210 | popl %edx |
1207 | popl %ecx | 1211 | popl %ecx |
1208 | popl %eax | 1212 | popl %eax |
1213 | jmp ftrace_stub | ||
1209 | 1214 | ||
1215 | #ifdef CONFIG_FUNCTION_RET_TRACER | ||
1216 | trace_return: | ||
1217 | pushl %eax | ||
1218 | pushl %ecx | ||
1219 | pushl %edx | ||
1220 | movl 0xc(%esp), %eax | ||
1221 | pushl %eax | ||
1222 | lea 0x4(%ebp), %eax | ||
1223 | pushl %eax | ||
1224 | call prepare_ftrace_return | ||
1225 | addl $8, %esp | ||
1226 | popl %edx | ||
1227 | popl %ecx | ||
1228 | popl %eax | ||
1210 | jmp ftrace_stub | 1229 | jmp ftrace_stub |
1230 | |||
1231 | .globl return_to_handler | ||
1232 | return_to_handler: | ||
1233 | pushl $0 | ||
1234 | pushl %eax | ||
1235 | pushl %ecx | ||
1236 | pushl %edx | ||
1237 | call ftrace_return_to_handler | ||
1238 | movl %eax, 0xc(%esp) | ||
1239 | popl %edx | ||
1240 | popl %ecx | ||
1241 | popl %eax | ||
1242 | ret | ||
1243 | #endif /* CONFIG_FUNCTION_RET_TRACER */ | ||
1211 | END(mcount) | 1244 | END(mcount) |
1212 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 1245 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
1213 | #endif /* CONFIG_FUNCTION_TRACER */ | 1246 | #endif /* CONFIG_FUNCTION_TRACER */ |