diff options
Diffstat (limited to 'arch/mips/kernel/mcount.S')
-rw-r--r-- | arch/mips/kernel/mcount.S | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S index cbb45edad464..ffc425979d4f 100644 --- a/arch/mips/kernel/mcount.S +++ b/arch/mips/kernel/mcount.S | |||
@@ -58,6 +58,33 @@ | |||
58 | move ra, AT | 58 | move ra, AT |
59 | .endm | 59 | .endm |
60 | 60 | ||
61 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
62 | |||
63 | NESTED(ftrace_caller, PT_SIZE, ra) | ||
64 | .globl _mcount | ||
65 | _mcount: | ||
66 | b ftrace_stub | ||
67 | nop | ||
68 | lw t0, function_trace_stop | ||
69 | bnez t0, ftrace_stub | ||
70 | nop | ||
71 | |||
72 | MCOUNT_SAVE_REGS | ||
73 | |||
74 | move a0, ra /* arg1: next ip, selfaddr */ | ||
75 | .globl ftrace_call | ||
76 | ftrace_call: | ||
77 | nop /* a placeholder for the call to a real tracing function */ | ||
78 | move a1, AT /* arg2: the caller's next ip, parent */ | ||
79 | |||
80 | MCOUNT_RESTORE_REGS | ||
81 | .globl ftrace_stub | ||
82 | ftrace_stub: | ||
83 | RETURN_BACK | ||
84 | END(ftrace_caller) | ||
85 | |||
86 | #else /* ! CONFIG_DYNAMIC_FTRACE */ | ||
87 | |||
61 | NESTED(_mcount, PT_SIZE, ra) | 88 | NESTED(_mcount, PT_SIZE, ra) |
62 | lw t0, function_trace_stop | 89 | lw t0, function_trace_stop |
63 | bnez t0, ftrace_stub | 90 | bnez t0, ftrace_stub |
@@ -82,5 +109,7 @@ ftrace_stub: | |||
82 | RETURN_BACK | 109 | RETURN_BACK |
83 | END(_mcount) | 110 | END(_mcount) |
84 | 111 | ||
112 | #endif /* ! CONFIG_DYNAMIC_FTRACE */ | ||
113 | |||
85 | .set at | 114 | .set at |
86 | .set reorder | 115 | .set reorder |