Lines Matching refs:tr
22 static void tracing_start_function_trace(struct trace_array *tr);
23 static void tracing_stop_function_trace(struct trace_array *tr);
37 static int allocate_ftrace_ops(struct trace_array *tr) in allocate_ftrace_ops() argument
49 tr->ops = ops; in allocate_ftrace_ops()
50 ops->private = tr; in allocate_ftrace_ops()
55 int ftrace_create_function_files(struct trace_array *tr, in ftrace_create_function_files() argument
64 if (tr->flags & TRACE_ARRAY_FL_GLOBAL) in ftrace_create_function_files()
67 ret = allocate_ftrace_ops(tr); in ftrace_create_function_files()
71 ftrace_create_filter_files(tr->ops, parent); in ftrace_create_function_files()
76 void ftrace_destroy_function_files(struct trace_array *tr) in ftrace_destroy_function_files() argument
78 ftrace_destroy_filter_files(tr->ops); in ftrace_destroy_function_files()
79 kfree(tr->ops); in ftrace_destroy_function_files()
80 tr->ops = NULL; in ftrace_destroy_function_files()
83 static int function_trace_init(struct trace_array *tr) in function_trace_init() argument
92 if (!tr->ops) in function_trace_init()
96 if (tr->flags & TRACE_ARRAY_FL_GLOBAL && in function_trace_init()
102 ftrace_init_array_ops(tr, func); in function_trace_init()
104 tr->trace_buffer.cpu = get_cpu(); in function_trace_init()
108 tracing_start_function_trace(tr); in function_trace_init()
112 static void function_trace_reset(struct trace_array *tr) in function_trace_reset() argument
114 tracing_stop_function_trace(tr); in function_trace_reset()
116 ftrace_reset_array_ops(tr); in function_trace_reset()
119 static void function_trace_start(struct trace_array *tr) in function_trace_start() argument
121 tracing_reset_online_cpus(&tr->trace_buffer); in function_trace_start()
128 struct trace_array *tr = op->private; in function_trace_call() local
135 if (unlikely(!tr->function_enabled)) in function_trace_call()
146 data = per_cpu_ptr(tr->trace_buffer.data, cpu); in function_trace_call()
149 trace_function(tr, ip, parent_ip, flags, pc); in function_trace_call()
179 struct trace_array *tr = op->private; in function_stack_trace_call() local
186 if (unlikely(!tr->function_enabled)) in function_stack_trace_call()
195 data = per_cpu_ptr(tr->trace_buffer.data, cpu); in function_stack_trace_call()
200 trace_function(tr, ip, parent_ip, flags, pc); in function_stack_trace_call()
201 __trace_stack(tr, flags, STACK_SKIP, pc); in function_stack_trace_call()
220 static void tracing_start_function_trace(struct trace_array *tr) in tracing_start_function_trace() argument
222 tr->function_enabled = 0; in tracing_start_function_trace()
223 register_ftrace_function(tr->ops); in tracing_start_function_trace()
224 tr->function_enabled = 1; in tracing_start_function_trace()
227 static void tracing_stop_function_trace(struct trace_array *tr) in tracing_stop_function_trace() argument
229 tr->function_enabled = 0; in tracing_stop_function_trace()
230 unregister_ftrace_function(tr->ops); in tracing_stop_function_trace()
236 func_set_flag(struct trace_array *tr, u32 old_flags, u32 bit, int set) in func_set_flag() argument
245 if (tr->current_trace != &function_trace) in func_set_flag()
248 unregister_ftrace_function(tr->ops); in func_set_flag()
251 tr->ops->func = function_stack_trace_call; in func_set_flag()
252 register_ftrace_function(tr->ops); in func_set_flag()
254 tr->ops->func = function_trace_call; in func_set_flag()
255 register_ftrace_function(tr->ops); in func_set_flag()
283 struct trace_array *tr, bool on, in update_traceon_count() argument
328 if (on == !!tracer_tracing_is_on(tr)) in update_traceon_count()
332 tracer_tracing_on(tr); in update_traceon_count()
334 tracer_tracing_off(tr); in update_traceon_count()
344 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceon_count() argument
347 update_traceon_count(ops, ip, tr, 1, data); in ftrace_traceon_count()
352 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceoff_count() argument
355 update_traceon_count(ops, ip, tr, 0, data); in ftrace_traceoff_count()
360 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceon() argument
363 if (tracer_tracing_is_on(tr)) in ftrace_traceon()
366 tracer_tracing_on(tr); in ftrace_traceon()
371 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceoff() argument
374 if (!tracer_tracing_is_on(tr)) in ftrace_traceoff()
377 tracer_tracing_off(tr); in ftrace_traceoff()
402 static __always_inline void trace_stack(struct trace_array *tr) in trace_stack() argument
410 __trace_stack(tr, flags, FTRACE_STACK_SKIP, pc); in trace_stack()
415 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_stacktrace() argument
418 trace_stack(tr); in ftrace_stacktrace()
423 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_stacktrace_count() argument
436 trace_stack(tr); in ftrace_stacktrace_count()
455 trace_stack(tr); in ftrace_stacktrace_count()
483 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_dump_probe() argument
493 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_cpudump_probe() argument
559 ftrace_count_init(struct ftrace_probe_ops *ops, struct trace_array *tr, in ftrace_count_init() argument
575 ftrace_count_free(struct ftrace_probe_ops *ops, struct trace_array *tr, in ftrace_count_free() argument
637 ftrace_trace_probe_callback(struct trace_array *tr, in ftrace_trace_probe_callback() argument
651 return unregister_ftrace_function_probe_func(glob+1, tr, ops); in ftrace_trace_probe_callback()
670 ret = register_ftrace_function_probe(glob, tr, ops, count); in ftrace_trace_probe_callback()
676 ftrace_trace_onoff_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_trace_onoff_callback() argument
681 if (!tr) in ftrace_trace_onoff_callback()
690 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_trace_onoff_callback()
695 ftrace_stacktrace_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_stacktrace_callback() argument
700 if (!tr) in ftrace_stacktrace_callback()
705 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_stacktrace_callback()
710 ftrace_dump_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_dump_callback() argument
715 if (!tr) in ftrace_dump_callback()
721 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_dump_callback()
726 ftrace_cpudump_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_cpudump_callback() argument
731 if (!tr) in ftrace_cpudump_callback()
737 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_cpudump_callback()