diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-02-16 23:38:13 -0500 |
---|---|---|
committer | Steven Rostedt <srostedt@redhat.com> | 2009-02-16 23:38:13 -0500 |
commit | e110e3d1eaa0f9628918be67ddd32e8ad65a2871 (patch) | |
tree | f51fcc118da53c2f7a8dc7ed028a7ed5380c9706 /kernel/trace/trace_functions.c | |
parent | 809dcf29ce4e1723709910878e050bd187617e0e (diff) |
ftrace: add pretty print function for traceon and traceoff hooks
This patch adds a pretty print version of traceon and traceoff
output for set_ftrace_filter.
# echo 'sys_open:traceon:4' > set_ftrace_filter
# cat set_ftrace_filter
#### all functions enabled ####
sys_open:traceon:count=4
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel/trace/trace_functions.c')
-rw-r--r-- | kernel/trace/trace_functions.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/kernel/trace/trace_functions.c b/kernel/trace/trace_functions.c index 5c95708b9dc3..f520aa419dff 100644 --- a/kernel/trace/trace_functions.c +++ b/kernel/trace/trace_functions.c | |||
@@ -267,15 +267,43 @@ ftrace_traceoff(unsigned long ip, unsigned long parent_ip, void **data) | |||
267 | tracing_off(); | 267 | tracing_off(); |
268 | } | 268 | } |
269 | 269 | ||
270 | static int | ||
271 | ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, | ||
272 | struct ftrace_hook_ops *ops, void *data); | ||
273 | |||
270 | static struct ftrace_hook_ops traceon_hook_ops = { | 274 | static struct ftrace_hook_ops traceon_hook_ops = { |
271 | .func = ftrace_traceon, | 275 | .func = ftrace_traceon, |
276 | .print = ftrace_trace_onoff_print, | ||
272 | }; | 277 | }; |
273 | 278 | ||
274 | static struct ftrace_hook_ops traceoff_hook_ops = { | 279 | static struct ftrace_hook_ops traceoff_hook_ops = { |
275 | .func = ftrace_traceoff, | 280 | .func = ftrace_traceoff, |
281 | .print = ftrace_trace_onoff_print, | ||
276 | }; | 282 | }; |
277 | 283 | ||
278 | static int | 284 | static int |
285 | ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip, | ||
286 | struct ftrace_hook_ops *ops, void *data) | ||
287 | { | ||
288 | char str[KSYM_SYMBOL_LEN]; | ||
289 | long count = (long)data; | ||
290 | |||
291 | kallsyms_lookup(ip, NULL, NULL, NULL, str); | ||
292 | seq_printf(m, "%s:", str); | ||
293 | |||
294 | if (ops == &traceon_hook_ops) | ||
295 | seq_printf(m, "traceon"); | ||
296 | else | ||
297 | seq_printf(m, "traceoff"); | ||
298 | |||
299 | if (count != -1) | ||
300 | seq_printf(m, ":count=%ld", count); | ||
301 | seq_putc(m, '\n'); | ||
302 | |||
303 | return 0; | ||
304 | } | ||
305 | |||
306 | static int | ||
279 | ftrace_trace_onoff_unreg(char *glob, char *cmd, char *param) | 307 | ftrace_trace_onoff_unreg(char *glob, char *cmd, char *param) |
280 | { | 308 | { |
281 | struct ftrace_hook_ops *ops; | 309 | struct ftrace_hook_ops *ops; |