Skip to content

Commit 6429789

Browse files
brooniewilldeacon
authored andcommitted
kselftest/arm64: Set test names prior to starting children
Since we now flush output immediately on starting children we should ensure that the child name is set beforehand so that any output that does get flushed from the newly created child has the name of the child attached. Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 284d2b4 commit 6429789

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

tools/testing/selftests/arm64/fp/fp-stress.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,12 @@ static void start_fpsimd(struct child_data *child, int cpu, int copy)
290290
{
291291
int ret;
292292

293-
child_start(child, "./fpsimd-test");
294-
295293
ret = asprintf(&child->name, "FPSIMD-%d-%d", cpu, copy);
296294
if (ret == -1)
297295
ksft_exit_fail_msg("asprintf() failed\n");
298296

297+
child_start(child, "./fpsimd-test");
298+
299299
ksft_print_msg("Started %s\n", child->name);
300300
}
301301

@@ -307,29 +307,29 @@ static void start_sve(struct child_data *child, int vl, int cpu)
307307
if (ret < 0)
308308
ksft_exit_fail_msg("Failed to set SVE VL %d\n", vl);
309309

310-
child_start(child, "./sve-test");
311-
312310
ret = asprintf(&child->name, "SVE-VL-%d-%d", vl, cpu);
313311
if (ret == -1)
314312
ksft_exit_fail_msg("asprintf() failed\n");
315313

314+
child_start(child, "./sve-test");
315+
316316
ksft_print_msg("Started %s\n", child->name);
317317
}
318318

319319
static void start_ssve(struct child_data *child, int vl, int cpu)
320320
{
321321
int ret;
322322

323+
ret = asprintf(&child->name, "SSVE-VL-%d-%d", vl, cpu);
324+
if (ret == -1)
325+
ksft_exit_fail_msg("asprintf() failed\n");
326+
323327
ret = prctl(PR_SME_SET_VL, vl | PR_SME_VL_INHERIT);
324328
if (ret < 0)
325329
ksft_exit_fail_msg("Failed to set SME VL %d\n", ret);
326330

327331
child_start(child, "./ssve-test");
328332

329-
ret = asprintf(&child->name, "SSVE-VL-%d-%d", vl, cpu);
330-
if (ret == -1)
331-
ksft_exit_fail_msg("asprintf() failed\n");
332-
333333
ksft_print_msg("Started %s\n", child->name);
334334
}
335335

@@ -341,12 +341,12 @@ static void start_za(struct child_data *child, int vl, int cpu)
341341
if (ret < 0)
342342
ksft_exit_fail_msg("Failed to set SME VL %d\n", ret);
343343

344-
child_start(child, "./za-test");
345-
346344
ret = asprintf(&child->name, "ZA-VL-%d-%d", vl, cpu);
347345
if (ret == -1)
348346
ksft_exit_fail_msg("asprintf() failed\n");
349347

348+
child_start(child, "./za-test");
349+
350350
ksft_print_msg("Started %s\n", child->name);
351351
}
352352

0 commit comments

Comments
 (0)