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);
52 int ftrace_allocate_ftrace_ops(struct trace_array *tr) in ftrace_allocate_ftrace_ops() argument
57 if (tr->flags & TRACE_ARRAY_FL_GLOBAL) in ftrace_allocate_ftrace_ops()
68 tr->ops = ops; in ftrace_allocate_ftrace_ops()
69 ops->private = tr; in ftrace_allocate_ftrace_ops()
74 void ftrace_free_ftrace_ops(struct trace_array *tr) in ftrace_free_ftrace_ops() argument
76 kfree(tr->ops); in ftrace_free_ftrace_ops()
77 tr->ops = NULL; in ftrace_free_ftrace_ops()
80 int ftrace_create_function_files(struct trace_array *tr, in ftrace_create_function_files() argument
87 if (tr->flags & TRACE_ARRAY_FL_GLOBAL) in ftrace_create_function_files()
90 if (!tr->ops) in ftrace_create_function_files()
93 ftrace_create_filter_files(tr->ops, parent); in ftrace_create_function_files()
98 void ftrace_destroy_function_files(struct trace_array *tr) in ftrace_destroy_function_files() argument
100 ftrace_destroy_filter_files(tr->ops); in ftrace_destroy_function_files()
101 ftrace_free_ftrace_ops(tr); in ftrace_destroy_function_files()
120 static bool handle_func_repeats(struct trace_array *tr, u32 flags_val) in handle_func_repeats() argument
122 if (!tr->last_func_repeats && in handle_func_repeats()
124 tr->last_func_repeats = alloc_percpu(struct trace_func_repeats); in handle_func_repeats()
125 if (!tr->last_func_repeats) in handle_func_repeats()
132 static int function_trace_init(struct trace_array *tr) in function_trace_init() argument
140 if (!tr->ops) in function_trace_init()
147 if (!handle_func_repeats(tr, func_flags.val)) in function_trace_init()
150 ftrace_init_array_ops(tr, func); in function_trace_init()
152 tr->array_buffer.cpu = raw_smp_processor_id(); in function_trace_init()
155 tracing_start_function_trace(tr); in function_trace_init()
159 static void function_trace_reset(struct trace_array *tr) in function_trace_reset() argument
161 tracing_stop_function_trace(tr); in function_trace_reset()
163 ftrace_reset_array_ops(tr); in function_trace_reset()
166 static void function_trace_start(struct trace_array *tr) in function_trace_start() argument
168 tracing_reset_online_cpus(&tr->array_buffer); in function_trace_start()
175 struct trace_array *tr = op->private; in function_trace_call() local
181 if (unlikely(!tr->function_enabled)) in function_trace_call()
191 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_trace_call()
193 trace_function(tr, ip, parent_ip, trace_ctx); in function_trace_call()
220 struct trace_array *tr = op->private; in function_stack_trace_call() local
227 if (unlikely(!tr->function_enabled)) in function_stack_trace_call()
236 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_stack_trace_call()
241 trace_function(tr, ip, parent_ip, trace_ctx); in function_stack_trace_call()
242 __trace_stack(tr, trace_ctx, STACK_SKIP); in function_stack_trace_call()
249 static inline bool is_repeat_check(struct trace_array *tr, in is_repeat_check() argument
257 ring_buffer_time_stamp(tr->array_buffer.buffer); in is_repeat_check()
265 static inline void process_repeats(struct trace_array *tr, in process_repeats() argument
271 trace_last_func_repeats(tr, last_info, trace_ctx); in process_repeats()
285 struct trace_array *tr = op->private; in function_no_repeats_trace_call() local
292 if (unlikely(!tr->function_enabled)) in function_no_repeats_trace_call()
300 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_no_repeats_trace_call()
311 last_info = per_cpu_ptr(tr->last_func_repeats, cpu); in function_no_repeats_trace_call()
312 if (is_repeat_check(tr, last_info, ip, parent_ip)) in function_no_repeats_trace_call()
317 process_repeats(tr, ip, parent_ip, last_info, trace_ctx); in function_no_repeats_trace_call()
319 trace_function(tr, ip, parent_ip, trace_ctx); in function_no_repeats_trace_call()
331 struct trace_array *tr = op->private; in function_stack_no_repeats_trace_call() local
338 if (unlikely(!tr->function_enabled)) in function_stack_no_repeats_trace_call()
347 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_stack_no_repeats_trace_call()
351 last_info = per_cpu_ptr(tr->last_func_repeats, cpu); in function_stack_no_repeats_trace_call()
352 if (is_repeat_check(tr, last_info, ip, parent_ip)) in function_stack_no_repeats_trace_call()
356 process_repeats(tr, ip, parent_ip, last_info, trace_ctx); in function_stack_no_repeats_trace_call()
358 trace_function(tr, ip, parent_ip, trace_ctx); in function_stack_no_repeats_trace_call()
359 __trace_stack(tr, trace_ctx, STACK_SKIP); in function_stack_no_repeats_trace_call()
380 static void tracing_start_function_trace(struct trace_array *tr) in tracing_start_function_trace() argument
382 tr->function_enabled = 0; in tracing_start_function_trace()
383 register_ftrace_function(tr->ops); in tracing_start_function_trace()
384 tr->function_enabled = 1; in tracing_start_function_trace()
387 static void tracing_stop_function_trace(struct trace_array *tr) in tracing_stop_function_trace() argument
389 tr->function_enabled = 0; in tracing_stop_function_trace()
390 unregister_ftrace_function(tr->ops); in tracing_stop_function_trace()
396 func_set_flag(struct trace_array *tr, u32 old_flags, u32 bit, int set) in func_set_flag() argument
406 if (tr->current_trace != &function_trace) in func_set_flag()
415 if (tr->ops->func == func) in func_set_flag()
418 if (!handle_func_repeats(tr, new_flags)) in func_set_flag()
421 unregister_ftrace_function(tr->ops); in func_set_flag()
422 tr->ops->func = func; in func_set_flag()
423 register_ftrace_function(tr->ops); in func_set_flag()
445 struct trace_array *tr, bool on, in update_traceon_count() argument
490 if (on == !!tracer_tracing_is_on(tr)) in update_traceon_count()
494 tracer_tracing_on(tr); in update_traceon_count()
496 tracer_tracing_off(tr); in update_traceon_count()
506 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceon_count() argument
509 update_traceon_count(ops, ip, tr, 1, data); in ftrace_traceon_count()
514 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceoff_count() argument
517 update_traceon_count(ops, ip, tr, 0, data); in ftrace_traceoff_count()
522 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceon() argument
525 if (tracer_tracing_is_on(tr)) in ftrace_traceon()
528 tracer_tracing_on(tr); in ftrace_traceon()
533 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceoff() argument
536 if (!tracer_tracing_is_on(tr)) in ftrace_traceoff()
539 tracer_tracing_off(tr); in ftrace_traceoff()
564 static __always_inline void trace_stack(struct trace_array *tr) in trace_stack() argument
570 __trace_stack(tr, trace_ctx, FTRACE_STACK_SKIP); in trace_stack()
575 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_stacktrace() argument
578 trace_stack(tr); in ftrace_stacktrace()
583 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_stacktrace_count() argument
596 trace_stack(tr); in ftrace_stacktrace_count()
615 trace_stack(tr); in ftrace_stacktrace_count()
643 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_dump_probe() argument
653 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_cpudump_probe() argument
719 ftrace_count_init(struct ftrace_probe_ops *ops, struct trace_array *tr, in ftrace_count_init() argument
735 ftrace_count_free(struct ftrace_probe_ops *ops, struct trace_array *tr, in ftrace_count_free() argument
797 ftrace_trace_probe_callback(struct trace_array *tr, in ftrace_trace_probe_callback() argument
811 return unregister_ftrace_function_probe_func(glob+1, tr, ops); in ftrace_trace_probe_callback()
830 ret = register_ftrace_function_probe(glob, tr, ops, count); in ftrace_trace_probe_callback()
836 ftrace_trace_onoff_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_trace_onoff_callback() argument
841 if (!tr) in ftrace_trace_onoff_callback()
850 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_trace_onoff_callback()
855 ftrace_stacktrace_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_stacktrace_callback() argument
860 if (!tr) in ftrace_stacktrace_callback()
865 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_stacktrace_callback()
870 ftrace_dump_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_dump_callback() argument
875 if (!tr) in ftrace_dump_callback()
881 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_dump_callback()
886 ftrace_cpudump_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_cpudump_callback() argument
891 if (!tr) in ftrace_cpudump_callback()
897 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_cpudump_callback()