12 while [ $# -gt 0 ]; do
14 -P|--no-plot) OPT_PLOT_DISABLE=1; shift;;
15 -p|--plot) OPT_PLOT_ONLY=1; shift;;
16 -X|--no-x11-plot) OPT_NO_X11=1; shift;;
18 all|flood|50|oneatatime) OPT_TRAFFIC=$2;;
19 *) error "Unknown traffic specification: $2";;
25 PATH=$PWD/../_compiled/bin/:$PATH
28 local socket="$HOME/.ssh/cangw-connection"
30 if [[ ! -S $socket ]] || ! ssh -x -a -S $socket root@192.168.2.3 true; then
31 # Create master connection to speed up subsequenct command.
32 # The ssh is put into background and the connection is closed
34 ssh -f -M -S $socket root@192.168.2.3 sleep 600 > /dev/null 2>&1
36 ssh -x -a -S $socket root@192.168.2.3 "$@"
44 local testname=`basename $0 .sh`
46 plot_cmds | sed -e "/set title/ s/[\"']\(.*\)[\"']/\"\1\\\\n(GW kernel $kvers, traffic $traffic)\"/" > plot.gp
47 if [[ ! -s plot.gp ]]; then return; fi
48 if [ -z "$OPT_NO_X11" ]; then
49 echo "set terminal x11 enhanced; $(< plot.gp)" | gnuplot -persist
52 echo 'set terminal postscript color eps enhanced size 6cm,4cm lw 1 "Times-Roman" 10;' \
54 "$(< plot.gp)" | gnuplot > ${testname}$I.eps
55 echo "set terminal postscript color eps enhanced;" \
56 "$(< plot.gp)" | gnuplot | epstopdf --filter > ${testname}$I.pdf
58 convert -density 30 -gamma 0.5 -quality 90 -type Palette -depth 8 ${testname}$I.pdf thumb/${testname}$I.png
59 convert -density 150 -gamma 0.7 -quality 90 -type Palette -depth 8 ${testname}$I.pdf ${testname}$I.png
65 [[ "$_plot_separator" ]] && echo ", \\"
70 traffic_and_length() {
74 50) opts="-p $((2*(44+$1*8)))";;
75 oneatatime) opts="-o";;
76 *) error "Unknown traffic specification"
88 # Remove data from the last measurement
94 export hostkvers=$hostkvers
95 export traffic=$traffic
96 cd \$(dirname \$0)/$(dirname $script)
97 exec ./$(basename $script) --plot "\$@"
100 # Set can interfaces up
101 sshgw 'for i in 0 1; do ip link show dev can$i|grep -q UP || ip link set can$i up type can bitrate 1000000; done'
102 # Delete all vcan interfaces
103 sshgw 'for dev in $(ip l|grep -o vcan[^:]\\+); do ip link del dev $dev; done'
105 sshgw 'if pid=`pidof irq/145-can0`; then chrt -p -f 50 $pid > /dev/null; fi'
106 sshgw 'if pid=`pidof irq/146-can1`; then chrt -p -f 50 $pid > /dev/null; fi'
107 sshgw 'if pid=`pidof sirq-net-rx/0`; then chrt -p -f 49 $pid > /dev/null; fi'
108 sshgw 'if pid=`pidof sirq-net-tx/0`; then chrt -p -f 49 $pid > /dev/null; fi'
109 # Set the length of qdisc queue to avoid ENOBUFS errors
110 ifconfig can0 txqueuelen 200
121 if [[ $OPT_TRAFFIC = all ]]
122 then traffics="flood 50 oneatatime"
123 else traffics=${traffic:-$OPT_TRAFFIC}
125 hostkvers=${hostkvers:-host-$(uname -r)}
126 kvers=${kvers:-$(sshgw uname -r)}
127 test=$(basename $0 .sh)
128 for traffic in $traffics; do
129 dir="results/$hostkvers/$kvers/$traffic/$test"
131 script=$(echo $dir | sed -e 's/[^/]*/../g')/${test}.sh
133 if [[ ! "$OPT_PLOT_ONLY" ]]; then
134 echo "Working directory: $dir"
137 if [[ ! "$OPT_PLOT_DISABLE" ]]; then
154 if [[ ! "$test_end_called" ]]; then
156 error "bug in the test script: No test_end called"
158 if ! test -n "$exit_ok"; then
159 error "FATAL: Command '$cmd' exit with code $code"