]> Git Repo - linux.git/commitdiff
kselftest/arm64: Ensure stable names for GCS stress test results
authorMark Brown <[email protected]>
Fri, 11 Oct 2024 14:36:25 +0000 (15:36 +0100)
committerCatalin Marinas <[email protected]>
Wed, 16 Oct 2024 14:54:19 +0000 (15:54 +0100)
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 <[email protected]>
Link: https://lore.kernel.org/r/20241011-arm64-gcs-stress-stable-name-v1-1-4950f226218e@kernel.org
Signed-off-by: Catalin Marinas <[email protected]>
tools/testing/selftests/arm64/gcs/gcs-stress.c

index bdec7ee8cfd5d784e9c33ba2431b3e376a0b849b..03222c36c43619a8fc437d011528d45e9a508af1 100644 (file)
@@ -56,7 +56,7 @@ static int num_processors(void)
        return nproc;
 }
 
-static void start_thread(struct child_data *child)
+static void start_thread(struct child_data *child, int id)
 {
        int ret, pipefd[2], i;
        struct epoll_event ev;
@@ -132,7 +132,7 @@ static void start_thread(struct child_data *child)
                ev.events = EPOLLIN | EPOLLHUP;
                ev.data.ptr = child;
 
-               ret = asprintf(&child->name, "Thread-%d", child->pid);
+               ret = asprintf(&child->name, "Thread-%d", id);
                if (ret == -1)
                        ksft_exit_fail_msg("asprintf() failed\n");
 
@@ -437,7 +437,7 @@ int main(int argc, char **argv)
                                   tests);
 
        for (i = 0; i < gcs_threads; i++)
-               start_thread(&children[i]);
+               start_thread(&children[i], i);
 
        /*
         * All children started, close the startup pipe and let them
This page took 0.062101 seconds and 4 git commands to generate.