]> rtime.felk.cvut.cz Git - can-benchmark.git/blobdiff - gw-tests/lib.sh
Prepare for testing under different loads
[can-benchmark.git] / gw-tests / lib.sh
index 4c4274d301d8ec8576b57b8263ec0aa2c37a8fc9..05b28d1c22842df4cfd44a28a5de3f519bd3c1fb 100644 (file)
@@ -43,7 +43,7 @@ cleanupgw() {
 _plot() {
     local testname=`basename $0 .sh`
 
-    plot_cmds | sed -e "/set title/ s/[\"']\(.*\)[\"']/\"\1\\\\n($kvers)\"/" > plot.gp
+    plot_cmds | sed -e "/set title/ s/[\"']\(.*\)[\"']/\"\1\\\\n(GW kernel $kvers, traffic $traffic)\"/" > plot.gp
     if [[ ! -s plot.gp ]]; then return; fi
     if [ -z "$OPT_NO_X11" ]; then
        echo "set terminal x11 enhanced; $(< plot.gp)" | gnuplot -persist
@@ -78,6 +78,12 @@ traffic_and_length() {
     echo $opts -l $1
 }
 
+start_load() {
+}
+
+kill_load() {
+}
+
 _measure() {
     # Remove data from the last measurement
     rm -rf *
@@ -103,8 +109,11 @@ _measure() {
     # Set the length of qdisc queue to avoid ENOBUFS errors
     ifconfig can0 txqueuelen 200
     cleanupgw
-    
+
+    prepare
+    start_load
     main
+    kill_load
 }
 
 
@@ -121,8 +130,8 @@ _run() {
        mkdir -p $dir
        script=$(echo $dir | sed -e 's/[^/]*/../g')/${test}.sh
        cd $dir
-       echo "Working directory: $dir"
        if [[ ! "$OPT_PLOT_ONLY" ]]; then
+           echo "Working directory: $dir"
            _measure
        fi
        if [[ ! "$OPT_PLOT_DISABLE" ]]; then