Home
last modified time | relevance | path

Searched refs:child_pid (Results 1 – 23 of 23) sorted by relevance

/tools/testing/selftests/powerpc/ptrace/
Dptrace-hwbreak.c51 static void get_dbginfo(pid_t child_pid, struct ppc_debug_info *dbginfo) in get_dbginfo() argument
53 if (ptrace(PPC_PTRACE_GETHWDBGINFO, child_pid, NULL, dbginfo)) { in get_dbginfo()
211 static void check_success(pid_t child_pid, const char *name, const char *type, in check_success() argument
223 ptrace(PTRACE_GETSIGINFO, child_pid, NULL, &siginfo); in check_success()
240 ptrace(PTRACE_SINGLESTEP, child_pid, NULL, 0); in check_success()
245 static void ptrace_set_debugreg(pid_t child_pid, unsigned long wp_addr) in ptrace_set_debugreg() argument
247 if (ptrace(PTRACE_SET_DEBUGREG, child_pid, 0, wp_addr)) { in ptrace_set_debugreg()
253 static int ptrace_sethwdebug(pid_t child_pid, struct ppc_hw_breakpoint *info) in ptrace_sethwdebug() argument
255 int wh = ptrace(PPC_PTRACE_SETHWDEBUG, child_pid, 0, info); in ptrace_sethwdebug()
264 static void ptrace_delhwdebug(pid_t child_pid, int wh) in ptrace_delhwdebug() argument
[all …]
Dptrace-perf-hwbreak.c86 static int perf_thread_event_open(pid_t child_pid, __u64 addr, __u64 len) in perf_thread_event_open() argument
91 return syscall(__NR_perf_event_open, &attr, child_pid, -1, -1, 0); in perf_thread_event_open()
94 static int perf_thread_cpu_event_open(pid_t child_pid, int cpu, __u64 addr, __u64 len) in perf_thread_cpu_event_open() argument
99 return syscall(__NR_perf_event_open, &attr, child_pid, cpu, -1, 0); in perf_thread_cpu_event_open()
102 static int perf_thread_kernel_event_open(pid_t child_pid) in perf_thread_kernel_event_open() argument
107 return syscall(__NR_perf_event_open, &attr, child_pid, -1, -1, 0); in perf_thread_kernel_event_open()
147 static int ptrace_open(pid_t child_pid, __u64 wp_addr, int len) in ptrace_open() argument
152 return ptrace(PPC_PTRACE_SETHWDEBUG, child_pid, 0, &info); in ptrace_open()
155 static int test1(pid_t child_pid) in test1() argument
172 ptrace_fd = ptrace_open(child_pid, (__u64)ptrace_data1, sizeof(*ptrace_data1)); in test1()
[all …]
Dperf-hwbreak.c778 int child_pid; in get_nr_wps() local
780 child_pid = fork(); in get_nr_wps()
781 if (!child_pid) { in get_nr_wps()
794 if (ptrace(PPC_PTRACE_GETHWDBGINFO, child_pid, NULL, &dbginfo)) { in get_nr_wps()
/tools/testing/selftests/pidfd/
Dpidfd_poll_test.c49 int child_pid = fork(); in main() local
51 if (child_pid < 0) { in main()
61 if (child_pid == 0) { in main()
68 pidfd = sys_pidfd_open(child_pid, 0); in main()
108 if (waitpid(child_pid, NULL, 0) < 0) in main()
/tools/testing/selftests/breakpoints/
Dbreakpoint_test.c33 static pid_t child_pid; variable
46 ret = ptrace(PTRACE_POKEUSER, child_pid, in set_breakpoint_addr()
88 dr7 = ptrace(PTRACE_PEEKUSER, child_pid, in toggle_breakpoint()
108 ret = ptrace(PTRACE_POKEUSER, child_pid, in toggle_breakpoint()
276 child_nr_tests = ptrace(PTRACE_PEEKDATA, child_pid, in check_success()
280 if (ptrace(PTRACE_POKEDATA, child_pid, &trapped, 1)) in check_success()
299 ptrace(PTRACE_CONT, child_pid, NULL, 0); in launch_instruction_breakpoints()
321 ptrace(PTRACE_CONT, child_pid, NULL, 0); in launch_watchpoints()
377 ptrace(PTRACE_CONT, child_pid, NULL, 0); in launch_tests()
381 ptrace(PTRACE_CONT, child_pid, NULL, 0); in launch_tests()
[all …]
/tools/testing/selftests/bpf/prog_tests/
Dtest_bprm_opts.c42 int child_pid, child_status, ret, null_fd; in run_set_secureexec() local
44 child_pid = fork(); in run_set_secureexec()
45 if (child_pid == 0) { in run_set_secureexec()
73 } else if (child_pid > 0) { in run_set_secureexec()
74 waitpid(child_pid, &child_status, 0); in run_set_secureexec()
Dtest_ima.c18 int child_pid, child_status; in run_measured_process() local
20 child_pid = fork(); in run_measured_process()
21 if (child_pid == 0) { in run_measured_process()
27 } else if (child_pid > 0) { in run_measured_process()
28 waitpid(child_pid, &child_status, 0); in run_measured_process()
Dtest_lsm.c39 int child_pid, child_status; in exec_cmd() local
41 child_pid = fork(); in exec_cmd()
42 if (child_pid == 0) { in exec_cmd()
46 } else if (child_pid > 0) { in exec_cmd()
47 waitpid(child_pid, &child_status, 0); in exec_cmd()
Dtest_local_storage.c42 int child_pid, child_status, ret; in run_self_unlink() local
45 child_pid = fork(); in run_self_unlink()
46 if (child_pid == 0) { in run_self_unlink()
59 } else if (child_pid > 0) { in run_self_unlink()
60 waitpid(child_pid, &child_status, 0); in run_self_unlink()
/tools/testing/selftests/powerpc/pmu/
Dlib.c73 int wait_for_child(pid_t child_pid) in wait_for_child() argument
77 if (waitpid(child_pid, &rc, 0) == -1) { in wait_for_child()
90 int kill_child_and_wait(pid_t child_pid) in kill_child_and_wait() argument
92 kill(child_pid, SIGTERM); in kill_child_and_wait()
94 return wait_for_child(child_pid); in kill_child_and_wait()
Dlib.h24 extern int kill_child_and_wait(pid_t child_pid);
25 extern int wait_for_child(pid_t child_pid);
/tools/testing/selftests/net/
Dfin_ack_lat.c15 static int child_pid; variable
106 kill(SIGTERM, child_pid); in sig_handler()
144 child_pid = fork(); in main()
145 if (!child_pid) in main()
/tools/testing/selftests/powerpc/pmu/ebb/
Dtask_event_vs_ebb_test.c22 static int setup_child_event(struct event *event, pid_t child_pid) in setup_child_event() argument
30 FAIL_IF(event_open_with_pid(event, child_pid)); in setup_child_event()
Dtask_event_pinned_vs_ebb_test.c22 static int setup_child_event(struct event *event, pid_t child_pid) in setup_child_event() argument
32 FAIL_IF(event_open_with_pid(event, child_pid)); in setup_child_event()
/tools/testing/selftests/seccomp/
Dseccomp_bpf.c854 pid_t child_pid; in TEST() local
856 child_pid = fork(); in TEST()
857 ASSERT_LE(0, child_pid); in TEST()
858 if (child_pid == 0) { in TEST()
863 ASSERT_EQ(child_pid, waitpid(child_pid, &status, 0)); in TEST()
873 pid_t child_pid; in TEST() local
875 child_pid = fork(); in TEST()
876 ASSERT_LE(0, child_pid); in TEST()
877 if (child_pid == 0) { in TEST()
882 ASSERT_EQ(child_pid, waitpid(child_pid, &status, 0)); in TEST()
[all …]
/tools/power/cpupower/utils/idle_monitor/
Dcpupower-monitor.c286 pid_t child_pid; in fork_it() local
289 child_pid = fork(); in fork_it()
295 if (!child_pid) { in fork_it()
300 if (child_pid == -1) { in fork_it()
307 if (waitpid(child_pid, &status, 0) == -1) { in fork_it()
/tools/testing/selftests/vm/
Dprotection_keys.c1385 pid_t child_pid; in test_ptrace_of_child() local
1401 child_pid = fork_lazy_child(); in test_ptrace_of_child()
1402 dprintf1("[%d] child pid: %d\n", getpid(), child_pid); in test_ptrace_of_child()
1404 ret = ptrace(PTRACE_ATTACH, child_pid, ignored, ignored); in test_ptrace_of_child()
1409 ret = waitpid(child_pid, &status, WUNTRACED); in test_ptrace_of_child()
1410 if ((ret != child_pid) || !(WIFSTOPPED(status))) { in test_ptrace_of_child()
1430 ret = ptrace(PTRACE_PEEKDATA, child_pid, ptr, ignored); in test_ptrace_of_child()
1440 ret = ptrace(PTRACE_PEEKDATA, child_pid, plain_ptr, ignored); in test_ptrace_of_child()
1447 ret = ptrace(PTRACE_DETACH, child_pid, ignored, 0); in test_ptrace_of_child()
1450 ret = kill(child_pid, SIGKILL); in test_ptrace_of_child()
/tools/perf/
Dbuiltin-stat.c176 static volatile pid_t child_pid = -1; variable
682 child_exited = waitpid(child_pid, &status, WNOHANG); in dispatch_events()
754 if (child_pid != -1) in stat_handle_error()
755 kill(child_pid, SIGTERM); in stat_handle_error()
781 child_pid = evsel_list->workload.pid; in __run_perf_stat()
959 if (child_pid != -1) { in __run_perf_stat()
961 kill(child_pid, SIGTERM); in __run_perf_stat()
962 wait4(child_pid, &status, 0, &stat_config.ru_data); in __run_perf_stat()
1059 if ((child_pid == -1) || stat_config.interval) in skip_signal()
1069 child_pid = -1; in skip_signal()
[all …]
/tools/testing/selftests/cgroup/
Dtest_core.c82 int child_pid; in test_cgcore_destroy() local
94 child_pid = cg_run_nowait(cg_test, alloc_and_touch_anon_noexit, in test_cgcore_destroy()
97 if (child_pid < 0) in test_cgcore_destroy()
119 if (waitpid(child_pid, NULL, 0) < 0) in test_cgcore_destroy()
/tools/testing/ktest/
Dktest.pl2778 my $child_pid;
2795 $child_pid = fork;
2797 child_run_test if (!$child_pid);
2847 kill 9, $child_pid;
2850 waitpid $child_pid, 0;
/tools/testing/selftests/filesystems/incfs/
Dincfs_test.c1509 pid_t child_pid = flush_and_fork(); in concurrent_reads_and_writes_test() local
1511 if (child_pid == 0) { in concurrent_reads_and_writes_test()
1522 } else if (child_pid > 0) { in concurrent_reads_and_writes_test()
1523 child_pids[i] = child_pid; in concurrent_reads_and_writes_test()
1856 pid_t child_pid = flush_and_fork(); in child_procs_waiting_for_data_test() local
1858 if (child_pid == 0) { in child_procs_waiting_for_data_test()
1869 } else if (child_pid > 0) { in child_procs_waiting_for_data_test()
1870 child_pids[i] = child_pid; in child_procs_waiting_for_data_test()
/tools/perf/scripts/python/
Dsched-migration.py394 common_callchain, parent_comm, parent_pid, child_comm, child_pid): argument
/tools/power/x86/turbostat/
Dturbostat.c5905 pid_t child_pid; in fork_it() local
5917 child_pid = fork(); in fork_it()
5918 if (!child_pid) { in fork_it()
5925 if (child_pid == -1) in fork_it()
5930 if (waitpid(child_pid, &status, 0) == -1) in fork_it()