• Home
  • Raw
  • Download

Lines Matching refs:pid

135         int pid;  in __for_each_pid()  local
140 if (!(pid = atoi(de->d_name))) { in __for_each_pid()
146 snprintf(cmdpath, sizeof(cmdpath), "/proc/%d/cmdline", pid); in __for_each_pid()
151 helper(pid, cmdline, arg); in __for_each_pid()
157 snprintf(cmdpath, sizeof(cmdpath), "/proc/%d/comm", pid); in __for_each_pid()
171 helper(pid, cmdline, arg); in __for_each_pid()
177 static void for_each_pid_helper(int pid, const char *cmdline, void *arg) { in for_each_pid_helper() argument
179 func(pid, cmdline); in for_each_pid_helper()
187 static void for_each_tid_helper(int pid, const char *cmdline, void *arg) { in for_each_tid_helper() argument
193 snprintf(taskpath, sizeof(taskpath), "/proc/%d/task", pid); in for_each_tid_helper()
200 func(pid, pid, cmdline); in for_each_tid_helper()
212 if (tid == pid) in for_each_tid_helper()
229 func(pid, tid, comm); in for_each_tid_helper()
240 void show_wchan(int pid, int tid, const char *name) { in show_wchan() argument
265 pid == tid ? 0 : 3, "", name); in show_wchan()
306 void show_showtime(int pid, const char *name) { in show_showtime() argument
314 snprintf(path, sizeof(path), "/proc/%d/stat", pid); in show_showtime()
353 snprintf(buffer, sizeof(buffer), "%-6d%s", pid, name); in show_showtime()
398 void do_showmap(int pid, const char *name) { in do_showmap() argument
402 snprintf(title, sizeof(title), "SHOW MAP %d (%s)", pid, name); in do_showmap()
403 snprintf(arg, sizeof(arg), "%d", pid); in do_showmap()
594 bool waitpid_with_timeout(pid_t pid, int timeout_seconds, int* status) { in waitpid_with_timeout() argument
626 pid_t child_pid = waitpid(pid, status, WNOHANG); in waitpid_with_timeout()
627 if (child_pid != pid) { in waitpid_with_timeout()
629 printf("*** Waiting for pid %d, got pid %d instead\n", pid, child_pid); in waitpid_with_timeout()
728 pid_t pid = fork(); in run_command_always() local
731 if (pid < 0) { in run_command_always()
734 return pid; in run_command_always()
738 if (pid == 0) { in run_command_always()
771 bool ret = waitpid_with_timeout(pid, timeout_seconds, &status); in run_command_always()
778 cmd.c_str(), (float) elapsed / NANOS_PER_SEC, pid); in run_command_always()
780 (float) elapsed / NANOS_PER_SEC, pid); in run_command_always()
784 cmd.c_str(), (float) elapsed / NANOS_PER_SEC, pid); in run_command_always()
786 (float) elapsed / NANOS_PER_SEC, pid); in run_command_always()
788 kill(pid, SIGTERM); in run_command_always()
789 if (!waitpid_with_timeout(pid, 5, NULL)) { in run_command_always()
790 kill(pid, SIGKILL); in run_command_always()
791 if (!waitpid_with_timeout(pid, 5, NULL)) { in run_command_always()
793 command, pid); in run_command_always()
794 MYLOGE("could not kill command '%s' (pid %d) even with SIGKILL.\n", command, pid); in run_command_always()
851 capheader.pid = 0; in drop_root_user()
1060 int pid = atoi(d->d_name); in dump_traces() local
1061 if (pid <= 0) continue; in dump_traces()
1065 snprintf(path, sizeof(path), "/proc/%d/exe", pid); in dump_traces()
1074 snprintf(path, sizeof(path), "/proc/%d/cmdline", pid); in dump_traces()
1088 if (kill(pid, SIGQUIT)) { in dump_traces()
1089 MYLOGE("kill(%d, SIGQUIT): %s\n", pid, strerror(errno)); in dump_traces()
1099 MYLOGE("warning: timed out dumping pid %d\n", pid); in dump_traces()
1109 pid, (float)(DurationReporter::nanotime() - start) / NANOS_PER_SEC); in dump_traces()
1122 } else if (dump_backtrace_to_file_timeout(pid, fd, 20) == -1) { in dump_traces()
1129 pid, (float)(DurationReporter::nanotime() - start) / NANOS_PER_SEC); in dump_traces()