summaryrefslogtreecommitdiffstats
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 5c95708b9dc..f520aa419df 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)
tracing_off();
}
+static int
+ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip,
+ struct ftrace_hook_ops *ops, void *data);
+
static struct ftrace_hook_ops traceon_hook_ops = {
.func = ftrace_traceon,
+ .print = ftrace_trace_onoff_print,
};
static struct ftrace_hook_ops traceoff_hook_ops = {
.func = ftrace_traceoff,
+ .print = ftrace_trace_onoff_print,
};
static int
+ftrace_trace_onoff_print(struct seq_file *m, unsigned long ip,
+ struct ftrace_hook_ops *ops, void *data)
+{
+ char str[KSYM_SYMBOL_LEN];
+ long count = (long)data;
+
+ kallsyms_lookup(ip, NULL, NULL, NULL, str);
+ seq_printf(m, "%s:", str);
+
+ if (ops == &traceon_hook_ops)
+ seq_printf(m, "traceon");
+ else
+ seq_printf(m, "traceoff");
+
+ if (count != -1)
+ seq_printf(m, ":count=%ld", count);
+ seq_putc(m, '\n');
+
+ return 0;
+}
+
+static int
ftrace_trace_onoff_unreg(char *glob, char *cmd, char *param)
{
struct ftrace_hook_ops *ops;