aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-02-16 23:38:13 -0500
committerSteven Rostedt <srostedt@redhat.com>2009-02-16 23:38:13 -0500
commite110e3d1eaa0f9628918be67ddd32e8ad65a2871 (patch)
treef51fcc118da53c2f7a8dc7ed028a7ed5380c9706 /kernel/trace
parent809dcf29ce4e1723709910878e050bd187617e0e (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')
-rw-r--r--kernel/trace/trace_functions.c28
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
270static int
271ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip,
272 struct ftrace_hook_ops *ops, void *data);
273
270static struct ftrace_hook_ops traceon_hook_ops = { 274static 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
274static struct ftrace_hook_ops traceoff_hook_ops = { 279static 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
278static int 284static int
285ftrace_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
306static int
279ftrace_trace_onoff_unreg(char *glob, char *cmd, char *param) 307ftrace_trace_onoff_unreg(char *glob, char *cmd, char *param)
280{ 308{
281 struct ftrace_hook_ops *ops; 309 struct ftrace_hook_ops *ops;