Skip to content

Commit 9b9be78

Browse files
brooniectmarinas
authored andcommitted
kselftest/arm64: Ensure stable names for GCS stress test results
The GCS stress test program currently uses the PID of the threads it creates in the test names it reports, resulting in unstable test names between runs. Fix this by using a thread number instead. Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/20241011-arm64-gcs-stress-stable-name-v1-1-4950f226218e@kernel.org Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 48f8d9c commit 9b9be78

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static int num_processors(void)
5656
return nproc;
5757
}
5858

59-
static void start_thread(struct child_data *child)
59+
static void start_thread(struct child_data *child, int id)
6060
{
6161
int ret, pipefd[2], i;
6262
struct epoll_event ev;
@@ -132,7 +132,7 @@ static void start_thread(struct child_data *child)
132132
ev.events = EPOLLIN | EPOLLHUP;
133133
ev.data.ptr = child;
134134

135-
ret = asprintf(&child->name, "Thread-%d", child->pid);
135+
ret = asprintf(&child->name, "Thread-%d", id);
136136
if (ret == -1)
137137
ksft_exit_fail_msg("asprintf() failed\n");
138138

@@ -437,7 +437,7 @@ int main(int argc, char **argv)
437437
tests);
438438

439439
for (i = 0; i < gcs_threads; i++)
440-
start_thread(&children[i]);
440+
start_thread(&children[i], i);
441441

442442
/*
443443
* All children started, close the startup pipe and let them

0 commit comments

Comments
 (0)