Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jan 2024 10:31:49 GMT
From:      Peter Holm <pho@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f1bc2f67a3e0 - main - stress2: Reduce idle time. Remove debug output
Message-ID:  <202401091031.409AVn10036127@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by pho:

URL: https://cgit.FreeBSD.org/src/commit/?id=f1bc2f67a3e0dd5120c3345c11bd3205b4348b8a

commit f1bc2f67a3e0dd5120c3345c11bd3205b4348b8a
Author:     Peter Holm <pho@FreeBSD.org>
AuthorDate: 2024-01-09 10:28:26 +0000
Commit:     Peter Holm <pho@FreeBSD.org>
CommitDate: 2024-01-09 10:28:26 +0000

    stress2: Reduce idle time. Remove debug output
---
 tools/test/stress2/misc/mmap10.sh | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/tools/test/stress2/misc/mmap10.sh b/tools/test/stress2/misc/mmap10.sh
index a29768c36691..0bb7845f4d15 100755
--- a/tools/test/stress2/misc/mmap10.sh
+++ b/tools/test/stress2/misc/mmap10.sh
@@ -40,18 +40,22 @@ sed '1,/^EOF/d' < $here/$0 > mmap10.c
 mycc -o mmap10 -Wall -Wextra -O2 -g mmap10.c -lpthread || exit 1
 rm -f mmap10.c
 
-daemon sh -c "(cd $here/../testcases/swap; ./swap -t 2m -i 20 -k)"
+daemon sh -c "(cd $here/../testcases/swap; ./swap -t 2m -i 20 -k > /dev/null)"
+ulimit -c 0
 sleep `jot -r 1 0 9`
 for i in `jot 2`; do
-	/tmp/mmap10 &
+	su $testuser -c /tmp/mmap10 &
 done
-sleep 300
+start=`date +%s`
 while pgrep -q mmap10; do
-	pkill -9 mmap10
+	[ $((`date +%s` - start)) -ge 300 ] && break
+	sleep 2
+done
+while pgrep -q 'mmap10|swap'; do
+	pkill -9 mmap10 swap
 	sleep 2
 done
 wait
-killall -q swap
 
 rm -f /tmp/mmap10 /tmp/mmap10.core
 exit 0
@@ -76,6 +80,7 @@ EOF
 #define N (128 * 1024 / (int)sizeof(u_int32_t))
 #define PARALLEL 50
 
+static int debug = 0; /* set to "1" for debug output */
 void *p;
 u_int32_t r[N];
 
@@ -169,7 +174,7 @@ tmlock(void *arg __unused)
 			if (munlock(makeptr(), len) == 0)
 				n++;
 	}
-	if (n < 10)
+	if (debug == 1 && n < 10)
 		fprintf(stderr, "Note: tmlock() only succeeded %d times.\n",
 		    n);
 
@@ -193,7 +198,7 @@ tmprotect(void *arg __unused)
 			n++;
 		usleep(1000);
 	}
-	if (n < 10)
+	if (debug == 1 && n < 10)
 		fprintf(stderr, "Note: tmprotect() only succeeded %d times.\n",
 		    n);
 
@@ -215,7 +220,7 @@ tmlockall(void *arg __unused)
 		munlockall();
 		usleep(1000);
 	}
-	if (n < 10)
+	if (debug == 1 && n < 10)
 		fprintf(stderr, "Note: tmlockall() only succeeded %d times.\n",
 		    n);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401091031.409AVn10036127>