aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/kernel/mcount.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/microblaze/kernel/mcount.S')
-rw-r--r--arch/microblaze/kernel/mcount.S41
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/microblaze/kernel/mcount.S b/arch/microblaze/kernel/mcount.S
index 30aaf8fb55b2..84a19458c74d 100644
--- a/arch/microblaze/kernel/mcount.S
+++ b/arch/microblaze/kernel/mcount.S
@@ -96,6 +96,27 @@ ENTRY(ftrace_caller)
96 bneid r5, end; 96 bneid r5, end;
97 nop; 97 nop;
98 /* MS: HAVE_FUNCTION_TRACE_MCOUNT_TEST end of checking */ 98 /* MS: HAVE_FUNCTION_TRACE_MCOUNT_TEST end of checking */
99#ifdef CONFIG_FUNCTION_GRAPH_TRACER
100 lwi r5, r0, ftrace_graph_return;
101 addik r6, r0, ftrace_stub; /* asm implementation */
102 cmpu r5, r5, r6; /* ftrace_graph_return != ftrace_stub */
103 beqid r5, end_graph_tracer;
104 nop;
105
106 lwi r6, r0, ftrace_graph_entry;
107 addik r5, r0, ftrace_graph_entry_stub; /* implemented in C */
108 cmpu r5, r5, r6; /* ftrace_graph_entry != ftrace_graph_entry_stub */
109 beqid r5, end_graph_tracer;
110 nop;
111 addik r5, r1, 120; /* MS: load parent addr */
112 addik r6, r15, 0; /* MS: load current function addr */
113 bralid r15, prepare_ftrace_return;
114 nop;
115 /* MS: graph was taken that's why - can jump over function trace */
116 brid end;
117 nop;
118end_graph_tracer:
119#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
99#ifndef CONFIG_DYNAMIC_FTRACE 120#ifndef CONFIG_DYNAMIC_FTRACE
100 /* MS: test function trace if is taken or not */ 121 /* MS: test function trace if is taken or not */
101 lwi r20, r0, ftrace_trace_function; 122 lwi r20, r0, ftrace_trace_function;
@@ -121,3 +142,23 @@ end:
121 142
122 rtsd r15, 8; /* MS: jump back */ 143 rtsd r15, 8; /* MS: jump back */
123 nop; 144 nop;
145
146#ifdef CONFIG_FUNCTION_GRAPH_TRACER
147ENTRY(return_to_handler)
148 nop; /* MS: just barrier for rtsd r15, 8 */
149 nop;
150 SAVE_REGS
151 swi r15, r1, 0;
152
153 /* MS: find out returning address */
154 bralid r15, ftrace_return_to_handler;
155 nop;
156
157 /* MS: return value from ftrace_return_to_handler is my returning addr
158 * must be before restore regs because I have to restore r3 content */
159 addik r15, r3, 0;
160 RESTORE_REGS
161
162 rtsd r15, 8; /* MS: jump back */
163 nop;
164#endif /* CONFIG_FUNCTION_TRACER */