Lines Matching full:if
24 if (fd < 0) in touch_anon()
30 if (ret < 0) { in touch_anon()
31 if (errno != EINTR) { in touch_anon()
53 if (buf == MAP_FAILED) in alloc_and_touch_anon_noexit()
56 if (touch_anon((char *)buf, size)) { in alloc_and_touch_anon_noexit()
84 if (!cg_test) in test_cgcore_destroy()
88 if (cg_create(cg_test)) in test_cgcore_destroy()
94 if (child_pid < 0) in test_cgcore_destroy()
98 if (cg_wait_for_proc_count(cg_test, 1)) in test_cgcore_destroy()
101 if (cg_killall(cg_test)) in test_cgcore_destroy()
106 if (cg_read(cg_test, "cgroup.procs", buf, sizeof(buf))) in test_cgcore_destroy()
108 if (buf[0] == '\0') in test_cgcore_destroy()
113 if (rmdir(cg_test)) in test_cgcore_destroy()
116 if (waitpid(child_pid, NULL, 0) < 0) in test_cgcore_destroy()
121 if (cg_test) in test_cgcore_destroy()
151 if (!cg_test_a || !cg_test_b || !cg_test_c || !cg_test_d) in test_cgcore_populated()
154 if (cg_create(cg_test_a)) in test_cgcore_populated()
157 if (cg_create(cg_test_b)) in test_cgcore_populated()
160 if (cg_create(cg_test_c)) in test_cgcore_populated()
163 if (cg_create(cg_test_d)) in test_cgcore_populated()
166 if (cg_enter_current(cg_test_c)) in test_cgcore_populated()
169 if (cg_read_strcmp(cg_test_a, "cgroup.events", "populated 1\n")) in test_cgcore_populated()
172 if (cg_read_strcmp(cg_test_b, "cgroup.events", "populated 1\n")) in test_cgcore_populated()
175 if (cg_read_strcmp(cg_test_c, "cgroup.events", "populated 1\n")) in test_cgcore_populated()
178 if (cg_read_strcmp(cg_test_d, "cgroup.events", "populated 0\n")) in test_cgcore_populated()
181 if (cg_enter_current(root)) in test_cgcore_populated()
184 if (cg_read_strcmp(cg_test_a, "cgroup.events", "populated 0\n")) in test_cgcore_populated()
187 if (cg_read_strcmp(cg_test_b, "cgroup.events", "populated 0\n")) in test_cgcore_populated()
190 if (cg_read_strcmp(cg_test_c, "cgroup.events", "populated 0\n")) in test_cgcore_populated()
193 if (cg_read_strcmp(cg_test_d, "cgroup.events", "populated 0\n")) in test_cgcore_populated()
198 if (cgroup_fd < 0) in test_cgcore_populated()
202 if (pid < 0) { in test_cgcore_populated()
203 if (errno == ENOSYS) in test_cgcore_populated()
208 if (pid == 0) { in test_cgcore_populated()
209 if (raise(SIGSTOP)) in test_cgcore_populated()
220 if (err) in test_cgcore_populated()
223 if (cg_read_strcmp(cg_test_d, "cgroup.events", "populated 0\n")) in test_cgcore_populated()
227 if (cg_test_d) { in test_cgcore_populated()
234 if (pid < 0) in test_cgcore_populated()
236 if (pid == 0) in test_cgcore_populated()
245 if (cg_test_d) in test_cgcore_populated()
247 if (cg_test_c) in test_cgcore_populated()
249 if (cg_test_b) in test_cgcore_populated()
251 if (cg_test_a) in test_cgcore_populated()
257 if (cgroup_fd >= 0) in test_cgcore_populated()
278 if (!parent || !child || !grandparent) in test_cgcore_invalid_domain()
281 if (cg_create(grandparent)) in test_cgcore_invalid_domain()
284 if (cg_create(parent)) in test_cgcore_invalid_domain()
287 if (cg_create(child)) in test_cgcore_invalid_domain()
290 if (cg_write(parent, "cgroup.type", "threaded")) in test_cgcore_invalid_domain()
293 if (cg_read_strcmp(child, "cgroup.type", "domain invalid\n")) in test_cgcore_invalid_domain()
296 if (!cg_enter_current(child)) in test_cgcore_invalid_domain()
299 if (errno != EOPNOTSUPP) in test_cgcore_invalid_domain()
302 if (!clone_into_cgroup_run_wait(child)) in test_cgcore_invalid_domain()
305 if (errno == ENOSYS) in test_cgcore_invalid_domain()
308 if (errno != EOPNOTSUPP) in test_cgcore_invalid_domain()
316 if (child) in test_cgcore_invalid_domain()
318 if (parent) in test_cgcore_invalid_domain()
320 if (grandparent) in test_cgcore_invalid_domain()
339 if (!parent || !child) in test_cgcore_parent_becomes_threaded()
342 if (cg_create(parent)) in test_cgcore_parent_becomes_threaded()
345 if (cg_create(child)) in test_cgcore_parent_becomes_threaded()
348 if (cg_write(child, "cgroup.type", "threaded")) in test_cgcore_parent_becomes_threaded()
351 if (cg_read_strcmp(parent, "cgroup.type", "domain threaded\n")) in test_cgcore_parent_becomes_threaded()
357 if (child) in test_cgcore_parent_becomes_threaded()
359 if (parent) in test_cgcore_parent_becomes_threaded()
376 if (cg_read_strstr(root, "cgroup.controllers", "cpu") || in test_cgcore_no_internal_process_constraint_on_threads()
384 if (!parent || !child) in test_cgcore_no_internal_process_constraint_on_threads()
387 if (cg_create(parent)) in test_cgcore_no_internal_process_constraint_on_threads()
390 if (cg_create(child)) in test_cgcore_no_internal_process_constraint_on_threads()
393 if (cg_write(parent, "cgroup.type", "threaded")) in test_cgcore_no_internal_process_constraint_on_threads()
396 if (cg_write(child, "cgroup.type", "threaded")) in test_cgcore_no_internal_process_constraint_on_threads()
399 if (cg_write(parent, "cgroup.subtree_control", "+cpu")) in test_cgcore_no_internal_process_constraint_on_threads()
402 if (cg_enter_current(parent)) in test_cgcore_no_internal_process_constraint_on_threads()
410 if (child) in test_cgcore_no_internal_process_constraint_on_threads()
412 if (parent) in test_cgcore_no_internal_process_constraint_on_threads()
420 * Test that you can't enable a controller on a child if it's not enabled
430 if (!parent || !child) in test_cgcore_top_down_constraint_enable()
433 if (cg_create(parent)) in test_cgcore_top_down_constraint_enable()
436 if (cg_create(child)) in test_cgcore_top_down_constraint_enable()
439 if (!cg_write(child, "cgroup.subtree_control", "+memory")) in test_cgcore_top_down_constraint_enable()
445 if (child) in test_cgcore_top_down_constraint_enable()
447 if (parent) in test_cgcore_top_down_constraint_enable()
456 * if it's enabled in a child.
465 if (!parent || !child) in test_cgcore_top_down_constraint_disable()
468 if (cg_create(parent)) in test_cgcore_top_down_constraint_disable()
471 if (cg_create(child)) in test_cgcore_top_down_constraint_disable()
474 if (cg_write(parent, "cgroup.subtree_control", "+memory")) in test_cgcore_top_down_constraint_disable()
477 if (cg_write(child, "cgroup.subtree_control", "+memory")) in test_cgcore_top_down_constraint_disable()
480 if (!cg_write(parent, "cgroup.subtree_control", "-memory")) in test_cgcore_top_down_constraint_disable()
486 if (child) in test_cgcore_top_down_constraint_disable()
488 if (parent) in test_cgcore_top_down_constraint_disable()
497 * You can't add a pid to a domain parent if a controller is enabled.
506 if (!parent || !child) in test_cgcore_internal_process_constraint()
509 if (cg_create(parent)) in test_cgcore_internal_process_constraint()
512 if (cg_create(child)) in test_cgcore_internal_process_constraint()
515 if (cg_write(parent, "cgroup.subtree_control", "+memory")) in test_cgcore_internal_process_constraint()
518 if (!cg_enter_current(parent)) in test_cgcore_internal_process_constraint()
521 if (!clone_into_cgroup_run_wait(parent)) in test_cgcore_internal_process_constraint()
527 if (child) in test_cgcore_internal_process_constraint()
529 if (parent) in test_cgcore_internal_process_constraint()
554 if (!src || !dst) in test_cgcore_proc_migration()
557 if (cg_create(src)) in test_cgcore_proc_migration()
559 if (cg_create(dst)) in test_cgcore_proc_migration()
562 if (cg_enter_current(src)) in test_cgcore_proc_migration()
566 if (pthread_create(&threads[c_threads], NULL, dummy_thread_fn, NULL)) in test_cgcore_proc_migration()
571 if (cg_read_lc(dst, "cgroup.threads") != n_threads + 1) in test_cgcore_proc_migration()
587 if (dst) in test_cgcore_proc_migration()
589 if (src) in test_cgcore_proc_migration()
608 if (proc_read_strstr(0, 1, "cgroup", lines[(i % 2) + 1])) in migrating_thread_fn()
630 if (!grps[1] || !grps[2] || !dom) in test_cgcore_thread_migration()
633 if (cg_create(dom)) in test_cgcore_thread_migration()
635 if (cg_create(grps[1])) in test_cgcore_thread_migration()
637 if (cg_create(grps[2])) in test_cgcore_thread_migration()
640 if (cg_write(grps[1], "cgroup.type", "threaded")) in test_cgcore_thread_migration()
642 if (cg_write(grps[2], "cgroup.type", "threaded")) in test_cgcore_thread_migration()
645 if (cg_enter_current(grps[1])) in test_cgcore_thread_migration()
648 if (pthread_create(&thr, NULL, migrating_thread_fn, grps)) in test_cgcore_thread_migration()
651 if (pthread_join(thr, &retval)) in test_cgcore_thread_migration()
654 if (retval) in test_cgcore_thread_migration()
658 if (proc_read_strstr(0, 1, "cgroup", line)) in test_cgcore_thread_migration()
665 if (grps[2]) in test_cgcore_thread_migration()
667 if (grps[1]) in test_cgcore_thread_migration()
669 if (dom) in test_cgcore_thread_migration()
700 if (cg_find_unified_root(root, sizeof(root))) in main()
703 if (cg_read_strstr(root, "cgroup.subtree_control", "memory")) in main()
704 if (cg_write(root, "cgroup.subtree_control", "+memory")) in main()