Lines Matching full:tr

22 static void tracing_start_function_trace(struct trace_array *tr);
23 static void tracing_stop_function_trace(struct trace_array *tr);
56 int ftrace_allocate_ftrace_ops(struct trace_array *tr) in ftrace_allocate_ftrace_ops() argument
61 if (tr->flags & TRACE_ARRAY_FL_GLOBAL) in ftrace_allocate_ftrace_ops()
72 tr->ops = ops; in ftrace_allocate_ftrace_ops()
73 ops->private = tr; in ftrace_allocate_ftrace_ops()
78 void ftrace_free_ftrace_ops(struct trace_array *tr) in ftrace_free_ftrace_ops() argument
80 kfree(tr->ops); in ftrace_free_ftrace_ops()
81 tr->ops = NULL; in ftrace_free_ftrace_ops()
84 int ftrace_create_function_files(struct trace_array *tr, in ftrace_create_function_files() argument
92 if (tr->flags & TRACE_ARRAY_FL_GLOBAL) in ftrace_create_function_files()
95 if (!tr->ops) in ftrace_create_function_files()
98 ret = allocate_fgraph_ops(tr, tr->ops); in ftrace_create_function_files()
100 kfree(tr->ops); in ftrace_create_function_files()
104 ftrace_create_filter_files(tr->ops, parent); in ftrace_create_function_files()
109 void ftrace_destroy_function_files(struct trace_array *tr) in ftrace_destroy_function_files() argument
111 ftrace_destroy_filter_files(tr->ops); in ftrace_destroy_function_files()
112 ftrace_free_ftrace_ops(tr); in ftrace_destroy_function_files()
113 free_fgraph_ops(tr); in ftrace_destroy_function_files()
134 static bool handle_func_repeats(struct trace_array *tr, u32 flags_val) in handle_func_repeats() argument
136 if (!tr->last_func_repeats && in handle_func_repeats()
138 tr->last_func_repeats = alloc_percpu(struct trace_func_repeats); in handle_func_repeats()
139 if (!tr->last_func_repeats) in handle_func_repeats()
146 static int function_trace_init(struct trace_array *tr) in function_trace_init() argument
154 if (!tr->ops) in function_trace_init()
161 if (!handle_func_repeats(tr, func_flags.val)) in function_trace_init()
164 ftrace_init_array_ops(tr, func); in function_trace_init()
166 tr->array_buffer.cpu = raw_smp_processor_id(); in function_trace_init()
169 tracing_start_function_trace(tr); in function_trace_init()
173 static void function_trace_reset(struct trace_array *tr) in function_trace_reset() argument
175 tracing_stop_function_trace(tr); in function_trace_reset()
177 ftrace_reset_array_ops(tr); in function_trace_reset()
180 static void function_trace_start(struct trace_array *tr) in function_trace_start() argument
182 tracing_reset_online_cpus(&tr->array_buffer); in function_trace_start()
211 struct trace_array *tr = op->private; in function_trace_call() local
215 if (unlikely(!tr->function_enabled)) in function_trace_call()
226 trace_function(tr, ip, parent_ip, trace_ctx, NULL); in function_trace_call()
235 struct trace_array *tr = op->private; in function_args_trace_call() local
239 if (unlikely(!tr->function_enabled)) in function_args_trace_call()
248 trace_function(tr, ip, parent_ip, trace_ctx, fregs); in function_args_trace_call()
275 struct trace_array *tr = op->private; in function_stack_trace_call() local
283 if (unlikely(!tr->function_enabled)) in function_stack_trace_call()
293 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_stack_trace_call()
298 trace_function(tr, ip, parent_ip, trace_ctx, NULL); in function_stack_trace_call()
303 __trace_stack(tr, trace_ctx, skip); in function_stack_trace_call()
310 static inline bool is_repeat_check(struct trace_array *tr, in is_repeat_check() argument
318 ring_buffer_time_stamp(tr->array_buffer.buffer); in is_repeat_check()
326 static inline void process_repeats(struct trace_array *tr, in process_repeats() argument
332 trace_last_func_repeats(tr, last_info, trace_ctx); in process_repeats()
346 struct trace_array *tr = op->private; in function_no_repeats_trace_call() local
350 if (unlikely(!tr->function_enabled)) in function_no_repeats_trace_call()
358 if (!tracer_tracing_is_on(tr)) in function_no_repeats_trace_call()
368 last_info = this_cpu_ptr(tr->last_func_repeats); in function_no_repeats_trace_call()
369 if (is_repeat_check(tr, last_info, ip, parent_ip)) in function_no_repeats_trace_call()
373 process_repeats(tr, ip, parent_ip, last_info, trace_ctx); in function_no_repeats_trace_call()
375 trace_function(tr, ip, parent_ip, trace_ctx, NULL); in function_no_repeats_trace_call()
387 struct trace_array *tr = op->private; in function_stack_no_repeats_trace_call() local
394 if (unlikely(!tr->function_enabled)) in function_stack_no_repeats_trace_call()
404 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_stack_no_repeats_trace_call()
408 last_info = per_cpu_ptr(tr->last_func_repeats, cpu); in function_stack_no_repeats_trace_call()
409 if (is_repeat_check(tr, last_info, ip, parent_ip)) in function_stack_no_repeats_trace_call()
413 process_repeats(tr, ip, parent_ip, last_info, trace_ctx); in function_stack_no_repeats_trace_call()
415 trace_function(tr, ip, parent_ip, trace_ctx, NULL); in function_stack_no_repeats_trace_call()
416 __trace_stack(tr, trace_ctx, STACK_SKIP); in function_stack_no_repeats_trace_call()
440 static void tracing_start_function_trace(struct trace_array *tr) in tracing_start_function_trace() argument
442 tr->function_enabled = 0; in tracing_start_function_trace()
443 register_ftrace_function(tr->ops); in tracing_start_function_trace()
444 tr->function_enabled = 1; in tracing_start_function_trace()
447 static void tracing_stop_function_trace(struct trace_array *tr) in tracing_stop_function_trace() argument
449 tr->function_enabled = 0; in tracing_stop_function_trace()
450 unregister_ftrace_function(tr->ops); in tracing_stop_function_trace()
456 func_set_flag(struct trace_array *tr, u32 old_flags, u32 bit, int set) in func_set_flag() argument
466 if (tr->current_trace != &function_trace) in func_set_flag()
475 if (tr->ops->func == func) in func_set_flag()
478 if (!handle_func_repeats(tr, new_flags)) in func_set_flag()
481 unregister_ftrace_function(tr->ops); in func_set_flag()
482 tr->ops->func = func; in func_set_flag()
483 register_ftrace_function(tr->ops); in func_set_flag()
505 struct trace_array *tr, bool on, in update_traceon_count() argument
550 if (on == !!tracer_tracing_is_on(tr)) in update_traceon_count()
554 tracer_tracing_on(tr); in update_traceon_count()
556 tracer_tracing_off(tr); in update_traceon_count()
566 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceon_count() argument
569 update_traceon_count(ops, ip, tr, 1, data); in ftrace_traceon_count()
574 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceoff_count() argument
577 update_traceon_count(ops, ip, tr, 0, data); in ftrace_traceoff_count()
582 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceon() argument
585 if (tracer_tracing_is_on(tr)) in ftrace_traceon()
588 tracer_tracing_on(tr); in ftrace_traceon()
593 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceoff() argument
596 if (!tracer_tracing_is_on(tr)) in ftrace_traceoff()
599 tracer_tracing_off(tr); in ftrace_traceoff()
624 static __always_inline void trace_stack(struct trace_array *tr) in trace_stack() argument
626 __trace_stack(tr, tracing_gen_ctx_dec(), FTRACE_STACK_SKIP); in trace_stack()
631 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_stacktrace() argument
634 trace_stack(tr); in ftrace_stacktrace()
639 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_stacktrace_count() argument
652 trace_stack(tr); in ftrace_stacktrace_count()
671 trace_stack(tr); in ftrace_stacktrace_count()
699 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_dump_probe() argument
709 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_cpudump_probe() argument
775 ftrace_count_init(struct ftrace_probe_ops *ops, struct trace_array *tr, in ftrace_count_init() argument
791 ftrace_count_free(struct ftrace_probe_ops *ops, struct trace_array *tr, in ftrace_count_free() argument
853 ftrace_trace_probe_callback(struct trace_array *tr, in ftrace_trace_probe_callback() argument
867 return unregister_ftrace_function_probe_func(glob+1, tr, ops); in ftrace_trace_probe_callback()
886 ret = register_ftrace_function_probe(glob, tr, ops, count); in ftrace_trace_probe_callback()
892 ftrace_trace_onoff_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_trace_onoff_callback() argument
897 if (!tr) in ftrace_trace_onoff_callback()
906 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_trace_onoff_callback()
911 ftrace_stacktrace_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_stacktrace_callback() argument
916 if (!tr) in ftrace_stacktrace_callback()
921 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_stacktrace_callback()
926 ftrace_dump_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_dump_callback() argument
931 if (!tr) in ftrace_dump_callback()
937 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_dump_callback()
942 ftrace_cpudump_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_cpudump_callback() argument
947 if (!tr) in ftrace_cpudump_callback()
953 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_cpudump_callback()