Lines Matching refs:_metadata

795 void kill_thread_or_group(struct __test_metadata *_metadata,  in kill_thread_or_group()  argument
866 kill_thread_or_group(_metadata, KILL_THREAD); in TEST()
885 kill_thread_or_group(_metadata, KILL_PROCESS); in TEST()
904 kill_thread_or_group(_metadata, RET_UNKNOWN); in TEST()
1504 typedef void tracer_func_t(struct __test_metadata *_metadata,
1507 void start_tracer(struct __test_metadata *_metadata, int fd, pid_t tracee, in start_tracer() argument
1566 tracer_func(_metadata, tracee, status, args); in start_tracer()
1573 syscall(__NR_exit, _metadata->passed ? EXIT_SUCCESS : EXIT_FAILURE); in start_tracer()
1579 pid_t setup_trace_fixture(struct __test_metadata *_metadata, in setup_trace_fixture() argument
1596 start_tracer(_metadata, pipefd[1], tracee, func, args, in setup_trace_fixture()
1608 void teardown_trace_fixture(struct __test_metadata *_metadata, in teardown_trace_fixture() argument
1620 _metadata->passed = 0; in teardown_trace_fixture()
1629 void tracer_poke(struct __test_metadata *_metadata, pid_t tracee, int status, in tracer_poke() argument
1679 self->tracer = setup_trace_fixture(_metadata, tracer_poke, in FIXTURE_SETUP()
1685 teardown_trace_fixture(_metadata, self->tracer); in FIXTURE_TEARDOWN()
1922 int get_syscall(struct __test_metadata *_metadata, pid_t tracee) in get_syscall() argument
1934 void __change_syscall(struct __test_metadata *_metadata, in __change_syscall() argument
1960 void change_syscall_nr(struct __test_metadata *_metadata, in change_syscall_nr() argument
1963 __change_syscall(_metadata, tracee, &syscall, NULL); in change_syscall_nr()
1967 void change_syscall_ret(struct __test_metadata *_metadata, in change_syscall_ret() argument
1972 __change_syscall(_metadata, tracee, &syscall, &ret); in change_syscall_ret()
1975 void tracer_seccomp(struct __test_metadata *_metadata, pid_t tracee, in tracer_seccomp() argument
1994 EXPECT_EQ(__NR_getpid, get_syscall(_metadata, tracee)); in tracer_seccomp()
1995 change_syscall_nr(_metadata, tracee, __NR_getppid); in tracer_seccomp()
1999 EXPECT_EQ(__NR_gettid, get_syscall(_metadata, tracee)); in tracer_seccomp()
2000 change_syscall_ret(_metadata, tracee, 45000); in tracer_seccomp()
2004 EXPECT_EQ(__NR_openat, get_syscall(_metadata, tracee)); in tracer_seccomp()
2005 change_syscall_ret(_metadata, tracee, -ESRCH); in tracer_seccomp()
2009 EXPECT_EQ(__NR_getppid, get_syscall(_metadata, tracee)); in tracer_seccomp()
2026 void tracer_ptrace(struct __test_metadata *_metadata, pid_t tracee, in tracer_ptrace() argument
2061 self->syscall_nr = get_syscall(_metadata, tracee); in tracer_ptrace()
2092 __change_syscall(_metadata, tracee, syscall_nr, syscall_ret); in tracer_ptrace()
2150 self->tracer = setup_trace_fixture(_metadata, in FIXTURE_SETUP()
2168 teardown_trace_fixture(_metadata, self->tracer); in FIXTURE_TEARDOWN()
2188 negative_ENOSYS(_metadata); in TEST_F()
2569 self->sibling[0].metadata = _metadata; in FIXTURE_SETUP()
2577 self->sibling[1].metadata = _metadata; in FIXTURE_SETUP()
3073 syscall(__NR_exit, _metadata->passed ? EXIT_SUCCESS in TEST()
3093 ret = get_syscall(_metadata, child_pid); in TEST()
3136 ret = get_syscall(_metadata, child_pid); in TEST()
3159 _metadata->passed = 0; in TEST()
4312 static ssize_t get_nth(struct __test_metadata *_metadata, const char *path, in get_nth() argument
4343 static char get_proc_stat(struct __test_metadata *_metadata, pid_t pid) in get_proc_stat() argument
4350 ASSERT_EQ(get_nth(_metadata, proc_path, 3, &line), 1); in get_proc_stat()
4414 if (get_proc_stat(_metadata, pids[i]) != 'S') { in TEST()
4442 static long get_proc_syscall(struct __test_metadata *_metadata, int pid) in get_proc_syscall() argument
4450 nread = get_nth(_metadata, proc_path, 1, &line); in get_proc_syscall()
4515 while (get_proc_syscall(_metadata, pid) != __NR_getppid && in TEST()
4516 get_proc_stat(_metadata, pid) != 'S') in TEST()
4590 while (get_proc_stat(_metadata, pid) != 'D') in TEST()
4639 while (get_proc_stat(_metadata, pid) != 'S') in TEST()