Lines Matching refs:tracee

1388 			   pid_t tracee, int status, void *args);
1390 void start_tracer(struct __test_metadata *_metadata, int fd, pid_t tracee, in start_tracer() argument
1404 ret = ptrace(PTRACE_ATTACH, tracee, NULL, 0); in start_tracer()
1406 kill(tracee, SIGKILL); in start_tracer()
1411 ret = ptrace(PTRACE_SETOPTIONS, tracee, NULL, ptrace_syscall ? in start_tracer()
1416 kill(tracee, SIGKILL); in start_tracer()
1419 tracee, NULL, 0); in start_tracer()
1430 if (wait(&status) != tracee) in start_tracer()
1439 tracer_func(_metadata, tracee, status, args); in start_tracer()
1442 tracee, NULL, 0); in start_tracer()
1458 pid_t tracee = getpid(); in setup_trace_fixture() local
1469 start_tracer(_metadata, pipefd[1], tracee, func, args, in setup_trace_fixture()
1501 void tracer_poke(struct __test_metadata *_metadata, pid_t tracee, int status, in tracer_poke() argument
1508 ret = ptrace(PTRACE_GETEVENTMSG, tracee, NULL, &msg); in tracer_poke()
1512 kill(tracee, SIGKILL); in tracer_poke()
1519 ret = ptrace(PTRACE_POKEDATA, tracee, info->poke_addr, 0x1001); in tracer_poke()
1659 int get_syscall(struct __test_metadata *_metadata, pid_t tracee) in get_syscall() argument
1663 EXPECT_EQ(0, ptrace(PTRACE_GETREGS, tracee, 0, &regs)) { in get_syscall()
1672 EXPECT_EQ(0, ptrace(PTRACE_GETREGSET, tracee, NT_PRSTATUS, &iov)) { in get_syscall()
1687 pid_t tracee, int syscall, int result) in change_syscall() argument
1692 ret = ptrace(PTRACE_GETREGS, tracee, 0, &regs); in change_syscall()
1697 ret = ptrace(PTRACE_GETREGSET, tracee, NT_PRSTATUS, &iov); in change_syscall()
1719 ret = ptrace(PTRACE_SET_SYSCALL, tracee, NULL, syscall); in change_syscall()
1730 ret = ptrace(PTRACE_SETREGSET, tracee, NT_ARM_SYSTEM_CALL, in change_syscall()
1750 ret = ptrace(PTRACE_SETREGS, tracee, 0, &regs); in change_syscall()
1754 ret = ptrace(PTRACE_SETREGSET, tracee, NT_PRSTATUS, &iov); in change_syscall()
1759 void tracer_syscall(struct __test_metadata *_metadata, pid_t tracee, in tracer_syscall() argument
1766 ret = ptrace(PTRACE_GETEVENTMSG, tracee, NULL, &msg); in tracer_syscall()
1773 EXPECT_EQ(__NR_getpid, get_syscall(_metadata, tracee)); in tracer_syscall()
1774 change_syscall(_metadata, tracee, __NR_getppid, 0); in tracer_syscall()
1778 EXPECT_EQ(__NR_gettid, get_syscall(_metadata, tracee)); in tracer_syscall()
1779 change_syscall(_metadata, tracee, -1, 45000); in tracer_syscall()
1783 EXPECT_EQ(__NR_openat, get_syscall(_metadata, tracee)); in tracer_syscall()
1784 change_syscall(_metadata, tracee, -1, -ESRCH); in tracer_syscall()
1788 EXPECT_EQ(__NR_getppid, get_syscall(_metadata, tracee)); in tracer_syscall()
1793 kill(tracee, SIGKILL); in tracer_syscall()
1799 void tracer_ptrace(struct __test_metadata *_metadata, pid_t tracee, in tracer_ptrace() argument
1813 ret = ptrace(PTRACE_GETEVENTMSG, tracee, NULL, &msg); in tracer_ptrace()
1821 nr = get_syscall(_metadata, tracee); in tracer_ptrace()
1824 change_syscall(_metadata, tracee, __NR_getppid, 0); in tracer_ptrace()
1826 change_syscall(_metadata, tracee, -1, 45000); in tracer_ptrace()
1828 change_syscall(_metadata, tracee, -1, -ESRCH); in tracer_ptrace()