/tools/perf/arch/x86/tests/ |
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() 81 if (ptrace(PTRACE_POKEUSER, child, in bp_modify1() 88 if (ptrace(PTRACE_POKEUSER, child, in bp_modify1() 95 if (ptrace(PTRACE_POKEUSER, child, in bp_modify1() 101 if (ptrace(PTRACE_CONT, child, NULL, NULL)) { in bp_modify1() [all …]
|
/tools/testing/selftests/powerpc/ptrace/ |
D | ptrace.h | 60 int start_trace(pid_t child) in start_trace() argument 64 ret = ptrace(PTRACE_ATTACH, child, NULL, NULL); in start_trace() 69 ret = waitpid(child, NULL, 0); in start_trace() 70 if (ret != child) { in start_trace() 77 int stop_trace(pid_t child) in stop_trace() argument 81 ret = ptrace(PTRACE_DETACH, child, NULL, NULL); in stop_trace() 89 int cont_trace(pid_t child) in cont_trace() argument 93 ret = ptrace(PTRACE_CONT, child, NULL, NULL); in cont_trace() 101 int ptrace_read_regs(pid_t child, unsigned long type, unsigned long regs[], in ptrace_read_regs() argument 107 FAIL_IF(start_trace(child)); in ptrace_read_regs() [all …]
|
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()
|
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()
|
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()
|
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()
|
D | ptrace-tm-spd-vsx.c | 96 int trace_tm_spd_vsx(pid_t child) in trace_tm_spd_vsx() argument 101 FAIL_IF(start_trace(child)); in trace_tm_spd_vsx() 102 FAIL_IF(show_vsx(child, vsx)); in trace_tm_spd_vsx() 104 FAIL_IF(show_vmx(child, vmx)); in trace_tm_spd_vsx() 106 FAIL_IF(show_vsx_ckpt(child, vsx)); in trace_tm_spd_vsx() 108 FAIL_IF(show_vmx_ckpt(child, vmx)); in trace_tm_spd_vsx() 116 FAIL_IF(write_vsx_ckpt(child, vsx)); in trace_tm_spd_vsx() 117 FAIL_IF(write_vmx_ckpt(child, vmx)); in trace_tm_spd_vsx() 121 FAIL_IF(stop_trace(child)); in trace_tm_spd_vsx()
|
D | ptrace-gpr.c | 55 int trace_gpr(pid_t child) in trace_gpr() argument 60 FAIL_IF(start_trace(child)); in trace_gpr() 61 FAIL_IF(show_gpr(child, gpr)); in trace_gpr() 63 FAIL_IF(show_fpr(child, fpr)); in trace_gpr() 65 FAIL_IF(write_gpr(child, GPR_3)); in trace_gpr() 66 FAIL_IF(write_fpr(child, FPR_3_REP)); in trace_gpr() 67 FAIL_IF(stop_trace(child)); in trace_gpr()
|
D | ptrace-vsx.c | 37 int trace_vsx(pid_t child) in trace_vsx() argument 42 FAIL_IF(start_trace(child)); in trace_vsx() 43 FAIL_IF(show_vsx(child, vsx)); in trace_vsx() 45 FAIL_IF(show_vmx(child, vmx)); in trace_vsx() 52 FAIL_IF(write_vsx(child, vsx)); in trace_vsx() 53 FAIL_IF(write_vmx(child, vmx)); in trace_vsx() 54 FAIL_IF(stop_trace(child)); in trace_vsx()
|
D | ptrace-tm-tar.c | 90 int trace_tm_tar(pid_t child) in trace_tm_tar() argument 94 FAIL_IF(start_trace(child)); in trace_tm_tar() 95 FAIL_IF(show_tar_registers(child, regs)); in trace_tm_tar() 100 FAIL_IF(show_tm_checkpointed_state(child, regs)); in trace_tm_tar() 105 FAIL_IF(write_ckpt_tar_registers(child, TAR_4, PPR_4, DSCR_4)); in trace_tm_tar() 110 FAIL_IF(stop_trace(child)); in trace_tm_tar()
|
D | ptrace-tm-spd-tar.c | 101 int trace_tm_spd_tar(pid_t child) in trace_tm_spd_tar() argument 105 FAIL_IF(start_trace(child)); in trace_tm_spd_tar() 106 FAIL_IF(show_tar_registers(child, regs)); in trace_tm_spd_tar() 111 FAIL_IF(show_tm_checkpointed_state(child, regs)); in trace_tm_spd_tar() 116 FAIL_IF(write_ckpt_tar_registers(child, TAR_4, PPR_4, DSCR_4)); in trace_tm_spd_tar() 122 FAIL_IF(stop_trace(child)); in trace_tm_spd_tar()
|
/tools/testing/selftests/ptrace/ |
D | peeksiginfo.c | 44 static int check_error_paths(pid_t child) in check_error_paths() argument 73 ret = sys_ptrace(PTRACE_PEEKSIGINFO, child, &arg, addr_rw); in check_error_paths() 83 ret = sys_ptrace(PTRACE_PEEKSIGINFO, child, &arg, in check_error_paths() 91 ret = sys_ptrace(PTRACE_PEEKSIGINFO, child, &arg, addr_ro); in check_error_paths() 105 int check_direct_path(pid_t child, int shared, int nr) in check_direct_path() argument 122 ret = sys_ptrace(PTRACE_PEEKSIGINFO, child, &arg, siginfo); in check_direct_path() 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() [all …]
|
/tools/testing/selftests/cgroup/ |
D | test_core.c | 276 char *grandparent = NULL, *parent = NULL, *child = NULL; in test_cgcore_invalid_domain() local 280 child = cg_name(root, "cg_test_grandparent/cg_test_parent/cg_test_child"); in test_cgcore_invalid_domain() 281 if (!parent || !child || !grandparent) in test_cgcore_invalid_domain() 290 if (cg_create(child)) in test_cgcore_invalid_domain() 296 if (cg_read_strcmp(child, "cgroup.type", "domain invalid\n")) in test_cgcore_invalid_domain() 299 if (!cg_enter_current(child)) in test_cgcore_invalid_domain() 305 if (!clone_into_cgroup_run_wait(child)) in test_cgcore_invalid_domain() 319 if (child) in test_cgcore_invalid_domain() 320 cg_destroy(child); in test_cgcore_invalid_domain() 325 free(child); in test_cgcore_invalid_domain() [all …]
|
D | test_kmem.c | 129 char *child; in cg_run_in_subcgroups() local 133 child = cg_name_indexed(parent, "child", i); in cg_run_in_subcgroups() 134 if (!child) in cg_run_in_subcgroups() 137 if (cg_create(child)) { in cg_run_in_subcgroups() 138 cg_destroy(child); in cg_run_in_subcgroups() 139 free(child); in cg_run_in_subcgroups() 143 if (cg_run(child, fn, NULL)) { in cg_run_in_subcgroups() 144 cg_destroy(child); in cg_run_in_subcgroups() 145 free(child); in cg_run_in_subcgroups() 149 cg_destroy(child); in cg_run_in_subcgroups() [all …]
|
D | test_memcontrol.c | 29 char *parent, *child, *parent2 = NULL, *child2 = NULL; in test_memcg_subtree_control() local 35 child = cg_name(root, "memcg_test_0/memcg_test_1"); in test_memcg_subtree_control() 36 if (!parent || !child) in test_memcg_subtree_control() 45 if (cg_create(child)) in test_memcg_subtree_control() 48 if (cg_read_strstr(child, "cgroup.controllers", "memory")) in test_memcg_subtree_control() 79 cg_destroy(child); in test_memcg_subtree_control() 84 free(child); in test_memcg_subtree_control() 1010 char *parent, *child; in test_memcg_oom_group_leaf_events() local 1013 child = cg_name(root, "memcg_test_0/memcg_test_1"); in test_memcg_oom_group_leaf_events() 1015 if (!parent || !child) in test_memcg_oom_group_leaf_events() [all …]
|
D | test_freezer.c | 459 char *parent, *child = NULL; in test_cgfreezer_mkdir() local 466 child = cg_name(parent, "cg_test_mkdir_B"); in test_cgfreezer_mkdir() 467 if (!child) in test_cgfreezer_mkdir() 476 if (cg_create(child)) in test_cgfreezer_mkdir() 479 pid = cg_run_nowait(child, child_fn, NULL); in test_cgfreezer_mkdir() 483 if (cg_wait_for_proc_count(child, 1)) in test_cgfreezer_mkdir() 486 if (cg_check_frozen(child, true)) in test_cgfreezer_mkdir() 495 if (child) in test_cgfreezer_mkdir() 496 cg_destroy(child); in test_cgfreezer_mkdir() 497 free(child); in test_cgfreezer_mkdir() [all …]
|
/tools/testing/selftests/pidfd/ |
D | pidfd_fdinfo_test.c | 86 struct child { struct 92 static struct child clone_newns(int (*fn)(void *), void *args, in clone_newns() argument 96 struct child ret; in clone_newns() 125 static inline void child_close(struct child *child) in child_close() argument 127 close(child->fd); in child_close() 130 static inline int child_join(struct child *child, struct error *err) in child_join() argument 134 r = wait_for_pid(child->pid); in child_join() 139 error_set(err, r, "child %d reported: %d", child->pid, r); in child_join() 141 if (munmap(child->stack, CHILD_STACK_SIZE)) { in child_join() 149 static inline int child_join_close(struct child *child, struct error *err) in child_join_close() argument [all …]
|
D | pidfd_getfd_test.c | 98 static int child(int sk) in child() function 116 FIXTURE(child) in FIXTURE() argument 134 FIXTURE_SETUP(child) in FIXTURE_SETUP() argument 148 if (child(sk_pair[1])) in FIXTURE_SETUP() 166 FIXTURE_TEARDOWN(child) in FIXTURE_TEARDOWN() argument 174 TEST_F(child, disable_ptrace) in TEST_F() argument 200 TEST_F(child, fetch_fd) in TEST_F() argument 219 TEST_F(child, test_unknown_fd) in TEST_F() argument
|
/tools/testing/selftests/x86/ |
D | test_mremap_vdso.c | 59 pid_t child; in main() local 61 child = fork(); in main() 62 if (child == -1) { in main() 67 if (child == 0) { in main() 94 if (waitpid(child, &status, 0) != child || in main()
|
/tools/include/linux/ |
D | rbtree_augmented.h | 126 RBSTRUCT *child; \ 129 child = rb_entry(node->RBFIELD.rb_left, RBSTRUCT, RBFIELD); \ 130 if (child->RBAUGMENTED > max) \ 131 max = child->RBAUGMENTED; \ 134 child = rb_entry(node->RBFIELD.rb_right, RBSTRUCT, RBFIELD); \ 135 if (child->RBAUGMENTED > max) \ 136 max = child->RBAUGMENTED; \ 190 struct rb_node *child = node->rb_right; in __rb_erase_augmented() local 205 __rb_change_child(node, child, parent, root); in __rb_erase_augmented() 206 if (child) { in __rb_erase_augmented() [all …]
|
/tools/testing/selftests/vm/ |
D | map_populate.c | 33 static int parent_f(int sock, unsigned long *smap, int child) in parent_f() argument 47 waitpid(child, &status, 0); in parent_f() 77 int sock[2], child, ret; in main() local 99 child = fork(); in main() 100 BUG_ON(child == -1, "fork()"); in main() 102 if (child) { in main() 106 return parent_f(sock[1], smap, child); in main()
|
/tools/testing/selftests/firmware/ |
D | fw_namespace.c | 69 pid_t child; in test_fw_in_ns() local 75 child = fork(); in test_fw_in_ns() 76 if (child == -1) { in test_fw_in_ns() 80 if (child != 0) { /* parent */ in test_fw_in_ns() 84 pid = waitpid(child, &status, 0); in test_fw_in_ns() 89 if (pid != child) { in test_fw_in_ns() 91 child, pid); in test_fw_in_ns()
|
/tools/testing/selftests/mount/ |
D | unprivileged-remount-test.c | 185 pid_t child; in test_unpriv_remount() local 187 child = fork(); in test_unpriv_remount() 188 if (child == -1) { in test_unpriv_remount() 192 if (child != 0) { /* parent */ in test_unpriv_remount() 195 pid = waitpid(child, &status, 0); in test_unpriv_remount() 200 if (pid != child) { in test_unpriv_remount() 202 child, pid); in test_unpriv_remount() 259 pid_t child; in test_priv_mount_unpriv_remount() local 265 child = fork(); in test_priv_mount_unpriv_remount() 266 if (child == -1) { in test_priv_mount_unpriv_remount() [all …]
|
/tools/testing/selftests/openat2/ |
D | rename_attack_test.c | 57 pid_t child = fork(); in spawn_attack() local 58 if (child != 0) in spawn_attack() 59 return child; in spawn_attack() 87 pid_t child; in test_rename_attack() local 106 child = spawn_attack(dfd, "a/c", "b"); in test_rename_attack() 143 E_kill(child, SIGKILL); in test_rename_attack()
|
/tools/perf/scripts/python/ |
D | flamegraph.py | 61 for child in node.children: 62 if child.name == name and child.libtype == libtype: 63 return child 65 child = Node(name, libtype) 66 node.children.append(child) 67 return child
|