Lines Matching refs:tr
21 static void tracing_start_function_trace(struct trace_array *tr);
22 static void tracing_stop_function_trace(struct trace_array *tr);
36 static int allocate_ftrace_ops(struct trace_array *tr) in allocate_ftrace_ops() argument
48 tr->ops = ops; in allocate_ftrace_ops()
49 ops->private = tr; in allocate_ftrace_ops()
54 int ftrace_create_function_files(struct trace_array *tr, in ftrace_create_function_files() argument
63 if (tr->flags & TRACE_ARRAY_FL_GLOBAL) in ftrace_create_function_files()
66 ret = allocate_ftrace_ops(tr); in ftrace_create_function_files()
70 ftrace_create_filter_files(tr->ops, parent); in ftrace_create_function_files()
75 void ftrace_destroy_function_files(struct trace_array *tr) in ftrace_destroy_function_files() argument
77 ftrace_destroy_filter_files(tr->ops); in ftrace_destroy_function_files()
78 kfree(tr->ops); in ftrace_destroy_function_files()
79 tr->ops = NULL; in ftrace_destroy_function_files()
82 static int function_trace_init(struct trace_array *tr) in function_trace_init() argument
91 if (!tr->ops) in function_trace_init()
95 if (tr->flags & TRACE_ARRAY_FL_GLOBAL && in function_trace_init()
101 ftrace_init_array_ops(tr, func); in function_trace_init()
103 tr->trace_buffer.cpu = get_cpu(); in function_trace_init()
107 tracing_start_function_trace(tr); in function_trace_init()
111 static void function_trace_reset(struct trace_array *tr) in function_trace_reset() argument
113 tracing_stop_function_trace(tr); in function_trace_reset()
115 ftrace_reset_array_ops(tr); in function_trace_reset()
118 static void function_trace_start(struct trace_array *tr) in function_trace_start() argument
120 tracing_reset_online_cpus(&tr->trace_buffer); in function_trace_start()
127 struct trace_array *tr = op->private; in function_trace_call() local
134 if (unlikely(!tr->function_enabled)) in function_trace_call()
145 data = per_cpu_ptr(tr->trace_buffer.data, cpu); in function_trace_call()
148 trace_function(tr, ip, parent_ip, flags, pc); in function_trace_call()
160 struct trace_array *tr = op->private; in function_stack_trace_call() local
167 if (unlikely(!tr->function_enabled)) in function_stack_trace_call()
176 data = per_cpu_ptr(tr->trace_buffer.data, cpu); in function_stack_trace_call()
181 trace_function(tr, ip, parent_ip, flags, pc); in function_stack_trace_call()
190 __trace_stack(tr, flags, 5, pc); in function_stack_trace_call()
209 static void tracing_start_function_trace(struct trace_array *tr) in tracing_start_function_trace() argument
211 tr->function_enabled = 0; in tracing_start_function_trace()
212 register_ftrace_function(tr->ops); in tracing_start_function_trace()
213 tr->function_enabled = 1; in tracing_start_function_trace()
216 static void tracing_stop_function_trace(struct trace_array *tr) in tracing_stop_function_trace() argument
218 tr->function_enabled = 0; in tracing_stop_function_trace()
219 unregister_ftrace_function(tr->ops); in tracing_stop_function_trace()
223 func_set_flag(struct trace_array *tr, u32 old_flags, u32 bit, int set) in func_set_flag() argument
231 unregister_ftrace_function(tr->ops); in func_set_flag()
234 tr->ops->func = function_stack_trace_call; in func_set_flag()
235 register_ftrace_function(tr->ops); in func_set_flag()
237 tr->ops->func = function_trace_call; in func_set_flag()
238 register_ftrace_function(tr->ops); in func_set_flag()