]> rtime.felk.cvut.cz Git - can-benchmark.git/commitdiff
Enhance test for filters
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 30 Nov 2010 17:02:24 +0000 (18:02 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 30 Nov 2010 17:02:24 +0000 (18:02 +0100)
gw-tests/gw-filter.sh
gw-tests/lib.sh

index e617e1deba51a1d0a25390ec8442b3dbdc73fb5b..b2be4e88f5b5baa4cd6d133c56631ceb45b1fc54 100755 (executable)
@@ -2,30 +2,31 @@
 
 . lib.sh
 
+ids=$(seq 0 512 4095)
+
 main() {
-    sshgw 'for i in `seq 0 127`; do cangw -A -s can0 -d can1 -f $i:fff; done'
-    for i in `seq 0 20 127`; do
+    sshgw 'for i in `seq 0 4095`; do cangw -A -s can0 -d can1 -f $(printf %x $i):fff; done'
+    for i in $ids; do
        latester -d can0 -d can1 -d can2 -o -c $COUNT -i $i -h hist-$i.dat -f time-$i.dat
     done
 }
 
 plot_cmds() {
     cat <<EOF
-set title "Single GW, no modifications, 127 filters (one per id)"
+set title "Single GW, no modifications, 4095 filters (one per id)"
 set logscale y
 set grid
 set xlabel "Time [{/Symbol m}s]"
 set ylabel "Latency profile [messages]"
-plot [0:] [1:$COUNT] \
-          "hist-0.dat" with lp lt 1 title "Message id 0", \
-          "hist-20.dat" with lp lt 2 title "Message id 20", \
-          "hist-40.dat" with lp lt 3 title "Message id 40", \
-          "hist-60.dat" with lp lt 4 title "Message id 60", \
-          "hist-80.dat" with lp lt 5 title "Message id 80", \
-          "hist-100.dat" with lp lt 6 title "Message id 100", \
-          "hist-120.dat" with lp lt 7 title "Message id 120"
+plot [0:2000] [1:$COUNT] \\
 EOF
+    lt=1
+    for i in $ids; do
+       (( i != 0)) && echo ", \\"
+       echo -n "    " \"hist-$i.dat\" with lp lt $lt title \"Message id $i\"
+        lt=$((lt+1))
+    done
+    echo
 }
     
 test_end
-    
index 63ee99d6bfa07ddeb2b7cb40be6f6ae97b8733fc..439ddc7ed6a50674a6049c882af63f419fb1a001 100644 (file)
@@ -38,17 +38,16 @@ cleanupgw() {
 _plot() {
     local testname=`basename $0 .sh`
 
-    cmd=$(plot_cmds)                   # Get plot commands
-    cmd=$(echo "$cmd" | sed -e "/set title/ s/[\"']\(.*\)[\"']/\"\1\\\\n($kvers)\"/")
+    plot_cmds | sed -e "/set title/ s/[\"']\(.*\)[\"']/\"\1\\\\n($kvers)\"/" > plot.gp
     if [ -z "$OPT_NO_X11" ]; then
-       echo "set terminal x11 enhanced; ${cmd}" | gnuplot -persist
+       echo "set terminal x11 enhanced; $(< plot.gp)" | gnuplot -persist
     fi
     I=''
     echo 'set terminal postscript color eps enhanced size 6cm,4cm lw 1 "Times-Roman" 10;' \
        'set lmargin 8;' \
-       "${cmd}" | gnuplot > ${testname}$I.eps
+       "$(< plot.gp)" | gnuplot > ${testname}$I.eps
     echo "set terminal postscript color eps enhanced;" \
-       "${cmd}" | gnuplot | epstopdf --filter > ${testname}$I.pdf
+       "$(< plot.gp)" | gnuplot | epstopdf --filter > ${testname}$I.pdf
     mkdir -p thumb
     convert -density 30  -gamma 0.5 -quality 90 -type Palette -depth 8 ${testname}$I.pdf thumb/${testname}$I.png
     convert -density 150 -gamma 0.7 -quality 90 -type Palette -depth 8 ${testname}$I.pdf ${testname}$I.png