Lines Matching defs:dir

712 static void __get_system_dir(struct trace_subsystem_dir *dir)
714 WARN_ON_ONCE(dir->ref_count == 0);
715 dir->ref_count++;
716 __get_system(dir->subsystem);
719 static void __put_system_dir(struct trace_subsystem_dir *dir)
721 WARN_ON_ONCE(dir->ref_count == 0);
722 /* If the subsystem is about to be freed, the dir must be too */
723 WARN_ON_ONCE(system_refcount(dir->subsystem) == 1 && dir->ref_count != 1);
725 __put_system(dir->subsystem);
726 if (!--dir->ref_count)
727 kfree(dir);
730 static void put_system(struct trace_subsystem_dir *dir)
733 __put_system_dir(dir);
737 static void remove_subsystem(struct trace_subsystem_dir *dir)
739 if (!dir)
742 if (!--dir->nr_events) {
743 tracefs_remove(dir->entry);
744 list_del(&dir->list);
745 __put_system_dir(dir);
772 struct dentry *dir = file->dir;
774 tracefs_remove(dir);
1210 struct trace_subsystem_dir *dir = filp->private_data;
1211 struct event_subsystem *system = dir->subsystem;
1214 struct trace_array *tr = dir->tr;
1256 struct trace_subsystem_dir *dir = filp->private_data;
1257 struct event_subsystem *system = dir->subsystem;
1280 ret = __ftrace_set_clr_event(dir->tr, NULL, name, NULL, val);
1508 struct trace_subsystem_dir *dir = NULL; /* Initialize for gcc */
1519 list_for_each_entry(dir, &tr->systems, list) {
1520 if (dir == inode->i_private) {
1522 if (dir->nr_events) {
1523 __get_system_dir(dir);
1524 system = dir->subsystem;
1537 /* Some versions of gcc think dir can be uninitialized here */
1538 WARN_ON(!dir);
1542 put_system(dir);
1549 put_system(dir);
1557 struct trace_subsystem_dir *dir;
1561 /* Make a temporary dir that has no system but points to tr */
1562 dir = kzalloc(sizeof(*dir), GFP_KERNEL);
1563 if (!dir)
1568 kfree(dir);
1571 dir->tr = tr;
1572 filp->private_data = dir;
1579 struct trace_subsystem_dir *dir = file->private_data;
1581 trace_array_put(dir->tr);
1584 * If dir->subsystem is NULL, then this is a temporary
1588 if (dir->subsystem)
1589 put_system(dir);
1591 kfree(dir);
1600 struct trace_subsystem_dir *dir = filp->private_data;
1601 struct event_subsystem *system = dir->subsystem;
1627 struct trace_subsystem_dir *dir = filp->private_data;
1638 err = apply_subsystem_event_filter(dir, buf);
2066 struct trace_subsystem_dir *dir;
2070 /* First see if we did not already create this dir */
2071 list_for_each_entry(dir, &tr->systems, list) {
2072 system = dir->subsystem;
2074 dir->nr_events++;
2075 file->system = dir;
2076 return dir->entry;
2089 dir = kmalloc(sizeof(*dir), GFP_KERNEL);
2090 if (!dir)
2100 dir->entry = tracefs_create_dir(name, parent);
2101 if (!dir->entry) {
2107 dir->tr = tr;
2108 dir->ref_count = 1;
2109 dir->nr_events = 1;
2110 dir->subsystem = system;
2111 file->system = dir;
2113 entry = tracefs_create_file("filter", 0644, dir->entry, dir,
2121 trace_create_file("enable", 0644, dir->entry, dir,
2124 list_add(&dir->list, &tr->systems);
2126 return dir->entry;
2129 kfree(dir);
2132 if (!dir || !system)
2195 file->dir = tracefs_create_dir(name, d_events);
2196 if (!file->dir) {
2202 trace_create_file("enable", 0644, file->dir, file,
2207 trace_create_file("id", 0444, file->dir,
2223 trace_create_file("filter", 0644, file->dir, file,
2226 trace_create_file("trigger", 0644, file->dir, file,
2231 trace_create_file("hist", 0444, file->dir, file,
2235 trace_create_file("hist_debug", 0444, file->dir, file,
2238 trace_create_file("format", 0444, file->dir, call,
2243 trace_create_file("inject", 0200, file->dir, file,
3591 struct trace_subsystem_dir *dir;
3647 list_for_each_entry(dir, &tr->systems, list) {
3649 system = dir->subsystem;