Lines Matching full:if

25  * Check if the cgroup is frozen by looking at the cgroup.events::frozen value.
29 if (frozen) { in cg_check_frozen()
30 if (cg_read_strstr(cgroup, "cgroup.events", "frozen 1") != 0) { in cg_check_frozen()
38 if (cg_read_strstr(cgroup, "cgroup.events", "frozen 0") != 0) { in cg_check_frozen()
66 if (fd < 0) in cg_enter_and_wait_for_frozen()
70 if (ret) in cg_enter_and_wait_for_frozen()
75 if (ret) in cg_enter_and_wait_for_frozen()
79 if (ret) in cg_enter_and_wait_for_frozen()
90 * If there are no events in 10 seconds, treat this as an error.
98 if (fd < 0) in cg_freeze_wait()
102 if (ret) { in cg_freeze_wait()
108 if (ret) in cg_freeze_wait()
143 if (!cgroup) in test_cgfreezer_simple()
146 if (cg_create(cgroup)) in test_cgfreezer_simple()
152 if (cg_wait_for_proc_count(cgroup, 100)) in test_cgfreezer_simple()
155 if (cg_check_frozen(cgroup, false)) in test_cgfreezer_simple()
158 if (cg_freeze_wait(cgroup, true)) in test_cgfreezer_simple()
161 if (cg_freeze_wait(cgroup, false)) in test_cgfreezer_simple()
167 if (cgroup) in test_cgfreezer_simple()
195 if (!cgroup[0]) in test_cgfreezer_tree()
199 if (!cgroup[1]) in test_cgfreezer_tree()
203 if (!cgroup[2]) in test_cgfreezer_tree()
207 if (!cgroup[3]) in test_cgfreezer_tree()
211 if (!cgroup[4]) in test_cgfreezer_tree()
215 if (!cgroup[5]) in test_cgfreezer_tree()
219 if (!cgroup[6]) in test_cgfreezer_tree()
223 if (!cgroup[7]) in test_cgfreezer_tree()
227 if (!cgroup[8]) in test_cgfreezer_tree()
231 if (!cgroup[9]) in test_cgfreezer_tree()
235 if (cg_create(cgroup[i])) in test_cgfreezer_tree()
249 if (cg_wait_for_proc_count(cgroup[2], 1) || in test_cgfreezer_tree()
257 if (cg_freeze_wait(cgroup[1], true)) in test_cgfreezer_tree()
263 if (cg_freeze_wait(cgroup[5], true)) in test_cgfreezer_tree()
269 if (cg_freeze_wait(cgroup[6], true)) in test_cgfreezer_tree()
275 if (cg_check_frozen(cgroup[0], false)) in test_cgfreezer_tree()
278 if (cg_check_frozen(cgroup[4], false)) in test_cgfreezer_tree()
284 if (cg_freeze_wait(cgroup[0], true)) in test_cgfreezer_tree()
287 if (cg_check_frozen(cgroup[1], true)) in test_cgfreezer_tree()
290 if (cg_check_frozen(cgroup[4], true)) in test_cgfreezer_tree()
296 if (cg_freeze_nowait(cgroup[1], false)) in test_cgfreezer_tree()
299 if (cg_freeze_nowait(cgroup[5], false)) in test_cgfreezer_tree()
302 if (cg_freeze_nowait(cgroup[6], false)) in test_cgfreezer_tree()
308 if (cg_check_frozen(cgroup[2], true)) in test_cgfreezer_tree()
311 if (cg_check_frozen(cgroup[7], true)) in test_cgfreezer_tree()
317 if (cg_freeze_wait(cgroup[0], false)) in test_cgfreezer_tree()
320 if (cg_check_frozen(cgroup[2], false)) in test_cgfreezer_tree()
323 if (cg_check_frozen(cgroup[9], false)) in test_cgfreezer_tree()
366 if (!cgroup) in test_cgfreezer_forkbomb()
369 if (cg_create(cgroup)) in test_cgfreezer_forkbomb()
376 if (cg_freeze_wait(cgroup, true)) in test_cgfreezer_forkbomb()
379 if (cg_killall(cgroup)) in test_cgfreezer_forkbomb()
382 if (cg_wait_for_proc_count(cgroup, 0)) in test_cgfreezer_forkbomb()
388 if (cgroup) in test_cgfreezer_forkbomb()
406 if (!parent) in test_cgfreezer_mkdir()
410 if (!child) in test_cgfreezer_mkdir()
413 if (cg_create(parent)) in test_cgfreezer_mkdir()
416 if (cg_freeze_wait(parent, true)) in test_cgfreezer_mkdir()
419 if (cg_create(child)) in test_cgfreezer_mkdir()
423 if (pid < 0) in test_cgfreezer_mkdir()
426 if (cg_wait_for_proc_count(child, 1)) in test_cgfreezer_mkdir()
429 if (cg_check_frozen(child, true)) in test_cgfreezer_mkdir()
432 if (cg_check_frozen(parent, true)) in test_cgfreezer_mkdir()
438 if (child) in test_cgfreezer_mkdir()
441 if (parent) in test_cgfreezer_mkdir()
459 if (!parent) in test_cgfreezer_rmdir()
463 if (!child) in test_cgfreezer_rmdir()
466 if (cg_create(parent)) in test_cgfreezer_rmdir()
469 if (cg_create(child)) in test_cgfreezer_rmdir()
472 if (cg_freeze_wait(parent, true)) in test_cgfreezer_rmdir()
475 if (cg_destroy(child)) in test_cgfreezer_rmdir()
478 if (cg_check_frozen(parent, true)) in test_cgfreezer_rmdir()
481 if (cg_create(child)) in test_cgfreezer_rmdir()
484 if (cg_check_frozen(child, true)) in test_cgfreezer_rmdir()
490 if (child) in test_cgfreezer_rmdir()
493 if (parent) in test_cgfreezer_rmdir()
515 if (!cgroup[0]) in test_cgfreezer_migrate()
519 if (!cgroup[1]) in test_cgfreezer_migrate()
522 if (cg_create(cgroup[0])) in test_cgfreezer_migrate()
525 if (cg_create(cgroup[1])) in test_cgfreezer_migrate()
529 if (pid < 0) in test_cgfreezer_migrate()
532 if (cg_wait_for_proc_count(cgroup[0], 1)) in test_cgfreezer_migrate()
538 if (cg_freeze_wait(cgroup[1], true)) in test_cgfreezer_migrate()
541 if (cg_enter_and_wait_for_frozen(cgroup[1], pid, true)) in test_cgfreezer_migrate()
544 if (cg_check_frozen(cgroup[0], false)) in test_cgfreezer_migrate()
550 if (cg_enter_and_wait_for_frozen(cgroup[0], pid, false)) in test_cgfreezer_migrate()
553 if (cg_check_frozen(cgroup[1], true)) in test_cgfreezer_migrate()
559 if (cg_freeze_wait(cgroup[0], true)) in test_cgfreezer_migrate()
562 if (cg_enter_and_wait_for_frozen(cgroup[1], pid, true)) in test_cgfreezer_migrate()
565 if (cg_check_frozen(cgroup[0], true)) in test_cgfreezer_migrate()
571 if (cgroup[0]) in test_cgfreezer_migrate()
574 if (cgroup[1]) in test_cgfreezer_migrate()
591 if (!cgroup) in test_cgfreezer_ptrace()
594 if (cg_create(cgroup)) in test_cgfreezer_ptrace()
598 if (pid < 0) in test_cgfreezer_ptrace()
601 if (cg_wait_for_proc_count(cgroup, 1)) in test_cgfreezer_ptrace()
604 if (cg_freeze_wait(cgroup, true)) in test_cgfreezer_ptrace()
607 if (ptrace(PTRACE_SEIZE, pid, NULL, NULL)) in test_cgfreezer_ptrace()
610 if (ptrace(PTRACE_INTERRUPT, pid, NULL, NULL)) in test_cgfreezer_ptrace()
619 if (cg_check_frozen(cgroup, true)) in test_cgfreezer_ptrace()
622 if (ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo)) in test_cgfreezer_ptrace()
625 if (ptrace(PTRACE_DETACH, pid, NULL, NULL)) in test_cgfreezer_ptrace()
628 if (cg_check_frozen(cgroup, true)) in test_cgfreezer_ptrace()
634 if (cgroup) in test_cgfreezer_ptrace()
641 * Check if the process is stopped.
649 if (len == -1) { in proc_check_stopped()
654 if (strstr(buf, "(test_freezer) T ") == NULL) { in proc_check_stopped()
671 if (!cgroup) in test_cgfreezer_stopped()
674 if (cg_create(cgroup)) in test_cgfreezer_stopped()
679 if (cg_wait_for_proc_count(cgroup, 1)) in test_cgfreezer_stopped()
682 if (kill(pid, SIGSTOP)) in test_cgfreezer_stopped()
685 if (cg_check_frozen(cgroup, false)) in test_cgfreezer_stopped()
688 if (cg_freeze_wait(cgroup, true)) in test_cgfreezer_stopped()
691 if (cg_freeze_wait(cgroup, false)) in test_cgfreezer_stopped()
694 if (proc_check_stopped(pid)) in test_cgfreezer_stopped()
700 if (cgroup) in test_cgfreezer_stopped()
716 if (!cgroup) in test_cgfreezer_ptraced()
719 if (cg_create(cgroup)) in test_cgfreezer_ptraced()
724 if (cg_wait_for_proc_count(cgroup, 1)) in test_cgfreezer_ptraced()
727 if (ptrace(PTRACE_SEIZE, pid, NULL, NULL)) in test_cgfreezer_ptraced()
730 if (ptrace(PTRACE_INTERRUPT, pid, NULL, NULL)) in test_cgfreezer_ptraced()
735 if (cg_check_frozen(cgroup, false)) in test_cgfreezer_ptraced()
738 if (cg_freeze_wait(cgroup, true)) in test_cgfreezer_ptraced()
745 if (cg_freeze_wait(cgroup, false)) in test_cgfreezer_ptraced()
748 if (ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo)) in test_cgfreezer_ptraced()
751 if (ptrace(PTRACE_DETACH, pid, NULL, NULL)) in test_cgfreezer_ptraced()
757 if (cgroup) in test_cgfreezer_ptraced()
767 if (pid == 0) in vfork_fn()
784 if (!cgroup) in test_cgfreezer_vfork()
787 if (cg_create(cgroup)) in test_cgfreezer_vfork()
792 if (cg_wait_for_proc_count(cgroup, 2)) in test_cgfreezer_vfork()
795 if (cg_freeze_wait(cgroup, true)) in test_cgfreezer_vfork()
801 if (cgroup) in test_cgfreezer_vfork()
830 if (cg_find_unified_root(root, sizeof(root))) in main()