Lines Matching refs:pid

116 static int cg_enter_and_wait_for_frozen(const char *cgroup, int pid,  in cg_enter_and_wait_for_frozen()  argument
126 ret = cg_enter(cgroup, pid); in cg_enter_and_wait_for_frozen()
460 int pid; in test_cgfreezer_mkdir() local
479 pid = cg_run_nowait(child, child_fn, NULL); in test_cgfreezer_mkdir()
480 if (pid < 0) in test_cgfreezer_mkdir()
569 int pid; in test_cgfreezer_migrate() local
585 pid = cg_run_nowait(cgroup[0], child_fn, NULL); in test_cgfreezer_migrate()
586 if (pid < 0) in test_cgfreezer_migrate()
598 if (cg_enter_and_wait_for_frozen(cgroup[1], pid, true)) in test_cgfreezer_migrate()
607 if (cg_enter_and_wait_for_frozen(cgroup[0], pid, false)) in test_cgfreezer_migrate()
619 if (cg_enter_and_wait_for_frozen(cgroup[1], pid, true)) in test_cgfreezer_migrate()
645 int pid; in test_cgfreezer_ptrace() local
654 pid = cg_run_nowait(cgroup, child_fn, NULL); in test_cgfreezer_ptrace()
655 if (pid < 0) in test_cgfreezer_ptrace()
664 if (ptrace(PTRACE_SEIZE, pid, NULL, NULL)) in test_cgfreezer_ptrace()
667 if (ptrace(PTRACE_INTERRUPT, pid, NULL, NULL)) in test_cgfreezer_ptrace()
670 waitpid(pid, NULL, 0); in test_cgfreezer_ptrace()
679 if (ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo)) in test_cgfreezer_ptrace()
682 if (ptrace(PTRACE_DETACH, pid, NULL, NULL)) in test_cgfreezer_ptrace()
700 static int proc_check_stopped(int pid) in proc_check_stopped() argument
705 len = proc_read_text(pid, 0, "stat", buf, sizeof(buf)); in proc_check_stopped()
707 debug("Can't get %d stat\n", pid); in proc_check_stopped()
712 debug("Process %d in the unexpected state: %s\n", pid, buf); in proc_check_stopped()
724 int pid, ret = KSFT_FAIL; in test_cgfreezer_stopped() local
734 pid = cg_run_nowait(cgroup, child_fn, NULL); in test_cgfreezer_stopped()
739 if (kill(pid, SIGSTOP)) in test_cgfreezer_stopped()
751 if (proc_check_stopped(pid)) in test_cgfreezer_stopped()
768 int pid, ret = KSFT_FAIL; in test_cgfreezer_ptraced() local
779 pid = cg_run_nowait(cgroup, child_fn, NULL); in test_cgfreezer_ptraced()
784 if (ptrace(PTRACE_SEIZE, pid, NULL, NULL)) in test_cgfreezer_ptraced()
787 if (ptrace(PTRACE_INTERRUPT, pid, NULL, NULL)) in test_cgfreezer_ptraced()
790 waitpid(pid, NULL, 0); in test_cgfreezer_ptraced()
805 if (ptrace(PTRACE_GETSIGINFO, pid, NULL, &siginfo)) in test_cgfreezer_ptraced()
808 if (ptrace(PTRACE_DETACH, pid, NULL, NULL)) in test_cgfreezer_ptraced()
822 int pid = vfork(); in vfork_fn() local
824 if (pid == 0) in vfork_fn()
828 return pid; in vfork_fn()