aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ftrace.h
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-08-16 09:53:39 -0400
committerSteven Rostedt <rostedt@goodmis.org>2011-12-21 07:16:58 -0500
commitc88fd8634ea68e74c7d19fd2621b4078fd22864c (patch)
tree9d8bbc57d20eec9869a9655ff79cc1c4d6359b88 /include/linux/ftrace.h
parent45959ee7aa645815a5ce303a0ea1e48a21e67c6a (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.h31
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 {
133int ftrace_arch_code_modify_prepare(void); 133int ftrace_arch_code_modify_prepare(void);
134int ftrace_arch_code_modify_post_process(void); 134int ftrace_arch_code_modify_post_process(void);
135 135
136void ftrace_bug(int err, unsigned long ip);
137
136struct seq_file; 138struct seq_file;
137 139
138struct ftrace_probe_ops { 140struct ftrace_probe_ops {
@@ -190,6 +192,35 @@ void ftrace_set_global_notrace(unsigned char *buf, int len, int reset);
190int register_ftrace_command(struct ftrace_func_command *cmd); 192int register_ftrace_command(struct ftrace_func_command *cmd);
191int unregister_ftrace_command(struct ftrace_func_command *cmd); 193int unregister_ftrace_command(struct ftrace_func_command *cmd);
192 194
195enum {
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
203enum {
204 FTRACE_UPDATE_IGNORE,
205 FTRACE_UPDATE_MAKE_CALL,
206 FTRACE_UPDATE_MAKE_NOP,
207};
208
209void arch_ftrace_update_code(int command);
210
211struct ftrace_rec_iter;
212
213struct ftrace_rec_iter *ftrace_rec_iter_start(void);
214struct ftrace_rec_iter *ftrace_rec_iter_next(struct ftrace_rec_iter *iter);
215struct dyn_ftrace *ftrace_rec_iter_record(struct ftrace_rec_iter *iter);
216
217int ftrace_update_record(struct dyn_ftrace *rec, int enable);
218int ftrace_test_record(struct dyn_ftrace *rec, int enable);
219void ftrace_run_stop_machine(int command);
220int ftrace_location(unsigned long ip);
221
222extern ftrace_func_t ftrace_trace_function;
223
193/* defined in arch */ 224/* defined in arch */
194extern int ftrace_ip_converted(unsigned long ip); 225extern int ftrace_ip_converted(unsigned long ip);
195extern int ftrace_dyn_arch_init(void *data); 226extern int ftrace_dyn_arch_init(void *data);