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
88 if (tr->flags & TRACE_ARRAY_FL_GLOBAL) in ftrace_create_function_files()
91 if (!tr->ops) in ftrace_create_function_files()
94 ret = allocate_fgraph_ops(tr, tr->ops); in ftrace_create_function_files()
96 kfree(tr->ops); in ftrace_create_function_files()
100 ftrace_create_filter_files(tr->ops, parent); in ftrace_create_function_files()
105 void ftrace_destroy_function_files(struct trace_array *tr) in ftrace_destroy_function_files() argument
107 ftrace_destroy_filter_files(tr->ops); in ftrace_destroy_function_files()
108 ftrace_free_ftrace_ops(tr); in ftrace_destroy_function_files()
109 free_fgraph_ops(tr); in ftrace_destroy_function_files()
128 static bool handle_func_repeats(struct trace_array *tr, u32 flags_val) in handle_func_repeats() argument
130 if (!tr->last_func_repeats && in handle_func_repeats()
132 tr->last_func_repeats = alloc_percpu(struct trace_func_repeats); in handle_func_repeats()
133 if (!tr->last_func_repeats) in handle_func_repeats()
140 static int function_trace_init(struct trace_array *tr) in function_trace_init() argument
148 if (!tr->ops) in function_trace_init()
155 if (!handle_func_repeats(tr, func_flags.val)) in function_trace_init()
158 ftrace_init_array_ops(tr, func); in function_trace_init()
160 tr->array_buffer.cpu = raw_smp_processor_id(); in function_trace_init()
163 tracing_start_function_trace(tr); in function_trace_init()
167 static void function_trace_reset(struct trace_array *tr) in function_trace_reset() argument
169 tracing_stop_function_trace(tr); in function_trace_reset()
171 ftrace_reset_array_ops(tr); in function_trace_reset()
174 static void function_trace_start(struct trace_array *tr) in function_trace_start() argument
176 tracing_reset_online_cpus(&tr->array_buffer); in function_trace_start()
183 struct trace_array *tr = op->private; in function_trace_call() local
189 if (unlikely(!tr->function_enabled)) in function_trace_call()
199 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_trace_call()
201 trace_function(tr, ip, parent_ip, trace_ctx); in function_trace_call()
228 struct trace_array *tr = op->private; in function_stack_trace_call() local
236 if (unlikely(!tr->function_enabled)) in function_stack_trace_call()
245 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_stack_trace_call()
250 trace_function(tr, ip, parent_ip, trace_ctx); in function_stack_trace_call()
255 __trace_stack(tr, trace_ctx, skip); in function_stack_trace_call()
262 static inline bool is_repeat_check(struct trace_array *tr, in is_repeat_check() argument
270 ring_buffer_time_stamp(tr->array_buffer.buffer); in is_repeat_check()
278 static inline void process_repeats(struct trace_array *tr, in process_repeats() argument
284 trace_last_func_repeats(tr, last_info, trace_ctx); in process_repeats()
298 struct trace_array *tr = op->private; in function_no_repeats_trace_call() local
305 if (unlikely(!tr->function_enabled)) in function_no_repeats_trace_call()
313 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_no_repeats_trace_call()
324 last_info = per_cpu_ptr(tr->last_func_repeats, cpu); in function_no_repeats_trace_call()
325 if (is_repeat_check(tr, last_info, ip, parent_ip)) in function_no_repeats_trace_call()
330 process_repeats(tr, ip, parent_ip, last_info, trace_ctx); in function_no_repeats_trace_call()
332 trace_function(tr, ip, parent_ip, trace_ctx); in function_no_repeats_trace_call()
344 struct trace_array *tr = op->private; in function_stack_no_repeats_trace_call() local
351 if (unlikely(!tr->function_enabled)) in function_stack_no_repeats_trace_call()
360 data = per_cpu_ptr(tr->array_buffer.data, cpu); in function_stack_no_repeats_trace_call()
364 last_info = per_cpu_ptr(tr->last_func_repeats, cpu); in function_stack_no_repeats_trace_call()
365 if (is_repeat_check(tr, last_info, ip, parent_ip)) in function_stack_no_repeats_trace_call()
369 process_repeats(tr, ip, parent_ip, last_info, trace_ctx); in function_stack_no_repeats_trace_call()
371 trace_function(tr, ip, parent_ip, trace_ctx); in function_stack_no_repeats_trace_call()
372 __trace_stack(tr, trace_ctx, STACK_SKIP); in function_stack_no_repeats_trace_call()
393 static void tracing_start_function_trace(struct trace_array *tr) in tracing_start_function_trace() argument
395 tr->function_enabled = 0; in tracing_start_function_trace()
396 register_ftrace_function(tr->ops); in tracing_start_function_trace()
397 tr->function_enabled = 1; in tracing_start_function_trace()
400 static void tracing_stop_function_trace(struct trace_array *tr) in tracing_stop_function_trace() argument
402 tr->function_enabled = 0; in tracing_stop_function_trace()
403 unregister_ftrace_function(tr->ops); in tracing_stop_function_trace()
409 func_set_flag(struct trace_array *tr, u32 old_flags, u32 bit, int set) in func_set_flag() argument
419 if (tr->current_trace != &function_trace) in func_set_flag()
428 if (tr->ops->func == func) in func_set_flag()
431 if (!handle_func_repeats(tr, new_flags)) in func_set_flag()
434 unregister_ftrace_function(tr->ops); in func_set_flag()
435 tr->ops->func = func; in func_set_flag()
436 register_ftrace_function(tr->ops); in func_set_flag()
458 struct trace_array *tr, bool on, in update_traceon_count() argument
503 if (on == !!tracer_tracing_is_on(tr)) in update_traceon_count()
507 tracer_tracing_on(tr); in update_traceon_count()
509 tracer_tracing_off(tr); in update_traceon_count()
519 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceon_count() argument
522 update_traceon_count(ops, ip, tr, 1, data); in ftrace_traceon_count()
527 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceoff_count() argument
530 update_traceon_count(ops, ip, tr, 0, data); in ftrace_traceoff_count()
535 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceon() argument
538 if (tracer_tracing_is_on(tr)) in ftrace_traceon()
541 tracer_tracing_on(tr); in ftrace_traceon()
546 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_traceoff() argument
549 if (!tracer_tracing_is_on(tr)) in ftrace_traceoff()
552 tracer_tracing_off(tr); in ftrace_traceoff()
577 static __always_inline void trace_stack(struct trace_array *tr) in trace_stack() argument
583 __trace_stack(tr, trace_ctx, FTRACE_STACK_SKIP); in trace_stack()
588 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_stacktrace() argument
591 trace_stack(tr); in ftrace_stacktrace()
596 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_stacktrace_count() argument
609 trace_stack(tr); in ftrace_stacktrace_count()
628 trace_stack(tr); in ftrace_stacktrace_count()
656 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_dump_probe() argument
666 struct trace_array *tr, struct ftrace_probe_ops *ops, in ftrace_cpudump_probe() argument
732 ftrace_count_init(struct ftrace_probe_ops *ops, struct trace_array *tr, in ftrace_count_init() argument
748 ftrace_count_free(struct ftrace_probe_ops *ops, struct trace_array *tr, in ftrace_count_free() argument
810 ftrace_trace_probe_callback(struct trace_array *tr, in ftrace_trace_probe_callback() argument
824 return unregister_ftrace_function_probe_func(glob+1, tr, ops); in ftrace_trace_probe_callback()
843 ret = register_ftrace_function_probe(glob, tr, ops, count); in ftrace_trace_probe_callback()
849 ftrace_trace_onoff_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_trace_onoff_callback() argument
854 if (!tr) in ftrace_trace_onoff_callback()
863 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_trace_onoff_callback()
868 ftrace_stacktrace_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_stacktrace_callback() argument
873 if (!tr) in ftrace_stacktrace_callback()
878 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_stacktrace_callback()
883 ftrace_dump_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_dump_callback() argument
888 if (!tr) in ftrace_dump_callback()
894 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_dump_callback()
899 ftrace_cpudump_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_cpudump_callback() argument
904 if (!tr) in ftrace_cpudump_callback()
910 return ftrace_trace_probe_callback(tr, ops, hash, glob, cmd, in ftrace_cpudump_callback()