Lines Matching refs:pid
90 int pid;
95 if (!(pid = atoi(de->d_name))) {
99 sprintf(cmdpath,"/proc/%d/cmdline", pid);
107 helper(pid, cmdline, arg);
113 static void for_each_pid_helper(int pid, const char *cmdline, void *arg) {
115 func(pid, cmdline);
122 static void for_each_tid_helper(int pid, const char *cmdline, void *arg) {
128 sprintf(taskpath, "/proc/%d/task", pid);
135 func(pid, pid, cmdline);
147 if (tid == pid)
164 func(pid, tid, comm);
174 void show_wchan(int pid, int tid, const char *name) {
194 pid == tid ? 0 : 3, "", name);
244 void do_showmap(int pid, const char *name) {
248 sprintf(title, "SHOW MAP %d (%s)", pid, name);
249 sprintf(arg, "%d", pid);
308 pid_t pid = fork();
311 if (pid < 0) {
313 return pid;
317 if (pid == 0) {
350 pid_t p = waitpid(pid, &status, WNOHANG);
352 if (p == pid) {
363 printf("*** %s: Timed out after %.3fs (killing pid %d)\n", command, (float) elapsed / NANOS_PER_SEC, pid);
364 kill(pid, SIGTERM);
428 /* redirect output to a file, optionally gzipping; returns gzip pid (or -1) */
574 int pid = atoi(d->d_name);
575 if (pid <= 0) continue;
579 snprintf(path, sizeof(path), "/proc/%d/exe", pid);
588 snprintf(path, sizeof(path), "/proc/%d/cmdline", pid);
602 if (kill(pid, SIGQUIT)) {
603 fprintf(stderr, "kill(%d, SIGQUIT): %s\n", pid, strerror(errno));
613 fprintf(stderr, "warning: timed out dumping pid %d\n", pid);
623 pid, (float)(nanotime() - start) / NANOS_PER_SEC);
636 } else if (dump_backtrace_to_file_timeout(pid, fd, 20) == -1) {
643 pid, (float)(nanotime() - start) / NANOS_PER_SEC);