[PATCH] kselftest/arm64: Ensure stable names for GCS stress test results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tools/testing/selftests/arm64/gcs/gcs-stress.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/testing/selftests/arm64/gcs/gcs-stress.c b/tools/testing/selftests/arm64/gcs/gcs-stress.c
index bdec7ee8cfd5..03222c36c436 100644
--- a/tools/testing/selftests/arm64/gcs/gcs-stress.c
+++ b/tools/testing/selftests/arm64/gcs/gcs-stress.c
@@ -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

---
base-commit: bb9ae1a66c85eeb626864efd812c62026e126ec0
change-id: 20241011-arm64-gcs-stress-stable-name-8550519fe152

Best regards,
-- 
Mark Brown <broonie@xxxxxxxxxx>





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux