• Home
  • Raw
  • Download

Lines Matching refs:pid

55 #  define my_tgkill(pid, tid, sig) syscall (__NR_tgkill, (pid), (tid), (sig))  argument
57 # define my_tgkill(pid, tid, sig) syscall (__NR_tkill, (tid), (sig)) argument
63 # define my_tgkill(pid, tid, sig) kill ((tid), (sig)) argument
154 int pid; member
368 sprintf(name, "%.512s.%u", outfname, tcp->pid); in newoutf()
392 pid_t pid = fork(); in startup_attach() local
393 if (pid < 0) { in startup_attach()
396 if (pid) { /* parent */ in startup_attach()
433 sprintf(procdir, "/proc/%d/task", tcp->pid); in startup_attach()
448 else if (tid != tcbtab[tcbi]->pid) { in startup_attach()
473 tcbtab[tcbi]->pid, ntid); in startup_attach()
479 if (ptrace(PTRACE_ATTACH, tcp->pid, (char *) 1, 0) < 0) { in startup_attach()
503 tcp->pid); in startup_attach()
516 int pid = 0; in startup_child() local
576 strace_child = pid = fork(); in startup_child()
577 if (pid < 0) { in startup_child()
582 if ((pid != 0 && daemonized_tracer) /* parent: to become a traced process */ in startup_child()
583 || (pid == 0 && !daemonized_tracer) /* child: to become a traced process */ in startup_child()
585 pid = getpid(); in startup_child()
598 kill(pid, SIGSTOP); /* stop HERE */ in startup_child()
610 kill(pid, SIGSTOP); in startup_child()
679 tcp = alloctcb(daemonized_tracer ? getppid() : pid); in startup_child()
702 int pid, expected_grandchild = 0, found_grandchild = 0; in test_ptrace_setoptions() local
707 if ((pid = fork()) < 0) in test_ptrace_setoptions()
709 else if (pid == 0) { in test_ptrace_setoptions()
728 if (tracee_pid != pid) { in test_ptrace_setoptions()
737 if (ptrace(PTRACE_SETOPTIONS, pid, in test_ptrace_setoptions()
739 kill(pid, SIGKILL); in test_ptrace_setoptions()
747 if (ptrace(PTRACE_GETEVENTMSG, pid, in test_ptrace_setoptions()
753 if (ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0 && in test_ptrace_setoptions()
755 kill(pid, SIGKILL); in test_ptrace_setoptions()
768 int c, pid = 0; in main() local
879 if ((pid = atoi(optarg)) <= 0) { in main()
884 if (pid == getpid()) { in main()
888 tcp = alloc_tcb(pid, 0); in main()
1104 alloc_tcb(int pid, int command_options_parsed) in alloc_tcb() argument
1115 tcp->pid = pid; in alloc_tcb()
1158 sprintf(proc, "/proc/%d/ctl", tcp->pid); in proc_open()
1166 sprintf(proc, "/proc/%d/status", tcp->pid); in proc_open()
1174 sprintf(proc, "/proc/%d/as", tcp->pid); in proc_open()
1185 sprintf(proc, "/proc/%d", tcp->pid); in proc_open()
1188 sprintf(proc, "/proc/%d/mem", tcp->pid); in proc_open()
1200 sprintf(proc, "/proc/%d/regs", tcp->pid); in proc_open()
1206 sprintf(proc, "/proc/%d/status", tcp->pid); in proc_open()
1338 kill(tcp->pid, SIGINT); in proc_open()
1351 kill(tcp->pid, SIGCONT); in proc_open()
1380 kill(tcp->pid, SIGCONT); in proc_open()
1396 sprintf(proc, "/proc/%d/status", tcp->pid); in proc_open()
1430 pid2tcb(int pid) in pid2tcb() argument
1434 if (pid <= 0) in pid2tcb()
1439 if (tcp->pid == pid && (tcp->flags & TCB_INUSE)) in pid2tcb()
1483 if (tcp->pid == 0)
1496 tcp->pid = 0;
1553 fprintf(stderr, "PANIC: pid %u not suspended\n", tcp->pid);
1566 fprintf(stderr, "Process %u resumed\n", tcp->pid);
1594 (tcp->parent->waitpid <= 0 || tcp->parent->waitpid == tcp->pid)) { in resume_from_tcp()
1609 && t->waitpid == tcp->pid) { in resume_from_tcp()
1679 if ((error = ptrace(PTRACE_DETACH, tcp->pid, (char *) 1, sig)) == 0) {
1686 else if (my_tgkill((tcp->flags & TCB_CLONE_THREAD ? tcp->parent->pid
1687 : tcp->pid),
1688 tcp->pid, 0) < 0) {
1693 ? tcp->parent->pid : tcp->pid),
1694 tcp->pid, SIGSTOP) < 0) {
1703 if (wait4(tcp->pid, &status, __WALL, NULL) < 0) {
1712 if (waitpid(tcp->pid, &status, 0) < 0) {
1719 if (wait4(tcp->pid, &status, __WCLONE,
1749 if (sig && kill(tcp->pid, sig) < 0)
1760 fprintf(stderr, "Process %u detached\n", tcp->pid);
1778 int pid; in reaper() local
1781 while ((pid = waitpid(-1, &status, WNOHANG)) > 0) { in reaper()
1799 "cleanup: looking at pid %u\n", tcp->pid); in cleanup()
1808 kill(tcp->pid, SIGCONT); in cleanup()
1809 kill(tcp->pid, SIGTERM); in cleanup()
1942 poller_pid = pollinfo.pid;
2002 pollinfo.pid = getpid();
2340 tcp->pid, leader ? leader->pid : -1); in handle_group_exit()
2403 int pid; in trace() local
2421 pid = wait4(-1, &status, wait4_options, cflag ? &ru : NULL); in trace()
2422 if (pid < 0 && (wait4_options & __WALL) && errno == EINVAL) { in trace()
2426 pid = wait4(-1, &status, wait4_options, in trace()
2429 if (pid < 0 && !(wait4_options & __WALL) && errno == ECHILD) { in trace()
2431 pid = wait4(-1, &status, __WCLONE, in trace()
2433 if (pid == -1) { in trace()
2439 pid = wait4(-1, &status, 0, cflag ? &ru : NULL); in trace()
2443 pid = wait(&status); in trace()
2449 if (pid == -1) { in trace()
2467 if (pid == popen_pid) { in trace()
2473 fprintf(stderr, " [wait(%#x) = %u]\n", status, pid); in trace()
2476 if ((tcp = pid2tcb(pid)) == NULL) { in trace()
2488 tcp = alloctcb(pid); in trace()
2493 pid); in trace()
2500 fprintf(stderr, "unknown pid: %u\n", pid); in trace()
2502 ptrace(PTRACE_CONT, pid, (char *) 1, 0); in trace()
2528 if (pid == strace_child) in trace()
2549 if (pid == strace_child) in trace()
2552 fprintf(stderr, "pid %u exited with %d\n", pid, WEXITSTATUS(status)); in trace()
2561 pid, WEXITSTATUS(status)); in trace()
2577 fprintf(stderr, "PANIC: pid %u not stopped\n", pid); in trace()
2583 pid, signame(WSTOPSIG(status))); in trace()
2619 if (ptrace(PTRACE_SETOPTIONS, tcp->pid, in trace()
2660 if (ptrace(PTRACE_GETSIGINFO, pid, 0, &si) == 0) { in trace()
2713 tcp->pid, (char *) 1, SIGTERM); in trace()
2736 fprintf(stderr, "Process %u suspended\n", pid); in trace()
2792 tprintf("%-5d ", tcp->pid);
2794 tprintf("[pid %5u] ", tcp->pid);