Lines Matching refs:root

85 static int test_cgcore_destroy(const char *root)  in test_cgcore_destroy()  argument
92 cg_test = cg_name(root, "cg_test"); in test_cgcore_destroy()
147 static int test_cgcore_populated(const char *root) in test_cgcore_populated() argument
159 cg_test_a = cg_name(root, "cg_test_a"); in test_cgcore_populated()
160 cg_test_b = cg_name(root, "cg_test_a/cg_test_b"); in test_cgcore_populated()
161 cg_test_c = cg_name(root, "cg_test_a/cg_test_b/cg_test_c"); in test_cgcore_populated()
162 cg_test_d = cg_name(root, "cg_test_a/cg_test_b/cg_test_d"); in test_cgcore_populated()
194 if (cg_enter_current(root)) in test_cgcore_populated()
283 static int test_cgcore_invalid_domain(const char *root) in test_cgcore_invalid_domain() argument
291 grandparent = cg_name(root, "cg_test_grandparent"); in test_cgcore_invalid_domain()
292 parent = cg_name(root, "cg_test_grandparent/cg_test_parent"); in test_cgcore_invalid_domain()
293 child = cg_name(root, "cg_test_grandparent/cg_test_parent/cg_test_child"); in test_cgcore_invalid_domain()
331 cg_enter_current(root); in test_cgcore_invalid_domain()
348 static int test_cgcore_parent_becomes_threaded(const char *root) in test_cgcore_parent_becomes_threaded() argument
356 parent = cg_name(root, "cg_test_parent"); in test_cgcore_parent_becomes_threaded()
357 child = cg_name(root, "cg_test_parent/cg_test_child"); in test_cgcore_parent_becomes_threaded()
390 static int test_cgcore_no_internal_process_constraint_on_threads(const char *root) in test_cgcore_no_internal_process_constraint_on_threads() argument
396 cg_read_strstr(root, "cgroup.controllers", "cpu") || in test_cgcore_no_internal_process_constraint_on_threads()
397 cg_write(root, "cgroup.subtree_control", "+cpu")) { in test_cgcore_no_internal_process_constraint_on_threads()
402 parent = cg_name(root, "cg_test_parent"); in test_cgcore_no_internal_process_constraint_on_threads()
403 child = cg_name(root, "cg_test_parent/cg_test_child"); in test_cgcore_no_internal_process_constraint_on_threads()
428 cg_enter_current(root); in test_cgcore_no_internal_process_constraint_on_threads()
429 cg_enter_current(root); in test_cgcore_no_internal_process_constraint_on_threads()
443 static int test_cgcore_top_down_constraint_enable(const char *root) in test_cgcore_top_down_constraint_enable() argument
451 parent = cg_name(root, "cg_test_parent"); in test_cgcore_top_down_constraint_enable()
452 child = cg_name(root, "cg_test_parent/cg_test_child"); in test_cgcore_top_down_constraint_enable()
481 static int test_cgcore_top_down_constraint_disable(const char *root) in test_cgcore_top_down_constraint_disable() argument
489 parent = cg_name(root, "cg_test_parent"); in test_cgcore_top_down_constraint_disable()
490 child = cg_name(root, "cg_test_parent/cg_test_child"); in test_cgcore_top_down_constraint_disable()
525 static int test_cgcore_internal_process_constraint(const char *root) in test_cgcore_internal_process_constraint() argument
533 parent = cg_name(root, "cg_test_parent"); in test_cgcore_internal_process_constraint()
534 child = cg_name(root, "cg_test_parent/cg_test_child"); in test_cgcore_internal_process_constraint()
574 static int test_cgcore_proc_migration(const char *root) in test_cgcore_proc_migration() argument
581 src = cg_name(root, "cg_src"); in test_cgcore_proc_migration()
582 dst = cg_name(root, "cg_dst"); in test_cgcore_proc_migration()
614 cg_enter_current(root); in test_cgcore_proc_migration()
647 static int test_cgcore_thread_migration(const char *root) in test_cgcore_thread_migration() argument
652 char *grps[3] = { (char *)root, NULL, NULL }; in test_cgcore_thread_migration()
656 dom = cg_name(root, "cg_dom"); in test_cgcore_thread_migration()
657 grps[1] = cg_name(root, "cg_dom/cg_src"); in test_cgcore_thread_migration()
658 grps[2] = cg_name(root, "cg_dom/cg_dst"); in test_cgcore_thread_migration()
695 cg_enter_current(root); in test_cgcore_thread_migration()
712 static int test_cgcore_lesser_euid_open(const char *root) in test_cgcore_lesser_euid_open() argument
721 cg_test_a = cg_name(root, "cg_test_a"); in test_cgcore_lesser_euid_open()
722 cg_test_b = cg_name(root, "cg_test_b"); in test_cgcore_lesser_euid_open()
761 cg_enter_current(root); in test_cgcore_lesser_euid_open()
794 static int test_cgcore_lesser_ns_open(const char *root) in test_cgcore_lesser_ns_open() argument
809 cg_test_a = cg_name(root, "cg_test_a"); in test_cgcore_lesser_ns_open()
810 cg_test_b = cg_name(root, "cg_test_b"); in test_cgcore_lesser_ns_open()
857 cg_enter_current(root); in test_cgcore_lesser_ns_open()
871 static int setup_named_v1_root(char *root, size_t len, const char *name) in setup_named_v1_root() argument
876 r = snprintf(root, len, "/mnt/cg_selftest"); in setup_named_v1_root()
884 r = mkdir(root, 0755); in setup_named_v1_root()
888 r = mount("none", root, "cgroup", 0, options); in setup_named_v1_root()
895 static void cleanup_named_v1_root(char *root) in cleanup_named_v1_root() argument
899 umount(root); in cleanup_named_v1_root()
900 rmdir(root); in cleanup_named_v1_root()
905 int (*fn)(const char *root);
925 char root[PATH_MAX]; in main() local
928 if (cg_find_unified_root(root, sizeof(root), &nsdelegate)) { in main()
929 if (setup_named_v1_root(root, sizeof(root), CG_NAMED_NAME)) in main()
935 if (cg_read_strstr(root, "cgroup.subtree_control", "memory")) in main()
936 if (cg_write(root, "cgroup.subtree_control", "+memory")) in main()
941 switch (tests[i].fn(root)) { in main()
955 cleanup_named_v1_root(root); in main()