diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-17 05:31:01 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-17 05:31:01 -0500 |
commit | f492d3f8385a98f828e8220d14492337dc29e07b (patch) | |
tree | 31f22c83f7e45388955aacb45c425d7cb6a4d78c /include/linux/ftrace.h | |
parent | c4e2b432d5b57e2faaeea048079b31c243079647 (diff) | |
parent | e110e3d1eaa0f9628918be67ddd32e8ad65a2871 (diff) |
Merge branch 'tip/tracing/ftrace' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/ftrace
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r-- | include/linux/ftrace.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 106b7909d500..b331e216d8a1 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -95,10 +95,41 @@ stack_trace_sysctl(struct ctl_table *table, int write, | |||
95 | loff_t *ppos); | 95 | loff_t *ppos); |
96 | #endif | 96 | #endif |
97 | 97 | ||
98 | struct ftrace_func_command { | ||
99 | struct list_head list; | ||
100 | char *name; | ||
101 | int (*func)(char *func, char *cmd, | ||
102 | char *params, int enable); | ||
103 | }; | ||
104 | |||
98 | #ifdef CONFIG_DYNAMIC_FTRACE | 105 | #ifdef CONFIG_DYNAMIC_FTRACE |
99 | /* asm/ftrace.h must be defined for archs supporting dynamic ftrace */ | 106 | /* asm/ftrace.h must be defined for archs supporting dynamic ftrace */ |
100 | #include <asm/ftrace.h> | 107 | #include <asm/ftrace.h> |
101 | 108 | ||
109 | struct seq_file; | ||
110 | |||
111 | struct ftrace_hook_ops { | ||
112 | void (*func)(unsigned long ip, | ||
113 | unsigned long parent_ip, | ||
114 | void **data); | ||
115 | int (*callback)(unsigned long ip, void **data); | ||
116 | void (*free)(void **data); | ||
117 | int (*print)(struct seq_file *m, | ||
118 | unsigned long ip, | ||
119 | struct ftrace_hook_ops *ops, | ||
120 | void *data); | ||
121 | }; | ||
122 | |||
123 | extern int | ||
124 | register_ftrace_function_hook(char *glob, struct ftrace_hook_ops *ops, | ||
125 | void *data); | ||
126 | extern void | ||
127 | unregister_ftrace_function_hook(char *glob, struct ftrace_hook_ops *ops, | ||
128 | void *data); | ||
129 | extern void | ||
130 | unregister_ftrace_function_hook_func(char *glob, struct ftrace_hook_ops *ops); | ||
131 | extern void unregister_ftrace_function_hook_all(char *glob); | ||
132 | |||
102 | enum { | 133 | enum { |
103 | FTRACE_FL_FREE = (1 << 0), | 134 | FTRACE_FL_FREE = (1 << 0), |
104 | FTRACE_FL_FAILED = (1 << 1), | 135 | FTRACE_FL_FAILED = (1 << 1), |
@@ -119,6 +150,9 @@ struct dyn_ftrace { | |||
119 | int ftrace_force_update(void); | 150 | int ftrace_force_update(void); |
120 | void ftrace_set_filter(unsigned char *buf, int len, int reset); | 151 | void ftrace_set_filter(unsigned char *buf, int len, int reset); |
121 | 152 | ||
153 | int register_ftrace_command(struct ftrace_func_command *cmd); | ||
154 | int unregister_ftrace_command(struct ftrace_func_command *cmd); | ||
155 | |||
122 | /* defined in arch */ | 156 | /* defined in arch */ |
123 | extern int ftrace_ip_converted(unsigned long ip); | 157 | extern int ftrace_ip_converted(unsigned long ip); |
124 | extern int ftrace_dyn_arch_init(void *data); | 158 | extern int ftrace_dyn_arch_init(void *data); |
@@ -202,6 +236,12 @@ extern void ftrace_enable_daemon(void); | |||
202 | # define ftrace_disable_daemon() do { } while (0) | 236 | # define ftrace_disable_daemon() do { } while (0) |
203 | # define ftrace_enable_daemon() do { } while (0) | 237 | # define ftrace_enable_daemon() do { } while (0) |
204 | static inline void ftrace_release(void *start, unsigned long size) { } | 238 | static inline void ftrace_release(void *start, unsigned long size) { } |
239 | static inline int register_ftrace_command(struct ftrace_func_command *cmd) | ||
240 | { | ||
241 | } | ||
242 | static inline int unregister_ftrace_command(char *cmd_name) | ||
243 | { | ||
244 | } | ||
205 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 245 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
206 | 246 | ||
207 | /* totally disable ftrace - can not re-enable after this */ | 247 | /* totally disable ftrace - can not re-enable after this */ |