12 while [ $# -gt 0 ]; do
14 -P) OPT_PLOT_DISABLE=1; shift;;
15 -p) OPT_PLOT_ONLY=1; shift;;
16 -X|--no-x11-plot) OPT_NO_X11=1; shift;;
18 all|floof|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 ]]; 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($kvers)\"/" > plot.gp
47 if [ -z "$OPT_NO_X11" ]; then
48 echo "set terminal x11 enhanced; $(< plot.gp)" | gnuplot -persist
51 echo 'set terminal postscript color eps enhanced size 6cm,4cm lw 1 "Times-Roman" 10;' \
53 "$(< plot.gp)" | gnuplot > ${testname}$I.eps
54 echo "set terminal postscript color eps enhanced;" \
55 "$(< plot.gp)" | gnuplot | epstopdf --filter > ${testname}$I.pdf
57 convert -density 30 -gamma 0.5 -quality 90 -type Palette -depth 8 ${testname}$I.pdf thumb/${testname}$I.png
58 convert -density 150 -gamma 0.7 -quality 90 -type Palette -depth 8 ${testname}$I.pdf ${testname}$I.png
67 local d=results/$kver/$traffic/$test
74 [[ "$_plot_separator" ]] && echo ", \\"
79 traffic_and_length() {
83 50) opts="-p $((2*(44+$1*8)))";;
84 oneatatime) opts="-o";;
85 *) error "Unknown traffic specification"
91 if [[ ! "$OPT_PLOT_ONLY" ]]
92 then kernel_versions=$(sshgw uname -r)
93 else kernel_versions=$(ls results/by-kern)
95 if [[ $OPT_TRAFFIC = all ]]
96 then traffics="flood 50 oneatatime"
97 else traffics=$OPT_TRAFFIC
99 for OPT_TRAFFIC in $traffics; do
100 for kvers in $kernel_versions; do
101 dir=$(create_dirs $kvers $OPT_TRAFFIC $(basename $0 .sh))
104 echo "Working directory: $dir"
105 if [[ ! "$OPT_PLOT_ONLY" ]]; then
106 # Remove data from the last measurement
108 # Set can interfaces up
109 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'
110 # Delete all vcan interfaces
111 sshgw 'for dev in $(ip l|grep -o vcan[^:]\\+); do ip link del dev $dev; done'
113 sshgw 'chrt -p -f 50 `pidof irq/145-can0` > /dev/null || :'
114 sshgw 'chrt -p -f 50 `pidof irq/146-can1` > /dev/null || :'
115 sshgw 'chrt -p -f 49 `pidof sirq-net-rx/0` > /dev/null || :'
116 sshgw 'chrt -p -f 49 `pidof sirq-net-tx/0` > /dev/null || :'
122 if [[ ! "$OPT_PLOT_DISABLE" ]]; then
139 if [[ ! "$test_end_called" ]]; then
141 error "bug in the test script: No test_end called"
143 if ! test -n "$exit_ok"; then
144 error "FATAL: Command '$cmd' exit with code $code"