Lines Matching defs:tracee
102 pid_t tracee, tracer, wpid;
116 DPRINTF("Spawn tracee\n");
118 tracee = atf_utils_fork();
119 if (tracee == 0) {
126 CHILD_FROM_PARENT("exit tracee", parent_tracee, msg);
142 DPRINTF("Await for a stopped parent PID %d\n", tracee);
143 await_stopped(tracee);
146 DPRINTF("Before calling PT_ATTACH from tracee %d\n", getpid());
147 FORKEE_ASSERT(ptrace(PT_ATTACH, tracee, NULL, 0) != -1);
149 /* Wait for tracee and assert that it was stopped w/ SIGSTOP */
151 wpid = TWAIT_GENERIC(tracee, &status, 0), tracee);
155 /* Resume tracee with PT_CONTINUE */
156 FORKEE_ASSERT(ptrace(PT_CONTINUE, tracee, (void *)1, 0) != -1);
158 /* Inform parent that tracer has attached to tracee */
161 /* Wait for parent to tell use that tracee should have exited */
162 CHILD_FROM_PARENT("wait for tracee exit", parent_tracer, msg);
164 /* Wait for tracee and assert that it exited */
166 wpid = TWAIT_GENERIC(tracee, &status, 0), tracee);
169 DPRINTF("Tracee %d exited with %d\n", tracee, exitval_tracee);
183 DPRINTF("Wait for the non-exited tracee process with %s()\n",
186 wpid = TWAIT_GENERIC(tracee, NULL, WNOHANG), 0);
189 DPRINTF("Wait for the tracer to attach to the tracee\n");
192 DPRINTF("Resume the tracee and let it exit\n");
193 PARENT_TO_CHILD("exit tracee", parent_tracee, msg);
195 DPRINTF("Detect that tracee is zombie\n");
197 await_zombie_raw(tracee, 0);
199 await_zombie(tracee);
201 DPRINTF("Assert that there is no status about tracee %d - "
202 "Tracer must detect zombie first - calling %s()\n", tracee,
205 wpid = TWAIT_GENERIC(tracee, &status, WNOHANG), 0);
208 DPRINTF("Resume the tracer and let it detect exited tracee\n");
212 PARENT_TO_CHILD("wait for tracee exit", parent_tracer, msg);
217 "tracee\n");
224 DPRINTF("Wait for tracee to finish its job and exit - calling %s()\n",
226 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(tracee, &status, 0), tracee);
316 pid_t tracee, wpid;
322 DPRINTF("Spawn tracee\n");
324 tracee = atf_utils_fork();
325 if (tracee == 0) {
327 DPRINTF("Parent should now attach to tracee\n");
341 DPRINTF("Await for a stopped tracee PID %d\n", tracee);
342 await_stopped(tracee);
345 DPRINTF("Before calling PT_ATTACH for tracee %d\n", tracee);
346 SYSCALL_REQUIRE(ptrace(PT_ATTACH, tracee, NULL, 0) != -1);
348 DPRINTF("Wait for the stopped tracee process with %s()\n",
351 wpid = TWAIT_GENERIC(tracee, &status, 0), tracee);
355 DPRINTF("Resume tracee with PT_CONTINUE\n");
356 SYSCALL_REQUIRE(ptrace(PT_CONTINUE, tracee, (void *)1, 0) != -1);
358 DPRINTF("Let the tracee exit now\n");
361 DPRINTF("Wait for tracee to exit with %s()\n", TWAIT_FNAME);
363 wpid = TWAIT_GENERIC(tracee, &status, 0), tracee);
367 DPRINTF("Before calling %s() for tracee\n", TWAIT_FNAME);
369 wpid = TWAIT_GENERIC(tracee, &status, 0));
538 pid_t parent, tracee, tracer, wpid;
564 DPRINTF("Spawn tracee\n");
567 tracee = atf_utils_fork();
568 if (tracee == 0) {
572 CHILD_TO_PARENT("tracee ready", parent_tracee, msg);
573 CHILD_FROM_PARENT("exit tracee", parent_tracee, msg);
607 PARENT_FROM_CHILD("tracee ready", parent_tracee, msg);
613 DPRINTF("Before calling PT_ATTACH from tracee %d\n", getpid());
614 FORKEE_ASSERT(ptrace(PT_ATTACH, tracee, NULL, 0) != -1);
616 /* Wait for tracee and assert that it was stopped w/ SIGSTOP */
618 wpid = TWAIT_GENERIC(tracee, &status, 0), tracee);
622 /* Resume tracee with PT_CONTINUE */
623 FORKEE_ASSERT(ptrace(PT_CONTINUE, tracee, (void *)1, 0) != -1);
625 /* Inform parent that tracer has attached to tracee */
628 /* Wait for parent to tell use that tracee should have exited */
629 CHILD_FROM_PARENT("wait for tracee exit", parent_tracer, msg);
631 /* Wait for tracee and assert that it exited */
633 wpid = TWAIT_GENERIC(tracee, &status, 0), tracee);
641 DPRINTF("Wait for the tracer to attach to the tracee\n");
644 DPRINTF("Resume the tracee and let it exit\n");
645 PARENT_TO_CHILD("exit tracee", parent_tracee, msg);
647 DPRINTF("Detect that tracee is zombie\n");
648 await_zombie(tracee);
650 DPRINTF("Assert that there is no status about tracee - "
653 wpid = TWAIT_GENERIC(tracee, &status, WNOHANG), 0);
656 PARENT_TO_CHILD("wait for tracee exit", parent_tracer, msg);
658 DPRINTF("Wait from tracer child to complete waiting for tracee\n");
664 DPRINTF("Wait for tracee to finish its job and exit - calling %s()\n",
666 TWAIT_REQUIRE_SUCCESS(wpid = TWAIT_GENERIC(tracee, &status, WNOHANG),
667 tracee);
680 "Assert that tracee sees its original parent when being traced " \