Lines Matching refs:tr

97 	struct trace_array *tr;  in ftrace_pids_enabled()  local
102 tr = ops->private; in ftrace_pids_enabled()
104 return tr->function_pids != NULL; in ftrace_pids_enabled()
164 struct trace_array *tr = op->private; in ftrace_pid_func() local
166 if (tr && this_cpu_read(tr->trace_buffer.data->ftrace_ignore_pid)) in ftrace_pid_func()
1052 struct trace_array *tr; member
1322 static int ftrace_add_mod(struct trace_array *tr, in ftrace_add_mod() argument
1327 struct list_head *mod_head = enable ? &tr->mod_trace : &tr->mod_notrace; in ftrace_add_mod()
3075 struct trace_array *tr; member
3086 struct trace_array *tr = iter->ops->private; in t_probe_next() local
3097 if (!tr) in t_probe_next()
3100 func_probes = &tr->func_probes; in t_probe_next()
3209 struct trace_array *tr = iter->tr; in t_mod_next() local
3216 if (iter->mod_list == &tr->mod_trace || in t_mod_next()
3217 iter->mod_list == &tr->mod_notrace) { in t_mod_next()
3239 if (!iter->tr) in t_mod_start()
3262 struct trace_array *tr = iter->tr; in t_mod_show() local
3265 iter->mod_list == &tr->mod_trace || in t_mod_show()
3266 iter->mod_list == &tr->mod_notrace) in t_mod_show()
3549 struct trace_array *tr = ops->private; in ftrace_regex_open() local
3568 iter->tr = tr; in ftrace_regex_open()
3574 mod_head = tr ? &tr->mod_notrace : NULL; in ftrace_regex_open()
3577 mod_head = tr ? &tr->mod_trace : NULL; in ftrace_regex_open()
3879 static int cache_mod(struct trace_array *tr, in cache_mod() argument
3883 struct list_head *head = enable ? &tr->mod_trace : &tr->mod_notrace; in cache_mod()
3916 ret = ftrace_add_mod(tr, func, module, enable); in cache_mod()
4000 struct trace_array *tr; in process_cached_mods() local
4008 list_for_each_entry(tr, &ftrace_trace_arrays, list) { in process_cached_mods()
4009 if (!list_empty(&tr->mod_trace)) in process_cached_mods()
4010 process_mod_list(&tr->mod_trace, tr->ops, mod, true); in process_cached_mods()
4011 if (!list_empty(&tr->mod_notrace)) in process_cached_mods()
4012 process_mod_list(&tr->mod_notrace, tr->ops, mod, false); in process_cached_mods()
4026 ftrace_mod_callback(struct trace_array *tr, struct ftrace_hash *hash, in ftrace_mod_callback() argument
4048 return cache_mod(tr, func_orig, module, enable); in ftrace_mod_callback()
4080 probe_ops->func(ip, parent_ip, probe->tr, probe_ops, probe->data); in function_trace_probe_call()
4243 probe_ops->free(probe_ops, probe->tr, 0, probe->data); in release_probe()
4260 register_ftrace_function_probe(char *glob, struct trace_array *tr, in register_ftrace_function_probe() argument
4274 if (WARN_ON(!tr)) in register_ftrace_function_probe()
4284 list_for_each_entry(probe, &tr->func_probes, list) { in register_ftrace_function_probe()
4288 if (&probe->list == &tr->func_probes) { in register_ftrace_function_probe()
4296 probe->tr = tr; in register_ftrace_function_probe()
4298 list_add(&probe->list, &tr->func_probes); in register_ftrace_function_probe()
4331 ret = probe_ops->init(probe_ops, tr, in register_ftrace_function_probe()
4336 probe_ops->free(probe_ops, tr, in register_ftrace_function_probe()
4387 probe_ops->free(probe_ops, tr, entry->ip, probe->data); in register_ftrace_function_probe()
4394 unregister_ftrace_function_probe_func(char *glob, struct trace_array *tr, in unregister_ftrace_function_probe_func() argument
4427 list_for_each_entry(probe, &tr->func_probes, list) { in unregister_ftrace_function_probe_func()
4431 if (&probe->list == &tr->func_probes) in unregister_ftrace_function_probe_func()
4504 probe_ops->free(probe_ops, tr, entry->ip, probe->data); in unregister_ftrace_function_probe_func()
4522 void clear_ftrace_function_probes(struct trace_array *tr) in clear_ftrace_function_probes() argument
4526 list_for_each_entry_safe(probe, n, &tr->func_probes, list) in clear_ftrace_function_probes()
4527 unregister_ftrace_function_probe_func(NULL, tr, probe->probe_ops); in clear_ftrace_function_probes()
4583 struct trace_array *tr = iter->ops->private; in ftrace_process_regex() local
4606 ret = p->func(tr, hash, func, command, next, enable); in ftrace_process_regex()
4989 if (iter->tr && !list_empty(&iter->tr->mod_trace)) in ftrace_regex_release()
5662 struct trace_array *tr; in clear_mod_from_hashes() local
5665 list_for_each_entry(tr, &ftrace_trace_arrays, list) { in clear_mod_from_hashes()
5666 if (!tr->ops || !tr->ops->func_hash) in clear_mod_from_hashes()
5668 mutex_lock(&tr->ops->func_hash->regex_lock); in clear_mod_from_hashes()
5669 clear_mod_from_hash(pg, tr->ops->func_hash->filter_hash); in clear_mod_from_hashes()
5670 clear_mod_from_hash(pg, tr->ops->func_hash->notrace_hash); in clear_mod_from_hashes()
5671 mutex_unlock(&tr->ops->func_hash->regex_lock); in clear_mod_from_hashes()
6020 struct trace_array *tr; in clear_func_from_hashes() local
6023 list_for_each_entry(tr, &ftrace_trace_arrays, list) { in clear_func_from_hashes()
6024 if (!tr->ops || !tr->ops->func_hash) in clear_func_from_hashes()
6026 mutex_lock(&tr->ops->func_hash->regex_lock); in clear_func_from_hashes()
6027 clear_func_from_hash(func, tr->ops->func_hash->filter_hash); in clear_func_from_hashes()
6028 clear_func_from_hash(func, tr->ops->func_hash->notrace_hash); in clear_func_from_hashes()
6029 mutex_unlock(&tr->ops->func_hash->regex_lock); in clear_func_from_hashes()
6172 void ftrace_init_trace_array(struct trace_array *tr) in ftrace_init_trace_array() argument
6174 INIT_LIST_HEAD(&tr->func_probes); in ftrace_init_trace_array()
6175 INIT_LIST_HEAD(&tr->mod_trace); in ftrace_init_trace_array()
6176 INIT_LIST_HEAD(&tr->mod_notrace); in ftrace_init_trace_array()
6228 __init void ftrace_init_global_array_ops(struct trace_array *tr) in ftrace_init_global_array_ops() argument
6230 tr->ops = &global_ops; in ftrace_init_global_array_ops()
6231 tr->ops->private = tr; in ftrace_init_global_array_ops()
6232 ftrace_init_trace_array(tr); in ftrace_init_global_array_ops()
6235 void ftrace_init_array_ops(struct trace_array *tr, ftrace_func_t func) in ftrace_init_array_ops() argument
6238 if (tr->flags & TRACE_ARRAY_FL_GLOBAL) { in ftrace_init_array_ops()
6239 if (WARN_ON(tr->ops->func != ftrace_stub)) in ftrace_init_array_ops()
6241 tr->ops->func); in ftrace_init_array_ops()
6243 tr->ops->func = func; in ftrace_init_array_ops()
6244 tr->ops->private = tr; in ftrace_init_array_ops()
6247 void ftrace_reset_array_ops(struct trace_array *tr) in ftrace_reset_array_ops() argument
6249 tr->ops->func = ftrace_stub; in ftrace_reset_array_ops()
6372 struct trace_array *tr = data; in ftrace_filter_pid_sched_switch_probe() local
6375 pid_list = rcu_dereference_sched(tr->function_pids); in ftrace_filter_pid_sched_switch_probe()
6377 this_cpu_write(tr->trace_buffer.data->ftrace_ignore_pid, in ftrace_filter_pid_sched_switch_probe()
6387 struct trace_array *tr = data; in ftrace_pid_follow_sched_process_fork() local
6389 pid_list = rcu_dereference_sched(tr->function_pids); in ftrace_pid_follow_sched_process_fork()
6397 struct trace_array *tr = data; in ftrace_pid_follow_sched_process_exit() local
6399 pid_list = rcu_dereference_sched(tr->function_pids); in ftrace_pid_follow_sched_process_exit()
6403 void ftrace_pid_follow_fork(struct trace_array *tr, bool enable) in ftrace_pid_follow_fork() argument
6407 tr); in ftrace_pid_follow_fork()
6409 tr); in ftrace_pid_follow_fork()
6412 tr); in ftrace_pid_follow_fork()
6414 tr); in ftrace_pid_follow_fork()
6418 static void clear_ftrace_pids(struct trace_array *tr) in clear_ftrace_pids() argument
6423 pid_list = rcu_dereference_protected(tr->function_pids, in clear_ftrace_pids()
6428 unregister_trace_sched_switch(ftrace_filter_pid_sched_switch_probe, tr); in clear_ftrace_pids()
6431 per_cpu_ptr(tr->trace_buffer.data, cpu)->ftrace_ignore_pid = false; in clear_ftrace_pids()
6433 rcu_assign_pointer(tr->function_pids, NULL); in clear_ftrace_pids()
6441 void ftrace_clear_pids(struct trace_array *tr) in ftrace_clear_pids() argument
6445 clear_ftrace_pids(tr); in ftrace_clear_pids()
6450 static void ftrace_pid_reset(struct trace_array *tr) in ftrace_pid_reset() argument
6453 clear_ftrace_pids(tr); in ftrace_pid_reset()
6468 struct trace_array *tr = m->private; in fpid_start() local
6473 pid_list = rcu_dereference_sched(tr->function_pids); in fpid_start()
6483 struct trace_array *tr = m->private; in fpid_next() local
6484 struct trace_pid_list *pid_list = rcu_dereference_sched(tr->function_pids); in fpid_next()
6519 struct trace_array *tr = inode->i_private; in ftrace_pid_open() local
6523 if (trace_array_get(tr) < 0) in ftrace_pid_open()
6528 ftrace_pid_reset(tr); in ftrace_pid_open()
6532 trace_array_put(tr); in ftrace_pid_open()
6536 m->private = tr; in ftrace_pid_open()
6544 struct trace_array *tr = data; in ignore_task_cpu() local
6551 pid_list = rcu_dereference_protected(tr->function_pids, in ignore_task_cpu()
6554 this_cpu_write(tr->trace_buffer.data->ftrace_ignore_pid, in ignore_task_cpu()
6563 struct trace_array *tr = m->private; in ftrace_pid_write() local
6573 filtered_pids = rcu_dereference_protected(tr->function_pids, in ftrace_pid_write()
6580 rcu_assign_pointer(tr->function_pids, pid_list); in ftrace_pid_write()
6587 register_trace_sched_switch(ftrace_filter_pid_sched_switch_probe, tr); in ftrace_pid_write()
6595 on_each_cpu(ignore_task_cpu, tr, 1); in ftrace_pid_write()
6611 struct trace_array *tr = inode->i_private; in ftrace_pid_release() local
6613 trace_array_put(tr); in ftrace_pid_release()
6626 void ftrace_init_tracefs(struct trace_array *tr, struct dentry *d_tracer) in ftrace_init_tracefs() argument
6629 tr, &ftrace_pid_fops); in ftrace_init_tracefs()
6632 void __init ftrace_init_tracefs_toplevel(struct trace_array *tr, in ftrace_init_tracefs_toplevel() argument
6636 WARN_ON(!(tr->flags & TRACE_ARRAY_FL_GLOBAL)); in ftrace_init_tracefs_toplevel()