Lines Matching refs:file
56 event_triggers_call(struct trace_event_file *file, in event_triggers_call() argument
64 if (list_empty(&file->triggers)) in event_triggers_call()
67 list_for_each_entry_rcu(data, &file->triggers, list) { in event_triggers_call()
87 bool __trace_trigger_soft_disabled(struct trace_event_file *file) in __trace_trigger_soft_disabled() argument
89 unsigned long eflags = file->flags; in __trace_trigger_soft_disabled()
92 event_triggers_call(file, NULL, NULL, NULL); in __trace_trigger_soft_disabled()
96 return trace_event_ignore_this_pid(file); in __trace_trigger_soft_disabled()
114 event_triggers_post_call(struct trace_event_file *file, in event_triggers_post_call() argument
119 list_for_each_entry_rcu(data, &file->triggers, list) { in event_triggers_post_call()
141 static bool check_user_trigger(struct trace_event_file *file) in check_user_trigger() argument
145 list_for_each_entry_rcu(data, &file->triggers, list, in check_user_trigger()
204 static int event_trigger_regex_open(struct inode *inode, struct file *file) in event_trigger_regex_open() argument
214 if (unlikely(!event_file_data(file))) { in event_trigger_regex_open()
219 if ((file->f_mode & FMODE_WRITE) && in event_trigger_regex_open()
220 (file->f_flags & O_TRUNC)) { in event_trigger_regex_open()
224 event_file = event_file_data(file); in event_trigger_regex_open()
232 if (file->f_mode & FMODE_READ) { in event_trigger_regex_open()
233 ret = seq_open(file, &event_triggers_seq_ops); in event_trigger_regex_open()
235 struct seq_file *m = file->private_data; in event_trigger_regex_open()
236 m->private = file; in event_trigger_regex_open()
245 int trigger_process_regex(struct trace_event_file *file, char *buff) in trigger_process_regex() argument
263 ret = p->parse(p, file, buff, command, next); in trigger_process_regex()
273 static ssize_t event_trigger_regex_write(struct file *file, in event_trigger_regex_write() argument
294 event_file = event_file_data(file); in event_trigger_regex_write()
313 static int event_trigger_regex_release(struct inode *inode, struct file *file) in event_trigger_regex_release() argument
317 if (file->f_mode & FMODE_READ) in event_trigger_regex_release()
318 seq_release(inode, file); in event_trigger_regex_release()
326 event_trigger_write(struct file *filp, const char __user *ubuf, in event_trigger_write()
333 event_trigger_open(struct inode *inode, struct file *filp) in event_trigger_open()
340 event_trigger_release(struct inode *inode, struct file *file) in event_trigger_release() argument
342 return event_trigger_regex_release(inode, file); in event_trigger_release()
471 int trace_event_trigger_enable_disable(struct trace_event_file *file, in trace_event_trigger_enable_disable() argument
477 if (atomic_inc_return(&file->tm_ref) > 1) in trace_event_trigger_enable_disable()
479 set_bit(EVENT_FILE_FL_TRIGGER_MODE_BIT, &file->flags); in trace_event_trigger_enable_disable()
480 ret = trace_event_enable_disable(file, 1, 1); in trace_event_trigger_enable_disable()
482 if (atomic_dec_return(&file->tm_ref) > 0) in trace_event_trigger_enable_disable()
484 clear_bit(EVENT_FILE_FL_TRIGGER_MODE_BIT, &file->flags); in trace_event_trigger_enable_disable()
485 ret = trace_event_enable_disable(file, 0, 1); in trace_event_trigger_enable_disable()
507 struct trace_event_file *file; in clear_event_triggers() local
509 list_for_each_entry(file, &tr->events, list) { in clear_event_triggers()
511 list_for_each_entry_safe(data, n, &file->triggers, list) { in clear_event_triggers()
512 trace_event_trigger_enable_disable(file, 0); in clear_event_triggers()
530 void update_cond_flag(struct trace_event_file *file) in update_cond_flag() argument
537 list_for_each_entry(data, &file->triggers, list) { in update_cond_flag()
546 set_bit(EVENT_FILE_FL_TRIGGER_COND_BIT, &file->flags); in update_cond_flag()
548 clear_bit(EVENT_FILE_FL_TRIGGER_COND_BIT, &file->flags); in update_cond_flag()
566 struct trace_event_file *file) in register_trigger() argument
573 list_for_each_entry(test, &file->triggers, list) { in register_trigger()
586 list_add_rcu(&data->list, &file->triggers); in register_trigger()
588 update_cond_flag(file); in register_trigger()
589 ret = trace_event_trigger_enable_disable(file, 1); in register_trigger()
592 update_cond_flag(file); in register_trigger()
611 struct trace_event_file *file) in unregister_trigger() argument
617 list_for_each_entry(iter, &file->triggers, list) { in unregister_trigger()
621 trace_event_trigger_enable_disable(file, 0); in unregister_trigger()
622 update_cond_flag(file); in unregister_trigger()
896 struct trace_event_file *file, in event_trigger_set_filter() argument
901 return cmd_ops->set_filter(param, trigger_data, file); in event_trigger_set_filter()
933 struct trace_event_file *file, in event_trigger_register() argument
937 return cmd_ops->reg(glob, trigger_data, file); in event_trigger_register()
951 struct trace_event_file *file, in event_trigger_unregister() argument
955 cmd_ops->unreg(glob, trigger_data, file); in event_trigger_unregister()
980 struct trace_event_file *file, in event_trigger_parse() argument
995 trigger_data = event_trigger_alloc(cmd_ops, cmd, param, file); in event_trigger_parse()
1000 event_trigger_unregister(cmd_ops, file, glob+1, trigger_data); in event_trigger_parse()
1010 ret = event_trigger_set_filter(cmd_ops, file, filter, trigger_data); in event_trigger_parse()
1017 ret = event_trigger_register(cmd_ops, file, glob, trigger_data); in event_trigger_parse()
1050 struct trace_event_file *file) in set_trigger_filter() argument
1069 ret = create_event_filter(file->tr, file->event_call, in set_trigger_filter()
1255 struct trace_event_file *file = data->private_data; in traceon_trigger() local
1257 if (file) { in traceon_trigger()
1258 if (tracer_tracing_is_on(file->tr)) in traceon_trigger()
1261 tracer_tracing_on(file->tr); in traceon_trigger()
1276 struct trace_event_file *file = data->private_data; in traceon_count_trigger() local
1278 if (file) { in traceon_count_trigger()
1279 if (tracer_tracing_is_on(file->tr)) in traceon_count_trigger()
1292 if (file) in traceon_count_trigger()
1293 tracer_tracing_on(file->tr); in traceon_count_trigger()
1303 struct trace_event_file *file = data->private_data; in traceoff_trigger() local
1305 if (file) { in traceoff_trigger()
1306 if (!tracer_tracing_is_on(file->tr)) in traceoff_trigger()
1309 tracer_tracing_off(file->tr); in traceoff_trigger()
1324 struct trace_event_file *file = data->private_data; in traceoff_count_trigger() local
1326 if (file) { in traceoff_count_trigger()
1327 if (!tracer_tracing_is_on(file->tr)) in traceoff_count_trigger()
1340 if (file) in traceoff_count_trigger()
1341 tracer_tracing_off(file->tr); in traceoff_count_trigger()
1431 struct trace_event_file *file = data->private_data; in snapshot_trigger() local
1433 if (file) in snapshot_trigger()
1434 tracing_snapshot_instance(file->tr); in snapshot_trigger()
1456 struct trace_event_file *file) in register_snapshot_trigger() argument
1458 int ret = tracing_alloc_snapshot_instance(file->tr); in register_snapshot_trigger()
1463 return register_trigger(glob, data, file); in register_snapshot_trigger()
1539 struct trace_event_file *file = data->private_data; in stacktrace_trigger() local
1541 if (file) in stacktrace_trigger()
1542 __trace_stack(file->tr, tracing_gen_ctx(), STACK_SKIP); in stacktrace_trigger()
1626 clear_bit(EVENT_FILE_FL_SOFT_DISABLED_BIT, &enable_data->file->flags); in event_enable_trigger()
1628 set_bit(EVENT_FILE_FL_SOFT_DISABLED_BIT, &enable_data->file->flags); in event_enable_trigger()
1642 if (enable_data->enable == !(enable_data->file->flags & EVENT_FILE_FL_SOFT_DISABLED)) in event_enable_count_trigger()
1660 enable_data->file->event_call->class->system, in event_enable_trigger_print()
1661 trace_event_name(enable_data->file->event_call)); in event_enable_trigger_print()
1686 trace_event_enable_disable(enable_data->file, 0, 1); in event_enable_trigger_free()
1687 trace_event_put_ref(enable_data->file->event_call); in event_enable_trigger_free()
1722 struct trace_event_file *file, in event_enable_trigger_parse() argument
1728 struct trace_array *tr = file->tr; in event_enable_trigger_parse()
1773 enable_data->file = event_enable_file; in event_enable_trigger_parse()
1782 event_trigger_unregister(cmd_ops, file, glob+1, trigger_data); in event_enable_trigger_parse()
1796 ret = event_trigger_set_filter(cmd_ops, file, filter, trigger_data); in event_enable_trigger_parse()
1811 ret = event_trigger_register(cmd_ops, file, glob, trigger_data); in event_enable_trigger_parse()
1832 struct trace_event_file *file) in event_enable_register_trigger() argument
1841 list_for_each_entry(test, &file->triggers, list) { in event_enable_register_trigger()
1846 (test_enable_data->file == enable_data->file)) { in event_enable_register_trigger()
1858 list_add_rcu(&data->list, &file->triggers); in event_enable_register_trigger()
1860 update_cond_flag(file); in event_enable_register_trigger()
1861 ret = trace_event_trigger_enable_disable(file, 1); in event_enable_register_trigger()
1864 update_cond_flag(file); in event_enable_register_trigger()
1872 struct trace_event_file *file) in event_enable_unregister_trigger() argument
1880 list_for_each_entry(iter, &file->triggers, list) { in event_enable_unregister_trigger()
1885 (enable_data->file == test_enable_data->file)) { in event_enable_unregister_trigger()
1888 trace_event_trigger_enable_disable(file, 0); in event_enable_unregister_trigger()
1889 update_cond_flag(file); in event_enable_unregister_trigger()