| /tools/testing/selftests/arm64/fp/ |
| A D | fp-stress.c | 73 child->pid = fork(); in child_start() 74 if (child->pid == -1) in child_start() 78 if (!child->pid) { in child_start() 136 ev.data.ptr = child; in child_start() 167 if (child->output) { in child_output_read() 170 free(child->output); in child_output_read() 212 child->stdout = -1; in child_output() 217 ksft_print_msg("%s: %s<EOF>\n", child->name, child->output); in child_output() 225 if (child->output_seen && !child->exited) in child_tickle() 231 if (!child->exited) in child_stop() [all …]
|
| A D | za-ptrace.c | 130 ret = set_za(child, &za); in ptrace_set_get_vl() 164 ret = set_za(child, &write_za); in ptrace_set_no_data() 219 ret = set_za(child, write_za); in ptrace_set_get_data() 250 static int do_parent(pid_t child) in do_parent() argument 273 if (pid != child) in do_parent() 324 ptrace_set_no_data(child, vl); in do_parent() 336 kill(child, SIGKILL); in do_parent() 345 pid_t child; in main() local 358 child = fork(); in main() 359 if (!child) in main() [all …]
|
| A D | zt-ptrace.c | 134 ret = set_za(child, &za); in ptrace_za_disabled_read_zt() 141 ret = get_zt(child, zt); in ptrace_za_disabled_read_zt() 167 ret = set_zt(child, zt_in); in ptrace_set_get_zt() 214 ret = set_zt(child, zt); in ptrace_enable_za_via_zt() 278 if (pid != child) in do_parent() 321 ptrace_set_get_zt(child); in do_parent() 327 kill(child, SIGKILL); in do_parent() 336 pid_t child; in main() local 357 child = fork(); in main() 358 if (!child) in main() [all …]
|
| A D | sve-ptrace.c | 174 ret = set_sve(child, type, &sve); in ptrace_set_get_inherit() 196 ret = set_sve(child, type, &sve); in ptrace_set_get_inherit() 240 ret = set_sve(child, type, &sve); in ptrace_set_get_vl() 306 ret = set_sve(child, type, sve); in ptrace_sve_fpsimd() 620 static int do_parent(pid_t child) in do_parent() argument 645 if (pid != child) in do_parent() 740 kill(child, SIGKILL); in do_parent() 749 pid_t child; in main() local 756 child = fork(); in main() 757 if (!child) in main() [all …]
|
| /tools/testing/selftests/arm64/gcs/ |
| A D | gcs-stress.c | 69 child->pid = fork(); in start_thread() 70 if (child->pid == -1) in start_thread() 74 if (!child->pid) { in start_thread() 133 ev.data.ptr = child; in start_thread() 171 if (child->output) { in child_output_read() 216 child->stdout = -1; in child_output() 221 ksft_print_msg("%s: %s<EOF>\n", child->name, child->output); in child_output() 229 if (child->output_seen && !child->exited) in child_tickle() 235 if (!child->exited) in child_stop() 267 child->name, child->exit_signal); in child_cleanup() [all …]
|
| /tools/perf/arch/x86/tests/ |
| A D | bp-modify.c | 32 int child = fork(); in spawn_child() local 34 if (child == 0) { in spawn_child() 52 return child; in spawn_child() 61 pid_t child; in bp_modify1() local 65 child = spawn_child(); in bp_modify1() 67 waitpid(child, &status, 0); in bp_modify1() 106 waitpid(child, &status, 0); in bp_modify1() 138 pid_t child; in bp_modify2() local 142 child = spawn_child(); in bp_modify2() 144 waitpid(child, &status, 0); in bp_modify2() [all …]
|
| /tools/testing/selftests/powerpc/ptrace/ |
| A D | ptrace.h | 64 int start_trace(pid_t child) in start_trace() argument 73 ret = waitpid(child, NULL, 0); in start_trace() 74 if (ret != child) { in start_trace() 81 int stop_trace(pid_t child) in stop_trace() argument 93 int cont_trace(pid_t child) in cont_trace() argument 111 FAIL_IF(start_trace(child)); in ptrace_read_regs() 120 FAIL_IF(stop_trace(child)); in ptrace_read_regs() 131 FAIL_IF(start_trace(child)); in ptrace_write_regs() 138 FAIL_IF(stop_trace(child)); in ptrace_write_regs() 325 int show_fpr(pid_t child, __u64 *fpr) in show_fpr() argument [all …]
|
| A D | ptrace-gpr.c | 22 static int child(void) in child() function 47 int trace_gpr(pid_t child) in trace_gpr() argument 52 FAIL_IF(start_trace(child)); in trace_gpr() 55 FAIL_IF(show_gpr(child, gpr)); in trace_gpr() 59 FAIL_IF(show_fpr(child, fpr)); in trace_gpr() 64 peeked_fprs = peek_fprs(child); in trace_gpr() 70 FAIL_IF(write_gpr(child, parent_gpr_val)); in trace_gpr() 74 FAIL_IF(write_fpr(child, tmp)); in trace_gpr() 77 peeked_fprs = peek_fprs(child); in trace_gpr() 85 FAIL_IF(stop_trace(child)); in trace_gpr() [all …]
|
| A D | ptrace-tm-gpr.c | 87 int trace_tm_gpr(pid_t child) in trace_tm_gpr() argument 92 FAIL_IF(start_trace(child)); in trace_tm_gpr() 93 FAIL_IF(show_gpr(child, gpr)); in trace_tm_gpr() 95 FAIL_IF(show_fpr(child, fpr)); in trace_tm_gpr() 97 FAIL_IF(show_ckpt_fpr(child, fpr)); in trace_tm_gpr() 99 FAIL_IF(show_ckpt_gpr(child, gpr)); in trace_tm_gpr() 101 FAIL_IF(write_ckpt_gpr(child, GPR_3)); in trace_tm_gpr() 102 FAIL_IF(write_ckpt_fpr(child, FPR_3_REP)); in trace_tm_gpr() 105 FAIL_IF(stop_trace(child)); in trace_tm_gpr()
|
| A D | ptrace-tm-spd-gpr.c | 93 int trace_tm_spd_gpr(pid_t child) in trace_tm_spd_gpr() argument 98 FAIL_IF(start_trace(child)); in trace_tm_spd_gpr() 99 FAIL_IF(show_gpr(child, gpr)); in trace_tm_spd_gpr() 101 FAIL_IF(show_fpr(child, fpr)); in trace_tm_spd_gpr() 103 FAIL_IF(show_ckpt_fpr(child, fpr)); in trace_tm_spd_gpr() 105 FAIL_IF(show_ckpt_gpr(child, gpr)); in trace_tm_spd_gpr() 107 FAIL_IF(write_ckpt_gpr(child, GPR_3)); in trace_tm_spd_gpr() 108 FAIL_IF(write_ckpt_fpr(child, FPR_3_REP)); in trace_tm_spd_gpr() 112 FAIL_IF(stop_trace(child)); in trace_tm_spd_gpr()
|
| A D | ptrace-tar.c | 51 int trace_tar(pid_t child) in trace_tar() argument 55 FAIL_IF(start_trace(child)); in trace_tar() 56 FAIL_IF(show_tar_registers(child, reg)); in trace_tar() 61 FAIL_IF(stop_trace(child)); in trace_tar() 65 int trace_tar_write(pid_t child) in trace_tar_write() argument 67 FAIL_IF(start_trace(child)); in trace_tar_write() 68 FAIL_IF(write_tar_registers(child, TAR_2, PPR_2, DSCR_2)); in trace_tar_write() 72 FAIL_IF(stop_trace(child)); in trace_tar_write()
|
| A D | ptrace-tm-vsx.c | 84 int trace_tm_vsx(pid_t child) in trace_tm_vsx() argument 89 FAIL_IF(start_trace(child)); in trace_tm_vsx() 90 FAIL_IF(show_vsx(child, vsx)); in trace_tm_vsx() 92 FAIL_IF(show_vmx(child, vmx)); in trace_tm_vsx() 94 FAIL_IF(show_vsx_ckpt(child, vsx)); in trace_tm_vsx() 96 FAIL_IF(show_vmx_ckpt(child, vmx)); in trace_tm_vsx() 103 FAIL_IF(write_vsx_ckpt(child, vsx)); in trace_tm_vsx() 104 FAIL_IF(write_vmx_ckpt(child, vmx)); in trace_tm_vsx() 106 FAIL_IF(stop_trace(child)); in trace_tm_vsx()
|
| /tools/testing/selftests/ptrace/ |
| A D | peeksiginfo.c | 44 static int check_error_paths(pid_t child) in check_error_paths() argument 157 pid_t child; in main() local 163 child = fork(); in main() 164 if (child == -1) { in main() 167 } else if (child == 0) { in main() 185 sys_rt_tgsigqueueinfo(child, child, SIGRTMIN, &siginfo); in main() 191 waitpid(child, NULL, 0); in main() 194 if (check_direct_path(child, 0, 1)) in main() 204 if (check_direct_path(child, 1, 3)) in main() 207 if (check_error_paths(child)) in main() [all …]
|
| A D | get_set_sud.c | 21 pid_t child; in TEST() local 25 child = fork(); in TEST() 26 ASSERT_GE(child, 0); in TEST() 27 if (child == 0) { in TEST() 35 waitpid(child, &status, 0); in TEST() 40 ret = sys_ptrace(PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG, child, in TEST() 54 ret = sys_ptrace(PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG, child, in TEST() 60 ret = sys_ptrace(PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG, child, in TEST() 69 kill(child, SIGKILL); in TEST()
|
| /tools/testing/selftests/arm64/abi/ |
| A D | ptrace.c | 32 static void test_tpidr(pid_t child) in test_tpidr() argument 117 ret = ptrace(PTRACE_GETREGSET, child, NT_ARM_TLS, in test_tpidr() 145 ret = ptrace(PTRACE_GETREGSET, child, type, &iov); in test_hw_debug() 174 static int do_parent(pid_t child) in do_parent() argument 195 if (pid != child) in do_parent() 237 test_tpidr(child); in do_parent() 244 kill(child, SIGKILL); in do_parent() 253 pid_t child; in main() local 261 child = fork(); in main() 262 if (!child) in main() [all …]
|
| /tools/testing/selftests/bpf/prog_tests/ |
| A D | uprobe_multi_test.c | 73 static void kick_child(struct child *child) in kick_child() argument 86 struct child *child = arg; in child_func() local 111 child->pid = child->tid = clone(child_func, child->stack + sizeof(child->stack)/2, in spawn_child_flag() 114 child->pid = child->tid = fork(); in spawn_child_flag() 136 struct child *child = ctx; in child_thread() local 215 if (!child || !child->thread) { in uprobe_multi_test_run() 268 struct child *child) in __test_attach_api() argument 270 pid_t pid = child ? child->pid : -1; in __test_attach_api() 332 static struct child child; in test_attach_api() local 738 static struct child child; in test_link_api() local [all …]
|
| /tools/testing/selftests/perf_events/ |
| A D | watermark_signal.c | 48 pid_t child = -1; in TEST() local 66 child = fork(); in TEST() 67 EXPECT_GE(child, 0); in TEST() 68 if (child == 0) in TEST() 70 else if (child < 0) { in TEST() 75 if (waitpid(child, &child_status, WSTOPPED) != child || in TEST() 84 fd = syscall(__NR_perf_event_open, &attr, child, -1, -1, in TEST() 117 if (kill(child, SIGCONT) < 0) { in TEST() 138 if (child > 0) { in TEST() 139 kill(child, SIGKILL); in TEST() [all …]
|
| /tools/testing/selftests/cgroup/ |
| A D | test_core.c | 332 if (child) in test_cgcore_invalid_domain() 338 free(child); in test_cgcore_invalid_domain() 376 if (child) in test_cgcore_parent_becomes_threaded() 380 free(child); in test_cgcore_parent_becomes_threaded() 430 if (child) in test_cgcore_no_internal_process_constraint_on_threads() 434 free(child); in test_cgcore_no_internal_process_constraint_on_threads() 468 if (child) in test_cgcore_top_down_constraint_enable() 472 free(child); in test_cgcore_top_down_constraint_enable() 512 if (child) in test_cgcore_top_down_constraint_disable() 516 free(child); in test_cgcore_top_down_constraint_disable() [all …]
|
| A D | test_kmem.c | 133 char *child; in cg_run_in_subcgroups() local 138 if (!child) in cg_run_in_subcgroups() 142 cg_destroy(child); in cg_run_in_subcgroups() 143 free(child); in cg_run_in_subcgroups() 148 cg_destroy(child); in cg_run_in_subcgroups() 149 free(child); in cg_run_in_subcgroups() 153 cg_destroy(child); in cg_run_in_subcgroups() 154 free(child); in cg_run_in_subcgroups() 374 if (!child) in test_percpu_basic() 380 free(child); in test_percpu_basic() [all …]
|
| A D | test_cpuset.c | 32 const char *child = cgroup; in do_controller_fn() local 38 if (!cg_read_strstr(child, "cgroup.controllers", "cpuset")) in do_controller_fn() 44 if (cg_read_strstr(child, "cgroup.controllers", "cpuset")) in do_controller_fn() 50 if (!cg_read_strstr(child, "cgroup.controllers", "cpuset")) in do_controller_fn() 169 char *parent = NULL, *child = NULL; in test_cpuset_perms_subtree() local 187 child = cg_name(parent, "cpuset_test_1"); in test_cpuset_perms_subtree() 188 if (!child) in test_cpuset_perms_subtree() 190 child_procs = cg_name(child, "cgroup.procs"); in test_cpuset_perms_subtree() 193 if (cg_create(child)) in test_cpuset_perms_subtree() 223 cg_destroy(child); in test_cpuset_perms_subtree() [all …]
|
| A D | test_cpu.c | 57 if (!child) in test_cpucg_subtree_control() 60 if (cg_create(child)) in test_cpucg_subtree_control() 87 cg_destroy(child); in test_cpucg_subtree_control() 88 free(child); in test_cpucg_subtree_control() 510 if (cg_create(child)) in run_cpucg_nested_weight_test() 525 ancestor = child; in run_cpucg_nested_weight_test() 594 cg_destroy(child); in run_cpucg_nested_weight_test() 595 free(child); in run_cpucg_nested_weight_test() 719 char *parent, *child; in test_cpucg_max_nested() local 771 cg_destroy(child); in test_cpucg_max_nested() [all …]
|
| /tools/testing/selftests/landlock/ |
| A D | ptrace_test.c | 257 pid_t child, parent; in TEST_F() local 322 child = fork(); in TEST_F() 323 ASSERT_LE(0, child); in TEST_F() 324 if (child == 0) { in TEST_F() 398 ASSERT_EQ(child, waitpid(child, &status, 0)); in TEST_F() 425 ASSERT_EQ(child, waitpid(child, &status, 0)); in TEST_F() 432 ASSERT_EQ(child, waitpid(child, &status, 0)); in TEST_F() 479 pid_t child; in TEST_F() local 507 child = fork(); in TEST_F() 509 if (child == 0) { in TEST_F() [all …]
|
| /tools/testing/selftests/pidfd/ |
| A D | pidfd_fdinfo_test.c | 87 struct child { struct 97 struct child ret; in clone_newns() 126 static inline void child_close(struct child *child) in child_close() argument 128 close(child->fd); in child_close() 131 static inline int child_join(struct child *child, struct error *err) in child_join() argument 135 r = wait_for_pid(child->pid); in child_join() 151 static inline int child_join_close(struct child *child, struct error *err) in child_join_close() argument 153 child_close(child); in child_join_close() 154 return child_join(child, err); in child_join_close() 255 struct child a, b; in test_pidfd_fdinfo_nspid() [all …]
|
| /tools/testing/selftests/rlimits/ |
| A D | rlimits-per-userns.c | 88 pid_t child[NR_CHILDS]; in main() local 109 child[i] = fork_child(); in main() 116 if (child[i] <= 0) in main() 120 pid_t ret = waitpid(child[i], &wstatus[i], WNOHANG); in main() 126 warn("(pid=%d): waitpid(%d)", pid, child[i]); in main() 128 child[i] *= -1; in main() 138 if (child[i] <= 0) in main() 140 kill(child[i], SIGUSR1); in main() 147 pid, -child[i], WEXITSTATUS(wstatus[i])); in main() 150 pid, -child[i], WTERMSIG(wstatus[i])); in main()
|
| /tools/testing/selftests/mm/ |
| A D | droppable.c | 23 pid_t child; in main() local 34 child = fork(); in main() 35 assert(child >= 0); in main() 36 if (!child) { in main() 49 kill(child, SIGTERM); in main()
|