Lines Matching refs:cgroups
27 static int add_cgroup(Hashmap *cgroups, const char *path, bool is_const, struct CGroupInfo **ret) { in add_cgroup() argument
31 assert(cgroups); in add_cgroup()
36 cg = hashmap_get(cgroups, path); in add_cgroup()
51 r = add_cgroup(cgroups, pp, false, &parent); in add_cgroup()
73 r = hashmap_put(cgroups, cg->cgroup_path, cg); in add_cgroup()
91 Hashmap *cgroups, in add_process() argument
99 assert(cgroups); in add_process()
103 r = add_cgroup(cgroups, path, true, &cg); in add_process()
110 static void remove_cgroup(Hashmap *cgroups, struct CGroupInfo *cg) { in remove_cgroup() argument
111 assert(cgroups); in remove_cgroup()
115 remove_cgroup(cgroups, cg->children); in remove_cgroup()
117 hashmap_remove(cgroups, cg->cgroup_path); in remove_cgroup()
135 Hashmap *cgroups, in dump_processes() argument
148 cg = hashmap_get(cgroups, cgroup_path); in dump_processes()
239 r = dump_processes(cgroups, children[i]->cgroup_path, pp, n_columns, flags); in dump_processes()
250 Hashmap *cgroups, in dump_extra_processes() argument
264 HASHMAP_FOREACH(cg, cgroups) { in dump_extra_processes()
333 Hashmap *cgroups = NULL; in unit_show_processes() local
360 cgroups = hashmap_new(&path_hash_ops); in unit_show_processes()
361 if (!cgroups) in unit_show_processes()
378 r = add_process(cgroups, path, pid, name); in unit_show_processes()
390 r = dump_processes(cgroups, cgroup_path, prefix, n_columns, flags); in unit_show_processes()
394 r = dump_extra_processes(cgroups, prefix, n_columns, flags); in unit_show_processes()
397 while ((cg = hashmap_first(cgroups))) in unit_show_processes()
398 remove_cgroup(cgroups, cg); in unit_show_processes()
400 hashmap_free(cgroups); in unit_show_processes()