diff options
author | Steven Rostedt <srostedt@redhat.com> | 2011-12-19 14:41:25 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2011-12-21 07:25:06 -0500 |
commit | fc13cb0ce45296f331263a6034aa1814203e1ac3 (patch) | |
tree | 2c66d6296ee01bcbd27cb9df4b72885339300ba6 /include/linux/ftrace.h | |
parent | 06a51d9307380c78bb5c92e68fc80ad2c7d7f890 (diff) |
ftrace: Allow other users of function tracing to use the output listing
The function tracer is set up to allow any other subsystem (like perf)
to use it. Ftrace already has a way to list what functions are enabled
by the global_ops. It would be very helpful to let other users of
the function tracer to be able to use the same code.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r-- | include/linux/ftrace.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 31b9fd7aedcd..aa7559f0a224 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -202,6 +202,14 @@ enum { | |||
202 | FTRACE_UPDATE_MAKE_NOP, | 202 | FTRACE_UPDATE_MAKE_NOP, |
203 | }; | 203 | }; |
204 | 204 | ||
205 | enum { | ||
206 | FTRACE_ITER_FILTER = (1 << 0), | ||
207 | FTRACE_ITER_NOTRACE = (1 << 1), | ||
208 | FTRACE_ITER_PRINTALL = (1 << 2), | ||
209 | FTRACE_ITER_HASH = (1 << 3), | ||
210 | FTRACE_ITER_ENABLED = (1 << 4), | ||
211 | }; | ||
212 | |||
205 | void arch_ftrace_update_code(int command); | 213 | void arch_ftrace_update_code(int command); |
206 | 214 | ||
207 | struct ftrace_rec_iter; | 215 | struct ftrace_rec_iter; |
@@ -217,6 +225,15 @@ int ftrace_location(unsigned long ip); | |||
217 | 225 | ||
218 | extern ftrace_func_t ftrace_trace_function; | 226 | extern ftrace_func_t ftrace_trace_function; |
219 | 227 | ||
228 | int ftrace_regex_open(struct ftrace_ops *ops, int flag, | ||
229 | struct inode *inode, struct file *file); | ||
230 | ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf, | ||
231 | size_t cnt, loff_t *ppos); | ||
232 | ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, | ||
233 | size_t cnt, loff_t *ppos); | ||
234 | loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin); | ||
235 | int ftrace_regex_release(struct inode *inode, struct file *file); | ||
236 | |||
220 | /* defined in arch */ | 237 | /* defined in arch */ |
221 | extern int ftrace_ip_converted(unsigned long ip); | 238 | extern int ftrace_ip_converted(unsigned long ip); |
222 | extern int ftrace_dyn_arch_init(void *data); | 239 | extern int ftrace_dyn_arch_init(void *data); |
@@ -311,6 +328,24 @@ static inline int ftrace_text_reserved(void *start, void *end) | |||
311 | { | 328 | { |
312 | return 0; | 329 | return 0; |
313 | } | 330 | } |
331 | |||
332 | /* | ||
333 | * Again users of functions that have ftrace_ops may not | ||
334 | * have them defined when ftrace is not enabled, but these | ||
335 | * functions may still be called. Use a macro instead of inline. | ||
336 | */ | ||
337 | #define ftrace_regex_open(ops, flag, inod, file) ({ -ENODEV; }) | ||
338 | |||
339 | static inline ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf, | ||
340 | size_t cnt, loff_t *ppos) { return -ENODEV; } | ||
341 | static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, | ||
342 | size_t cnt, loff_t *ppos) { return -ENODEV; } | ||
343 | static inline loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin) | ||
344 | { | ||
345 | return -ENODEV; | ||
346 | } | ||
347 | static inline int | ||
348 | ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } | ||
314 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 349 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
315 | 350 | ||
316 | /* totally disable ftrace - can not re-enable after this */ | 351 | /* totally disable ftrace - can not re-enable after this */ |