aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ftrace.h
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2011-12-19 14:41:25 -0500
committerSteven Rostedt <rostedt@goodmis.org>2011-12-21 07:25:06 -0500
commitfc13cb0ce45296f331263a6034aa1814203e1ac3 (patch)
tree2c66d6296ee01bcbd27cb9df4b72885339300ba6 /include/linux/ftrace.h
parent06a51d9307380c78bb5c92e68fc80ad2c7d7f890 (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.h35
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
205enum {
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
205void arch_ftrace_update_code(int command); 213void arch_ftrace_update_code(int command);
206 214
207struct ftrace_rec_iter; 215struct ftrace_rec_iter;
@@ -217,6 +225,15 @@ int ftrace_location(unsigned long ip);
217 225
218extern ftrace_func_t ftrace_trace_function; 226extern ftrace_func_t ftrace_trace_function;
219 227
228int ftrace_regex_open(struct ftrace_ops *ops, int flag,
229 struct inode *inode, struct file *file);
230ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf,
231 size_t cnt, loff_t *ppos);
232ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
233 size_t cnt, loff_t *ppos);
234loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin);
235int ftrace_regex_release(struct inode *inode, struct file *file);
236
220/* defined in arch */ 237/* defined in arch */
221extern int ftrace_ip_converted(unsigned long ip); 238extern int ftrace_ip_converted(unsigned long ip);
222extern int ftrace_dyn_arch_init(void *data); 239extern 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
339static inline ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf,
340 size_t cnt, loff_t *ppos) { return -ENODEV; }
341static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
342 size_t cnt, loff_t *ppos) { return -ENODEV; }
343static inline loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin)
344{
345 return -ENODEV;
346}
347static inline int
348ftrace_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 */