add test scripts
authorLaurent MAZET <laurent.mazet@thalesgroup.com>
Thu, 2 Oct 2025 10:00:42 +0000 (12:00 +0200)
committerLaurent MAZET <laurent.mazet@thalesgroup.com>
Thu, 2 Oct 2025 10:01:37 +0000 (12:01 +0200)
getinfo.sh
gettable.awk
gettable.sh [new file with mode: 0755]
sync.sh [new file with mode: 0755]
test.sh

index a475916c36e4cd05b5a2c7ccfc20157e7bbb075d..af285ebbed8cc6142ce17f15a4357cbbed308421 100755 (executable)
@@ -1,6 +1,14 @@
 #!/bin/sh
 
 echo OS: $(uname -a 2>/dev/null || cat /proc/version)
+echo "Model: $(cat /proc/cpuinfo | awk -F: '/[mM]odel/ {print $2; exit}')"
 cat /proc/cpuinfo | awk '/Features/ { sub(/\t/, ""); print; exit }'
 echo Nb cores: $(grep -c processor /proc/cpuinfo)
 cat /proc/meminfo | awk '/MemTotal/ { printf "Memory: %dGB\n", ($2+2^20-1)/2^20 }'
+
+config="/boot/config-$(uname -r)"
+[ -f "$config" ] && hz=$(cat "$config" | grep '^[^#].*HZ=')
+config=/proc/config.gz
+[ -f "$config" ] && hz=$(zcat "$config" | grep '^[^#].*HZ=')
+echo "Jiffies config: $(echo $hz)"
+
index bfb917537d5275a35206f6e1573c1afa5fd87af3..1fdb5265f9651d774d09d22754c142a30d8fe178 100755 (executable)
@@ -1,8 +1,8 @@
-#!/bin/awk -f
+#!/usr/bin/awk -f
 
 BEGIN {
     OFS=" & "
-    print "Test", "Load", "Minimum", "Average", "Maximun", "Standard Dev.", "25th %", "Median", "75th %"
+    #print "Test", "Load", "Minimum (us)", "Average (us)", "Maximun (us)", "Standard Dev. (us)", "25th % (us)", "Median (us)", "75th % (us)"
 }
 
 /Test:/ {
@@ -10,6 +10,8 @@ BEGIN {
     test=$0
 }
 
+{ sub (/us$/, "") }
+
 /Minimum/ { min=$3 }
 /Maximum/ { max=$3 }
 /Average/ { avg=$3 }
diff --git a/gettable.sh b/gettable.sh
new file mode 100755 (executable)
index 0000000..1280967
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+echo "Test & Load & Minimum (us) & Average (us) & Maximun (us) & Standard Dev. (us) & 25th % (us) & Median (us) & 75th % (us)"
+
+for t in *.exe; do
+  t=${t/.exe/};
+  for p in 0 50 100; do
+    f=$t-$p%.log
+    [ -f $f ] && awk -f gettable.awk -v COMMENT=$p% $f
+  done
+done
diff --git a/sync.sh b/sync.sh
new file mode 100755 (executable)
index 0000000..ad85a02
--- /dev/null
+++ b/sync.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# ssh-keygen
+# cat ~/.ssh/id_rsa.pub | ssh mazet@192.168.1.1 "cat >> ~/.ssh/authorized_keys"
+for f in  cyclictest getinfo.sh gettable.awk hackbench load.exe mq.exe mutex.exe pipe.exe semaphore.exe test.sh thread.exe udp.exe; do
+scp mazet@192.168.1.1:benchmarks/$f .
+done
diff --git a/test.sh b/test.sh
index 3e158a38558de6abe62479e0167b63b435cd4261..ee986e646c0ed7fd5987ef9afb2efc67ee8f1c63 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -3,12 +3,13 @@
 export pid
 
 function run() {
+  load=$1
   for test in mutex semaphore thread mq pipe udp; do
-    ./getinfo.sh
+    ./getinfo.sh | tee $test-$load.log
     pid=-1
-    { ./$test.exe -d 1 -n 10000 -s -o $test-$1.dat; \
+    { ./$test.exe -d 1 -n 10000 -s -o $test-$load.dat | tee -a $test-$load.log; \
       kill -2 $(ps -e | awk '/[h]ackbench/ || /[s]leep/ { print $1 }') 2>/dev/null; } &
-    case "$1" in
+    case "$load" in
     0%) sleep 60;;
     50%) ./hackbench -p -g 1 -f 1 -T 1 -P 1 -s $((100 * 1000)) -l $((2 * 1000 * 1000));;
     100%) ./hackbench -p -g 20 -l $((100 * 1000));;
@@ -19,5 +20,5 @@ function run() {
 }
 
 for p in 0 50 100; do
-  run $p% | tee test-$p%.log
+  run $p%
 done