Lines Matching refs:pid

101     void SetupChild(pid_t pid, int oomadj) {  in SetupChild()  argument
104 params.pid = pid; in SetupChild()
110 GTEST_LOG_(INFO) << "Target process " << pid << " launched"; in SetupChild()
112 ASSERT_FALSE(create_memcg(uid, pid) != 0) in SetupChild()
113 << "Target process " << pid << " failed to create a cgroup"; in SetupChild()
172 static bool ParseReapTime(const std::string& line, pid_t pid, long& reap_time) { in ParseReapTime() argument
175 reap_pid == pid; in ParseReapTime()
178 static bool ParseReapNoProcess(const std::string& line, pid_t pid) { in ParseReapNoProcess() argument
181 reap_pid == pid; in ParseReapNoProcess()
198 pid_t pid = fork(); in TEST_F() local
199 ASSERT_FALSE(pid < 0) << "Failed to spawn a child process, err=" << strerror(errno); in TEST_F()
200 if (pid != 0) { in TEST_F()
202 waitpid(pid, NULL, 0); in TEST_F()
209 FAIL() << "Target process " << pid << " was not killed"; in TEST_F()
214 pid, pid, pid); in TEST_F()
237 ASSERT_TRUE(ParseReapNoProcess(line, pid)) << "Failed to reap the target " << pid; in TEST_F()
244 ASSERT_TRUE(ParseReapTime(line, pid, reap_time) && reap_time >= 0) in TEST_F()
261 pid_t pid; in TEST_F() member
269 children_info[i].pid = fork(); in TEST_F()
270 if (children_info[i].pid < 0) { in TEST_F()
272 if (child.pid >= 0) kill(child.pid, SIGKILL); in TEST_F()
274 } else if (children_info[i].pid == 0) { in TEST_F()
289 if (children_info[i].pid < 0) continue; in TEST_F()
292 "proc/" + std::to_string(children_info[i].pid) + "/oom_score_adj"; in TEST_F()
296 if (child.pid >= 0) kill(child.pid, SIGKILL); in TEST_F()
298 << children_info[i].pid; in TEST_F()
304 procs_prio_request.procs[i] = {.pid = children_info[i].pid, in TEST_F()
320 if (child_info.pid < 0) continue; in TEST_F()
322 "proc/" + std::to_string(child_info.pid) + "/oom_score_adj"; in TEST_F()
326 if (child.pid >= 0) kill(child.pid, SIGKILL); in TEST_F()
327 FAIL() << "Failed reading new oom score for child process: " << child_info.pid; in TEST_F()
329 kill(child_info.pid, SIGKILL); in TEST_F()
333 << "Child with pid=" << child_info.pid << " didn't update its OOM score"; in TEST_F()