Lines Matching refs:pid

59 static int cg_enter_and_wait_for_frozen(const char *cgroup, int pid,  in cg_enter_and_wait_for_frozen()  argument
69 ret = cg_enter(cgroup, pid); in cg_enter_and_wait_for_frozen()
403 int pid; in test_cgfreezer_mkdir() local
422 pid = cg_run_nowait(child, child_fn, NULL); in test_cgfreezer_mkdir()
423 if (pid < 0) in test_cgfreezer_mkdir()
512 int pid; in test_cgfreezer_migrate() local
528 pid = cg_run_nowait(cgroup[0], child_fn, NULL); in test_cgfreezer_migrate()
529 if (pid < 0) in test_cgfreezer_migrate()
541 if (cg_enter_and_wait_for_frozen(cgroup[1], pid, true)) in test_cgfreezer_migrate()
550 if (cg_enter_and_wait_for_frozen(cgroup[0], pid, false)) in test_cgfreezer_migrate()
562 if (cg_enter_and_wait_for_frozen(cgroup[1], pid, true)) in test_cgfreezer_migrate()
588 int pid; in test_cgfreezer_ptrace() local
597 pid = cg_run_nowait(cgroup, child_fn, NULL); in test_cgfreezer_ptrace()
598 if (pid < 0) 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()
613 waitpid(pid, NULL, 0); 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()
643 static int proc_check_stopped(int pid) in proc_check_stopped() argument
648 len = proc_read_text(pid, 0, "stat", buf, sizeof(buf)); in proc_check_stopped()
650 debug("Can't get %d stat\n", pid); in proc_check_stopped()
655 debug("Process %d in the unexpected state: %s\n", pid, buf); in proc_check_stopped()
667 int pid, ret = KSFT_FAIL; in test_cgfreezer_stopped() local
677 pid = cg_run_nowait(cgroup, child_fn, NULL); in test_cgfreezer_stopped()
682 if (kill(pid, SIGSTOP)) in test_cgfreezer_stopped()
694 if (proc_check_stopped(pid)) in test_cgfreezer_stopped()
711 int pid, ret = KSFT_FAIL; in test_cgfreezer_ptraced() local
722 pid = cg_run_nowait(cgroup, child_fn, NULL); 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()
733 waitpid(pid, NULL, 0); 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()
765 int pid = vfork(); in vfork_fn() local
767 if (pid == 0) in vfork_fn()
771 return pid; in vfork_fn()