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()
192 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_trace_call()
194 trace_function(tr, ip, parent_ip, trace_ctx); in function_trace_call()
222 struct trace_array *tr = op->private; in function_stack_trace_call() local
229 if (unlikely(!tr->function_enabled)) in function_stack_trace_call()
238 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_stack_trace_call()
243 trace_function(tr, ip, parent_ip, trace_ctx); in function_stack_trace_call()
244 __trace_stack(tr, trace_ctx, STACK_SKIP); in function_stack_trace_call()
251 static inline bool is_repeat_check(struct trace_array *tr, in is_repeat_check() argument
259 ring_buffer_time_stamp(tr->array_buffer.buffer); in is_repeat_check()
267 static inline void process_repeats(struct trace_array *tr, in process_repeats() argument
273 trace_last_func_repeats(tr, last_info, trace_ctx); in process_repeats()
287 struct trace_array *tr = op->private; in function_no_repeats_trace_call() local
294 if (unlikely(!tr->function_enabled)) in function_no_repeats_trace_call()
304 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_no_repeats_trace_call()
315 last_info = per_cpu_ptr(tr->last_func_repeats, cpu); in function_no_repeats_trace_call()
316 if (is_repeat_check(tr, last_info, ip, parent_ip)) in function_no_repeats_trace_call()
321 process_repeats(tr, ip, parent_ip, last_info, trace_ctx); in function_no_repeats_trace_call()
323 trace_function(tr, ip, parent_ip, trace_ctx); in function_no_repeats_trace_call()
336 struct trace_array *tr = op->private; in function_stack_no_repeats_trace_call() local
343 if (unlikely(!tr->function_enabled)) in function_stack_no_repeats_trace_call()
352 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_stack_no_repeats_trace_call()
356 last_info = per_cpu_ptr(tr->last_func_repeats, cpu); in function_stack_no_repeats_trace_call()
357 if (is_repeat_check(tr, last_info, ip, parent_ip)) in function_stack_no_repeats_trace_call()
361 process_repeats(tr, ip, parent_ip, last_info, trace_ctx); in function_stack_no_repeats_trace_call()
363 trace_function(tr, ip, parent_ip, trace_ctx); in function_stack_no_repeats_trace_call()
364 __trace_stack(tr, trace_ctx, STACK_SKIP); in function_stack_no_repeats_trace_call()
385 static void tracing_start_function_trace(struct trace_array *tr) in tracing_start_function_trace() argument
387 tr->function_enabled = 0; in tracing_start_function_trace()
388 register_ftrace_function(tr->ops); in tracing_start_function_trace()
389 tr->function_enabled = 1; in tracing_start_function_trace()
392 static void tracing_stop_function_trace(struct trace_array *tr) in tracing_stop_function_trace() argument
394 tr->function_enabled = 0; in tracing_stop_function_trace()
395 unregister_ftrace_function(tr->ops); in tracing_stop_function_trace()
401 func_set_flag(struct trace_array *tr, u32 old_flags, u32 bit, int set) in func_set_flag() argument
411 if (tr->current_trace != &function_trace) in func_set_flag()
420 if (tr->ops->func == func) in func_set_flag()
423 if (!handle_func_repeats(tr, new_flags)) in func_set_flag()
426 unregister_ftrace_function(tr->ops); in func_set_flag()
427 tr->ops->func = func; in func_set_flag()
428 register_ftrace_function(tr->ops); in func_set_flag()
450 struct trace_array *tr, bool on, in update_traceon_count() argument
495 if (on == !!tracer_tracing_is_on(tr)) in update_traceon_count()
499 tracer_tracing_on(tr); in update_traceon_count()
501 tracer_tracing_off(tr); in update_traceon_count()
511 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceon_count() argument
514 update_traceon_count(ops, ip, tr, 1, data); in ftrace_traceon_count()
519 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceoff_count() argument
522 update_traceon_count(ops, ip, tr, 0, data); in ftrace_traceoff_count()
527 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceon() argument
530 if (tracer_tracing_is_on(tr)) in ftrace_traceon()
533 tracer_tracing_on(tr); in ftrace_traceon()
538 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceoff() argument
541 if (!tracer_tracing_is_on(tr)) in ftrace_traceoff()
544 tracer_tracing_off(tr); in ftrace_traceoff()
569 static __always_inline void trace_stack(struct trace_array *tr) in trace_stack() argument
575 __trace_stack(tr, trace_ctx, FTRACE_STACK_SKIP); in trace_stack()
580 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_stacktrace() argument
583 trace_stack(tr); in ftrace_stacktrace()
588 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_stacktrace_count() argument
601 trace_stack(tr); in ftrace_stacktrace_count()
620 trace_stack(tr); in ftrace_stacktrace_count()
648 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_dump_probe() argument
658 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_cpudump_probe() argument
724 ftrace_count_init(struct ftrace_probe_ops *ops, struct trace_array *tr, in ftrace_count_init() argument
740 ftrace_count_free(struct ftrace_probe_ops *ops, struct trace_array *tr, in ftrace_count_free() argument
802 ftrace_trace_probe_callback(struct trace_array *tr, in ftrace_trace_probe_callback() argument
816 return unregister_ftrace_function_probe_func(glob+1, tr, ops); in ftrace_trace_probe_callback()
835 ret = register_ftrace_function_probe(glob, tr, ops, count); in ftrace_trace_probe_callback()
841 ftrace_trace_onoff_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_trace_onoff_callback() argument
846 if (!tr) in ftrace_trace_onoff_callback()
855 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_trace_onoff_callback()
860 ftrace_stacktrace_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_stacktrace_callback() argument
865 if (!tr) in ftrace_stacktrace_callback()
870 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_stacktrace_callback()
875 ftrace_dump_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_dump_callback() argument
880 if (!tr) in ftrace_dump_callback()
886 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_dump_callback()
891 ftrace_cpudump_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_cpudump_callback() argument
896 if (!tr) in ftrace_cpudump_callback()
902 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_cpudump_callback()