Lines Matching refs:tr
105 struct trace_array *tr; in ftrace_pids_enabled() local
110 tr = ops->private; in ftrace_pids_enabled()
112 return tr->function_pids != NULL || tr->function_no_pids != NULL; in ftrace_pids_enabled()
176 struct trace_array *tr = op->private; in ftrace_pid_func() local
179 if (tr) { in ftrace_pid_func()
180 pid = this_cpu_read(tr->array_buffer.data->ftrace_ignore_pid); in ftrace_pid_func()
1048 struct trace_array *tr; member
1324 static int ftrace_add_mod(struct trace_array *tr, in ftrace_add_mod() argument
1329 struct list_head *mod_head = enable ? &tr->mod_trace : &tr->mod_notrace; in ftrace_add_mod()
3906 struct trace_array *tr; member
3917 struct trace_array *tr = iter->ops->private; in t_probe_next() local
3928 if (!tr) in t_probe_next()
3931 func_probes = &tr->func_probes; in t_probe_next()
4048 struct trace_array *tr = iter->tr; in t_mod_next() local
4055 if (iter->mod_list == &tr->mod_trace || in t_mod_next()
4056 iter->mod_list == &tr->mod_notrace) { in t_mod_next()
4078 if (!iter->tr) in t_mod_start()
4101 struct trace_array *tr = iter->tr; in t_mod_show() local
4104 iter->mod_list == &tr->mod_trace || in t_mod_show()
4105 iter->mod_list == &tr->mod_notrace) in t_mod_show()
4621 struct trace_array *tr = ops->private; in ftrace_regex_open() local
4629 if (tracing_check_open_get_tr(tr)) in ftrace_regex_open()
4641 iter->tr = tr; in ftrace_regex_open()
4647 mod_head = tr ? &tr->mod_notrace : NULL; in ftrace_regex_open()
4650 mod_head = tr ? &tr->mod_trace : NULL; in ftrace_regex_open()
4695 if (tr) in ftrace_regex_open()
4696 trace_array_put(tr); in ftrace_regex_open()
5005 static int cache_mod(struct trace_array *tr, in cache_mod() argument
5009 struct list_head *head = enable ? &tr->mod_trace : &tr->mod_notrace; in cache_mod()
5041 return ftrace_add_mod(tr, func, module, enable); in cache_mod()
5115 struct trace_array *tr; in process_cached_mods() local
5123 list_for_each_entry(tr, &ftrace_trace_arrays, list) { in process_cached_mods()
5124 if (!list_empty(&tr->mod_trace)) in process_cached_mods()
5125 process_mod_list(&tr->mod_trace, tr->ops, mod, true); in process_cached_mods()
5126 if (!list_empty(&tr->mod_notrace)) in process_cached_mods()
5127 process_mod_list(&tr->mod_notrace, tr->ops, mod, false); in process_cached_mods()
5141 ftrace_mod_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_mod_callback() argument
5147 if (!tr) in ftrace_mod_callback()
5166 return cache_mod(tr, func_orig, module, enable); in ftrace_mod_callback()
5198 probe_ops->func(ip, parent_ip, probe->tr, probe_ops, probe->data); in function_trace_probe_call()
5369 probe_ops->free(probe_ops, probe->tr, 0, probe->data); in release_probe()
5385 register_ftrace_function_probe(char *glob, struct trace_array *tr, in register_ftrace_function_probe() argument
5399 if (WARN_ON(!tr)) in register_ftrace_function_probe()
5409 list_for_each_entry(iter, &tr->func_probes, list) { in register_ftrace_function_probe()
5423 probe->tr = tr; in register_ftrace_function_probe()
5425 list_add(&probe->list, &tr->func_probes); in register_ftrace_function_probe()
5467 ret = probe_ops->init(probe_ops, tr, in register_ftrace_function_probe()
5472 probe_ops->free(probe_ops, tr, in register_ftrace_function_probe()
5523 probe_ops->free(probe_ops, tr, entry->ip, probe->data); in register_ftrace_function_probe()
5530 unregister_ftrace_function_probe_func(char *glob, struct trace_array *tr, in unregister_ftrace_function_probe_func() argument
5563 list_for_each_entry(iter, &tr->func_probes, list) { in unregister_ftrace_function_probe_func()
5642 probe_ops->free(probe_ops, tr, entry->ip, probe->data); in unregister_ftrace_function_probe_func()
5660 void clear_ftrace_function_probes(struct trace_array *tr) in clear_ftrace_function_probes() argument
5664 list_for_each_entry_safe(probe, n, &tr->func_probes, list) in clear_ftrace_function_probes()
5665 unregister_ftrace_function_probe_func(NULL, tr, probe->probe_ops); in clear_ftrace_function_probes()
5713 struct trace_array *tr = iter->ops->private; in ftrace_process_regex() local
5737 return p->func(tr, hash, func, command, next, enable); in ftrace_process_regex()
6281 struct trace_array *tr = ops->private; in ftrace_set_regex() local
6288 if (!tr) in ftrace_set_regex()
6303 if (tr && mod && ret < 0) { in ftrace_set_regex()
6307 ret = cache_mod(tr, tmp, mod, enable); in ftrace_set_regex()
6476 struct trace_array *tr = trace_get_global_array(); in ftrace_set_early_filter() local
6478 ops->private = tr; in ftrace_set_early_filter()
6479 ftrace_init_trace_array(tr); in ftrace_set_early_filter()
6533 if (iter->tr) { in ftrace_regex_release()
6534 if (list_empty(&iter->tr->mod_trace)) in ftrace_regex_release()
6553 if (iter->tr) in ftrace_regex_release()
6554 trace_array_put(iter->tr); in ftrace_regex_release()
7396 struct trace_array *tr; in clear_mod_from_hashes() local
7399 list_for_each_entry(tr, &ftrace_trace_arrays, list) { in clear_mod_from_hashes()
7400 if (!tr->ops || !tr->ops->func_hash) in clear_mod_from_hashes()
7402 mutex_lock(&tr->ops->func_hash->regex_lock); in clear_mod_from_hashes()
7403 clear_mod_from_hash(pg, tr->ops->func_hash->filter_hash); in clear_mod_from_hashes()
7404 clear_mod_from_hash(pg, tr->ops->func_hash->notrace_hash); in clear_mod_from_hashes()
7405 mutex_unlock(&tr->ops->func_hash->regex_lock); in clear_mod_from_hashes()
7784 struct trace_array *tr; in clear_func_from_hashes() local
7787 list_for_each_entry(tr, &ftrace_trace_arrays, list) { in clear_func_from_hashes()
7788 if (!tr->ops || !tr->ops->func_hash) in clear_func_from_hashes()
7790 mutex_lock(&tr->ops->func_hash->regex_lock); in clear_func_from_hashes()
7791 clear_func_from_hash(func, tr->ops->func_hash->filter_hash); in clear_func_from_hashes()
7792 clear_func_from_hash(func, tr->ops->func_hash->notrace_hash); in clear_func_from_hashes()
7793 mutex_unlock(&tr->ops->func_hash->regex_lock); in clear_func_from_hashes()
7966 void ftrace_init_trace_array(struct trace_array *tr) in ftrace_init_trace_array() argument
7968 if (tr->flags & TRACE_ARRAY_FL_MOD_INIT) in ftrace_init_trace_array()
7971 INIT_LIST_HEAD(&tr->func_probes); in ftrace_init_trace_array()
7972 INIT_LIST_HEAD(&tr->mod_trace); in ftrace_init_trace_array()
7973 INIT_LIST_HEAD(&tr->mod_notrace); in ftrace_init_trace_array()
7975 tr->flags |= TRACE_ARRAY_FL_MOD_INIT; in ftrace_init_trace_array()
8001 __init void ftrace_init_global_array_ops(struct trace_array *tr) in ftrace_init_global_array_ops() argument
8003 tr->ops = &global_ops; in ftrace_init_global_array_ops()
8005 global_ops.private = tr; in ftrace_init_global_array_ops()
8006 ftrace_init_trace_array(tr); in ftrace_init_global_array_ops()
8007 init_array_fgraph_ops(tr, tr->ops); in ftrace_init_global_array_ops()
8010 void ftrace_init_array_ops(struct trace_array *tr, ftrace_func_t func) in ftrace_init_array_ops() argument
8013 if (tr->flags & TRACE_ARRAY_FL_GLOBAL) { in ftrace_init_array_ops()
8014 if (WARN_ON(tr->ops->func != ftrace_stub)) in ftrace_init_array_ops()
8016 tr->ops->func); in ftrace_init_array_ops()
8018 tr->ops->func = func; in ftrace_init_array_ops()
8019 tr->ops->private = tr; in ftrace_init_array_ops()
8022 void ftrace_reset_array_ops(struct trace_array *tr) in ftrace_reset_array_ops() argument
8024 tr->ops->func = ftrace_stub; in ftrace_reset_array_ops()
8150 struct trace_array *tr = data; in ftrace_filter_pid_sched_switch_probe() local
8154 pid_list = rcu_dereference_sched(tr->function_pids); in ftrace_filter_pid_sched_switch_probe()
8155 no_pid_list = rcu_dereference_sched(tr->function_no_pids); in ftrace_filter_pid_sched_switch_probe()
8158 this_cpu_write(tr->array_buffer.data->ftrace_ignore_pid, in ftrace_filter_pid_sched_switch_probe()
8161 this_cpu_write(tr->array_buffer.data->ftrace_ignore_pid, in ftrace_filter_pid_sched_switch_probe()
8171 struct trace_array *tr = data; in ftrace_pid_follow_sched_process_fork() local
8173 pid_list = rcu_dereference_sched(tr->function_pids); in ftrace_pid_follow_sched_process_fork()
8176 pid_list = rcu_dereference_sched(tr->function_no_pids); in ftrace_pid_follow_sched_process_fork()
8184 struct trace_array *tr = data; in ftrace_pid_follow_sched_process_exit() local
8186 pid_list = rcu_dereference_sched(tr->function_pids); in ftrace_pid_follow_sched_process_exit()
8189 pid_list = rcu_dereference_sched(tr->function_no_pids); in ftrace_pid_follow_sched_process_exit()
8193 void ftrace_pid_follow_fork(struct trace_array *tr, bool enable) in ftrace_pid_follow_fork() argument
8197 tr); in ftrace_pid_follow_fork()
8199 tr); in ftrace_pid_follow_fork()
8202 tr); in ftrace_pid_follow_fork()
8204 tr); in ftrace_pid_follow_fork()
8208 static void clear_ftrace_pids(struct trace_array *tr, int type) in clear_ftrace_pids() argument
8214 pid_list = rcu_dereference_protected(tr->function_pids, in clear_ftrace_pids()
8216 no_pid_list = rcu_dereference_protected(tr->function_no_pids, in clear_ftrace_pids()
8225 unregister_trace_sched_switch(ftrace_filter_pid_sched_switch_probe, tr); in clear_ftrace_pids()
8227 per_cpu_ptr(tr->array_buffer.data, cpu)->ftrace_ignore_pid = FTRACE_PID_TRACE; in clear_ftrace_pids()
8231 rcu_assign_pointer(tr->function_pids, NULL); in clear_ftrace_pids()
8234 rcu_assign_pointer(tr->function_no_pids, NULL); in clear_ftrace_pids()
8246 void ftrace_clear_pids(struct trace_array *tr) in ftrace_clear_pids() argument
8250 clear_ftrace_pids(tr, TRACE_PIDS | TRACE_NO_PIDS); in ftrace_clear_pids()
8255 static void ftrace_pid_reset(struct trace_array *tr, int type) in ftrace_pid_reset() argument
8258 clear_ftrace_pids(tr, type); in ftrace_pid_reset()
8273 struct trace_array *tr = m->private; in fpid_start() local
8278 pid_list = rcu_dereference_sched(tr->function_pids); in fpid_start()
8288 struct trace_array *tr = m->private; in fpid_next() local
8289 struct trace_pid_list *pid_list = rcu_dereference_sched(tr->function_pids); in fpid_next()
8326 struct trace_array *tr = m->private; in fnpid_start() local
8331 pid_list = rcu_dereference_sched(tr->function_no_pids); in fnpid_start()
8341 struct trace_array *tr = m->private; in fnpid_next() local
8342 struct trace_pid_list *pid_list = rcu_dereference_sched(tr->function_no_pids); in fnpid_next()
8361 struct trace_array *tr = inode->i_private; in pid_open() local
8365 ret = tracing_check_open_get_tr(tr); in pid_open()
8371 ftrace_pid_reset(tr, type); in pid_open()
8381 trace_array_put(tr); in pid_open()
8388 trace_array_put(tr); in pid_open()
8392 m->private = tr; in pid_open()
8412 struct trace_array *tr = data; in ignore_task_cpu() local
8420 pid_list = rcu_dereference_protected(tr->function_pids, in ignore_task_cpu()
8422 no_pid_list = rcu_dereference_protected(tr->function_no_pids, in ignore_task_cpu()
8426 this_cpu_write(tr->array_buffer.data->ftrace_ignore_pid, in ignore_task_cpu()
8429 this_cpu_write(tr->array_buffer.data->ftrace_ignore_pid, in ignore_task_cpu()
8438 struct trace_array *tr = m->private; in pid_write() local
8451 filtered_pids = rcu_dereference_protected(tr->function_pids, in pid_write()
8453 other_pids = rcu_dereference_protected(tr->function_no_pids, in pid_write()
8457 filtered_pids = rcu_dereference_protected(tr->function_no_pids, in pid_write()
8459 other_pids = rcu_dereference_protected(tr->function_pids, in pid_write()
8473 rcu_assign_pointer(tr->function_pids, pid_list); in pid_write()
8476 rcu_assign_pointer(tr->function_no_pids, pid_list); in pid_write()
8486 register_trace_sched_switch(ftrace_filter_pid_sched_switch_probe, tr); in pid_write()
8494 on_each_cpu(ignore_task_cpu, tr, 1); in pid_write()
8521 struct trace_array *tr = inode->i_private; in ftrace_pid_release() local
8523 trace_array_put(tr); in ftrace_pid_release()
8544 void ftrace_init_tracefs(struct trace_array *tr, struct dentry *d_tracer) in ftrace_init_tracefs() argument
8547 tr, &ftrace_pid_fops); in ftrace_init_tracefs()
8549 d_tracer, tr, &ftrace_no_pid_fops); in ftrace_init_tracefs()
8552 void __init ftrace_init_tracefs_toplevel(struct trace_array *tr, in ftrace_init_tracefs_toplevel() argument
8556 WARN_ON(!(tr->flags & TRACE_ARRAY_FL_GLOBAL)); in ftrace_init_tracefs_toplevel()