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 int ftrace_allocate_ftrace_ops(struct trace_array *tr) in ftrace_allocate_ftrace_ops() argument
42 if (tr->flags & TRACE_ARRAY_FL_GLOBAL) in ftrace_allocate_ftrace_ops()
53 tr->ops = ops; in ftrace_allocate_ftrace_ops()
54 ops->private = tr; in ftrace_allocate_ftrace_ops()
59 void ftrace_free_ftrace_ops(struct trace_array *tr) in ftrace_free_ftrace_ops() argument
61 kfree(tr->ops); in ftrace_free_ftrace_ops()
62 tr->ops = NULL; in ftrace_free_ftrace_ops()
65 int ftrace_create_function_files(struct trace_array *tr, in ftrace_create_function_files() argument
72 if (tr->flags & TRACE_ARRAY_FL_GLOBAL) in ftrace_create_function_files()
75 if (!tr->ops) in ftrace_create_function_files()
78 ftrace_create_filter_files(tr->ops, parent); in ftrace_create_function_files()
83 void ftrace_destroy_function_files(struct trace_array *tr) in ftrace_destroy_function_files() argument
85 ftrace_destroy_filter_files(tr->ops); in ftrace_destroy_function_files()
86 ftrace_free_ftrace_ops(tr); in ftrace_destroy_function_files()
89 static int function_trace_init(struct trace_array *tr) in function_trace_init() argument
98 if (!tr->ops) in function_trace_init()
102 if (tr->flags & TRACE_ARRAY_FL_GLOBAL && in function_trace_init()
108 ftrace_init_array_ops(tr, func); in function_trace_init()
110 tr->array_buffer.cpu = get_cpu(); in function_trace_init()
114 tracing_start_function_trace(tr); in function_trace_init()
118 static void function_trace_reset(struct trace_array *tr) in function_trace_reset() argument
120 tracing_stop_function_trace(tr); in function_trace_reset()
122 ftrace_reset_array_ops(tr); in function_trace_reset()
125 static void function_trace_start(struct trace_array *tr) in function_trace_start() argument
127 tracing_reset_online_cpus(&tr->array_buffer); in function_trace_start()
134 struct trace_array *tr = op->private; in function_trace_call() local
141 if (unlikely(!tr->function_enabled)) in function_trace_call()
152 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_trace_call()
155 trace_function(tr, ip, parent_ip, flags, pc); in function_trace_call()
185 struct trace_array *tr = op->private; in function_stack_trace_call() local
192 if (unlikely(!tr->function_enabled)) in function_stack_trace_call()
201 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_stack_trace_call()
206 trace_function(tr, ip, parent_ip, flags, pc); in function_stack_trace_call()
207 __trace_stack(tr, flags, STACK_SKIP, pc); in function_stack_trace_call()
226 static void tracing_start_function_trace(struct trace_array *tr) in tracing_start_function_trace() argument
228 tr->function_enabled = 0; in tracing_start_function_trace()
229 register_ftrace_function(tr->ops); in tracing_start_function_trace()
230 tr->function_enabled = 1; in tracing_start_function_trace()
233 static void tracing_stop_function_trace(struct trace_array *tr) in tracing_stop_function_trace() argument
235 tr->function_enabled = 0; in tracing_stop_function_trace()
236 unregister_ftrace_function(tr->ops); in tracing_stop_function_trace()
242 func_set_flag(struct trace_array *tr, u32 old_flags, u32 bit, int set) in func_set_flag() argument
251 if (tr->current_trace != &function_trace) in func_set_flag()
254 unregister_ftrace_function(tr->ops); in func_set_flag()
257 tr->ops->func = function_stack_trace_call; in func_set_flag()
258 register_ftrace_function(tr->ops); in func_set_flag()
260 tr->ops->func = function_trace_call; in func_set_flag()
261 register_ftrace_function(tr->ops); in func_set_flag()
289 struct trace_array *tr, bool on, in update_traceon_count() argument
334 if (on == !!tracer_tracing_is_on(tr)) in update_traceon_count()
338 tracer_tracing_on(tr); in update_traceon_count()
340 tracer_tracing_off(tr); in update_traceon_count()
350 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceon_count() argument
353 update_traceon_count(ops, ip, tr, 1, data); in ftrace_traceon_count()
358 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceoff_count() argument
361 update_traceon_count(ops, ip, tr, 0, data); in ftrace_traceoff_count()
366 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceon() argument
369 if (tracer_tracing_is_on(tr)) in ftrace_traceon()
372 tracer_tracing_on(tr); in ftrace_traceon()
377 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceoff() argument
380 if (!tracer_tracing_is_on(tr)) in ftrace_traceoff()
383 tracer_tracing_off(tr); in ftrace_traceoff()
408 static __always_inline void trace_stack(struct trace_array *tr) in trace_stack() argument
416 __trace_stack(tr, flags, FTRACE_STACK_SKIP, pc); in trace_stack()
421 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_stacktrace() argument
424 trace_stack(tr); in ftrace_stacktrace()
429 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_stacktrace_count() argument
442 trace_stack(tr); in ftrace_stacktrace_count()
461 trace_stack(tr); in ftrace_stacktrace_count()
489 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_dump_probe() argument
499 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_cpudump_probe() argument
565 ftrace_count_init(struct ftrace_probe_ops *ops, struct trace_array *tr, in ftrace_count_init() argument
581 ftrace_count_free(struct ftrace_probe_ops *ops, struct trace_array *tr, in ftrace_count_free() argument
643 ftrace_trace_probe_callback(struct trace_array *tr, in ftrace_trace_probe_callback() argument
657 return unregister_ftrace_function_probe_func(glob+1, tr, ops); in ftrace_trace_probe_callback()
676 ret = register_ftrace_function_probe(glob, tr, ops, count); in ftrace_trace_probe_callback()
682 ftrace_trace_onoff_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_trace_onoff_callback() argument
687 if (!tr) in ftrace_trace_onoff_callback()
696 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_trace_onoff_callback()
701 ftrace_stacktrace_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_stacktrace_callback() argument
706 if (!tr) in ftrace_stacktrace_callback()
711 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_stacktrace_callback()
716 ftrace_dump_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_dump_callback() argument
721 if (!tr) in ftrace_dump_callback()
727 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_dump_callback()
732 ftrace_cpudump_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_cpudump_callback() argument
737 if (!tr) in ftrace_cpudump_callback()
743 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_cpudump_callback()