Lines Matching refs:child

60 static void child_start(struct child_data *child, const char *program)
70 child->pid = fork();
71 if (child->pid == -1)
75 if (!child->pid) {
77 * In child, replace stdout with the pipe, errors to
124 * In parent, remember the child and close our copy of the
128 child->stdout = pipefd[0];
129 child->output = NULL;
130 child->exited = false;
131 child->output_seen = false;
134 ev.data.ptr = child;
136 ret = epoll_ctl(epoll_fd, EPOLL_CTL_ADD, child->stdout, &ev);
139 child->name, strerror(errno), errno);
144 static bool child_output_read(struct child_data *child)
150 ret = read(child->stdout, read_data, sizeof(read_data));
156 child->name, strerror(errno),
162 child->output_seen = true;
165 if (child->output) {
166 strncpy(work, child->output, sizeof(work) - 1);
168 free(child->output);
169 child->output = NULL;
180 ksft_print_msg("%s: %s\n", child->name, work);
189 ret = asprintf(&child->output, "%s", work);
197 static void child_output(struct child_data *child, uint32_t events,
204 read_more = child_output_read(child);
209 close(child->stdout);
210 child->stdout = -1;
214 if (flush && child->output) {
215 ksft_print_msg("%s: %s<EOF>\n", child->name, child->output);
216 free(child->output);
217 child->output = NULL;
221 static void child_tickle(struct child_data *child)
223 if (child->output_seen && !child->exited)
224 kill(child->pid, SIGUSR2);
227 static void child_stop(struct child_data *child)
229 if (!child->exited)
230 kill(child->pid, SIGTERM);
233 static void child_cleanup(struct child_data *child)
239 if (!child->exited) {
241 ret = waitpid(child->pid, &status, 0);
247 child->pid, strerror(errno),
253 child->exit_status = WEXITSTATUS(status);
256 if (!child->output_seen) {
257 ksft_print_msg("%s no output seen\n", child->name);
261 if (child->exit_status != 0) {
263 child->name, child->exit_status);
267 ksft_test_result(!fail, "%s\n", child->name);
309 static void start_fpsimd(struct child_data *child, int cpu, int copy)
313 ret = asprintf(&child->name, "FPSIMD-%d-%d", cpu, copy);
317 child_start(child, "./fpsimd-test");
319 ksft_print_msg("Started %s\n", child->name);
322 static void start_sve(struct child_data *child, int vl, int cpu)
330 ret = asprintf(&child->name, "SVE-VL-%d-%d", vl, cpu);
334 child_start(child, "./sve-test");
336 ksft_print_msg("Started %s\n", child->name);
339 static void start_ssve(struct child_data *child, int vl, int cpu)
343 ret = asprintf(&child->name, "SSVE-VL-%d-%d", vl, cpu);
351 child_start(child, "./ssve-test");
353 ksft_print_msg("Started %s\n", child->name);
356 static void start_za(struct child_data *child, int vl, int cpu)
364 ret = asprintf(&child->name, "ZA-VL-%d-%d", vl, cpu);
368 child_start(child, "./za-test");
370 ksft_print_msg("Started %s\n", child->name);
373 static void start_zt(struct child_data *child, int cpu)
377 ret = asprintf(&child->name, "ZT-%d", cpu);
381 child_start(child, "./zt-test");
383 ksft_print_msg("Started %s\n", child->name);
506 ksft_exit_fail_msg("Unable to allocate child data\n");
600 * If the child processes have not produced output they