diff options
-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; |