Home
last modified time | relevance | path

Searched refs:child (Results 1 – 25 of 73) sorted by relevance

123

/tools/perf/arch/x86/tests/
Dbp-modify.c32 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/
Dptrace.h60 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 …]
Dptrace-tm-gpr.c87 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()
Dptrace-tar.c51 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()
Dptrace-tm-vsx.c84 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()
Dptrace-tm-spd-gpr.c93 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()
Dptrace-tm-spd-vsx.c96 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()
Dptrace-gpr.c55 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()
Dptrace-vsx.c37 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()
Dptrace-tm-tar.c90 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()
Dptrace-tm-spd-tar.c101 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/
Dpeeksiginfo.c44 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/
Dtest_core.c276 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 …]
Dtest_kmem.c129 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 …]
Dtest_memcontrol.c29 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 …]
Dtest_freezer.c459 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/
Dpidfd_fdinfo_test.c86 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 …]
Dpidfd_getfd_test.c98 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/
Dtest_mremap_vdso.c59 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/
Drbtree_augmented.h126 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/
Dmap_populate.c33 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/
Dfw_namespace.c69 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/
Dunprivileged-remount-test.c185 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/
Drename_attack_test.c57 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/
Dflamegraph.py61 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

123