Added test to check behavior under CPU load
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 10 Sep 2009 14:52:33 +0000 (16:52 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 10 Sep 2009 14:52:33 +0000 (16:52 +0200)
tests/cpuload.sh [new file with mode: 0755]
tests/cpuload2.sh [new file with mode: 0755]

diff --git a/tests/cpuload.sh b/tests/cpuload.sh
new file mode 100755 (executable)
index 0000000..742cf85
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+. _lib.sh
+
+NUM_PROC=30
+
+t() {
+    for i in norm boost; do
+       for budget in 300 1 1000; do
+           echo $budget > /proc/sys/net/core/netdev_budget
+           PID_LOAD=""; for j in `seq $NUM_PROC`; do sha1sum /dev/zero & PID_LOAD="$PID_LOAD $!"; done;
+           echo 0 1 > $DRIVER-$i-$budget-1000.dat
+           if [ $budget -eq 300 -o $DRIVER == "socketcan" ]; then
+               if [ $i != "boost" ] || boost_irq_prio 90; then
+                   PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1`
+                   vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER-$i-$budget -t 1 -d $CAN0 -w 0 -c $COUNT
+                   kill $PID_S
+               fi
+           fi
+           kill $PID_LOAD  
+       done
+    done
+}
+
+
+
+p() { cat <<EOF
+set title "Round-trip time with CPU load"
+set logscale y
+set grid
+set xlabel "Time [ms]"
+set ylabel "Latency profile [messages]"
+plot [0:] \
+          "socketcan-norm-300-1000.dat" with lp lt 1 title "Socketcan",\
+          "lincan-norm-300-1000.dat" with lp lt 2 title "Lincan",\
+          "socketcan-boost-300-1000.dat" with lp lt 1 title "Socketcan boosted IRQ prio",\
+          "lincan-boost-300-1000.dat" with lp lt 2 title "Lincan boosted IRQ prio",\
+          "socketcan-norm-1-1000.dat" with lp lt 1 title "Socketcan netdev\\\\_budget=1",\
+          "socketcan-boost-1-1000.dat" with lp lt 1 title "Socketcan boosted IRQ prio, netdev\\\\_budget=1",\
+          "socketcan-norm-1000-1000.dat" with lp lt 1 title "Socketcan, netdev\\\\_budget=1000",\
+          "socketcan-boost-1000-1000.dat" with lp lt 1 title "Socketcan boosted IRQ prio, netdev\\\\_budget=1000"
+EOF
+}
diff --git a/tests/cpuload2.sh b/tests/cpuload2.sh
new file mode 100755 (executable)
index 0000000..5f3b26b
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+. _lib.sh
+
+NUM_PROC=30
+
+t() {
+    for i in norm boost; do
+       for budget in 300 1 1000; do
+           echo $budget > /proc/sys/net/core/netdev_budget
+           ( while hackbench -pipe 20; do true; done ) &
+           PID_LOAD=$!
+           echo 0 1 > $DRIVER-$i-$budget-1000.dat
+           if [ $budget -eq 300 -o $DRIVER == "socketcan" ]; then
+               if [ $i != "boost" ] || boost_irq_prio 90; then
+                   PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1`
+                   vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER-$i-$budget -t 1 -d $CAN0 -w 0 -c $COUNT
+                   kill $PID_S
+               fi
+           fi
+           kill $PID_LOAD  
+       done
+    done
+}
+
+
+
+p() { cat <<EOF
+set title "Round-trip time with CPU load (hackbench)"
+set logscale y
+set grid
+set xlabel "Time [ms]"
+set ylabel "Latency profile [messages]"
+plot [0:] \
+          "socketcan-norm-300-1000.dat" with lp lt 1 title "Socketcan",\
+          "lincan-norm-300-1000.dat" with lp lt 2 title "Lincan",\
+          "socketcan-boost-300-1000.dat" with lp lt 1 title "Socketcan boosted IRQ prio",\
+          "lincan-boost-300-1000.dat" with lp lt 2 title "Lincan boosted IRQ prio",\
+          "socketcan-norm-1-1000.dat" with lp lt 1 title "Socketcan netdev\\\\_budget=1",\
+          "socketcan-boost-1-1000.dat" with lp lt 1 title "Socketcan boosted IRQ prio, netdev\\\\_budget=1",\
+          "socketcan-norm-1000-1000.dat" with lp lt 1 title "Socketcan, netdev\\\\_budget=1000",\
+          "socketcan-boost-1000-1000.dat" with lp lt 1 title "Socketcan boosted IRQ prio, netdev\\\\_budget=1000"
+EOF
+}