aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;