2 * ring buffer based function tracer
4 * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com>
5 * Copyright (C) 2008 Ingo Molnar <mingo@redhat.com>
7 * Based on code from the latency_tracer, that is:
9 * Copyright (C) 2004-2006 Ingo Molnar
10 * Copyright (C) 2004 William Lee Irwin III
13 #include <linux/debugfs.h>
14 #include <linux/uaccess.h>
15 #include <linux/ftrace.h>
19 static notrace void function_reset(struct trace_array *tr)
23 tr->time_start = now(tr->cpu);
25 for_each_online_cpu(cpu)
26 tracing_reset(tr->data[cpu]);
29 static notrace void start_function_trace(struct trace_array *tr)
32 tracing_start_function_trace();
35 static notrace void stop_function_trace(struct trace_array *tr)
37 tracing_stop_function_trace();
40 static notrace void function_trace_init(struct trace_array *tr)
43 start_function_trace(tr);
46 static notrace void function_trace_reset(struct trace_array *tr)
49 stop_function_trace(tr);
52 static notrace void function_trace_ctrl_update(struct trace_array *tr)
55 start_function_trace(tr);
57 stop_function_trace(tr);
60 static struct tracer function_trace __read_mostly =
63 .init = function_trace_init,
64 .reset = function_trace_reset,
65 .ctrl_update = function_trace_ctrl_update,
68 static __init int init_function_trace(void)
70 return register_tracer(&function_trace);
73 device_initcall(init_function_trace);