diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-08-16 09:53:39 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-12-21 07:16:58 -0500 |
commit | c88fd8634ea68e74c7d19fd2621b4078fd22864c (patch) | |
tree | 9d8bbc57d20eec9869a9655ff79cc1c4d6359b88 /include/linux/ftrace.h | |
parent | 45959ee7aa645815a5ce303a0ea1e48a21e67c6a (diff) |
ftrace: Allow archs to modify code without stop machine
The stop machine method to modify all functions in the kernel
(some 20,000 of them) is the safest way to do so across all archs.
But some archs may not need this big hammer approach to modify code
on SMP machines, and can simply just update the code it needs.
Adding a weak function arch_ftrace_update_code() that now does the
stop machine, will also let any arch override this method.
If the arch needs to check the system and then decide if it can
avoid stop machine, it can still call ftrace_run_stop_machine() to
use the old method.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r-- | include/linux/ftrace.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 26eafcef75be..4f0b6fec379d 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -133,6 +133,8 @@ struct ftrace_func_command { | |||
133 | int ftrace_arch_code_modify_prepare(void); | 133 | int ftrace_arch_code_modify_prepare(void); |
134 | int ftrace_arch_code_modify_post_process(void); | 134 | int ftrace_arch_code_modify_post_process(void); |
135 | 135 | ||
136 | void ftrace_bug(int err, unsigned long ip); | ||
137 | |||
136 | struct seq_file; | 138 | struct seq_file; |
137 | 139 | ||
138 | struct ftrace_probe_ops { | 140 | struct ftrace_probe_ops { |
@@ -190,6 +192,35 @@ void ftrace_set_global_notrace(unsigned char *buf, int len, int reset); | |||
190 | int register_ftrace_command(struct ftrace_func_command *cmd); | 192 | int register_ftrace_command(struct ftrace_func_command *cmd); |
191 | int unregister_ftrace_command(struct ftrace_func_command *cmd); | 193 | int unregister_ftrace_command(struct ftrace_func_command *cmd); |
192 | 194 | ||
195 | enum { | ||
196 | FTRACE_UPDATE_CALLS = (1 << 0), | ||
197 | FTRACE_DISABLE_CALLS = (1 << 1), | ||
198 | FTRACE_UPDATE_TRACE_FUNC = (1 << 2), | ||
199 | FTRACE_START_FUNC_RET = (1 << 3), | ||
200 | FTRACE_STOP_FUNC_RET = (1 << 4), | ||
201 | }; | ||
202 | |||
203 | enum { | ||
204 | FTRACE_UPDATE_IGNORE, | ||
205 | FTRACE_UPDATE_MAKE_CALL, | ||
206 | FTRACE_UPDATE_MAKE_NOP, | ||
207 | }; | ||
208 | |||
209 | void arch_ftrace_update_code(int command); | ||
210 | |||
211 | struct ftrace_rec_iter; | ||
212 | |||
213 | struct ftrace_rec_iter *ftrace_rec_iter_start(void); | ||
214 | struct ftrace_rec_iter *ftrace_rec_iter_next(struct ftrace_rec_iter *iter); | ||
215 | struct dyn_ftrace *ftrace_rec_iter_record(struct ftrace_rec_iter *iter); | ||
216 | |||
217 | int ftrace_update_record(struct dyn_ftrace *rec, int enable); | ||
218 | int ftrace_test_record(struct dyn_ftrace *rec, int enable); | ||
219 | void ftrace_run_stop_machine(int command); | ||
220 | int ftrace_location(unsigned long ip); | ||
221 | |||
222 | extern ftrace_func_t ftrace_trace_function; | ||
223 | |||
193 | /* defined in arch */ | 224 | /* defined in arch */ |
194 | extern int ftrace_ip_converted(unsigned long ip); | 225 | extern int ftrace_ip_converted(unsigned long ip); |
195 | extern int ftrace_dyn_arch_init(void *data); | 226 | extern int ftrace_dyn_arch_init(void *data); |