]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - ugw/data/bench-all.sh
fixup
[can-benchmark.git] / ugw / data / bench-all.sh
1 #!/bin/bash
2
3 set -e
4
5 args=
6 dir=burst
7 d0=$(dirname $0)
8
9 cd $d0
10
11 while [ "${1#-}" != "$1" ]; do
12     case "$1" in
13         -o)
14             args=--oneattime
15             dirs=oneatatime
16             ;;
17         -ftrace)
18             args=--oneattime
19             dirs=oneatatime.ftrace
20             ;;
21         -p)
22             dirs=($(seq 125 170))
23             declare -a args
24             for i in ${!dirs[*]}; do
25                 args[$i]=-p${dirs[$i]}
26             done
27             ;;
28         -p*)
29             args=$1
30             dir=${1#-p}
31             ;;
32     esac
33     shift
34 done
35
36 methods=${@:-rtems kernel read-write readnb-write mmap-write mmap-mmap mmapbusy-write mmapbusy-mmap readbusy-write}
37
38 set -x
39 for method in $methods; do
40     case $method in
41         rtems) ../../rtems/gw/boot --expect-raw '"]", sub { shift->send_slow(0.1, "startGW\n"); }' --exiton 'tasks started';;
42         kernel)         ../ppc/boot -a kernelgw --exiton "Kernel GW started";;
43         read-write)     ../ppc/boot             --exiton "UGW started";;
44         readnb-write)   ../ppc/boot -a "ugw=|-n|" --exiton "UGW started";;
45         mmap-write)     ../ppc/boot -a "ugw=|-r mmap|" --exiton "UGW started";;
46         mmap-mmap)      ../ppc/boot -a "ugw=|-r mmap -t mmap|" --exiton "UGW started";;
47         mmapbusy-write) ../ppc/boot -a "ugw=|-r mmapbusy|" --exiton "UGW started";;
48         mmapbusy-mmap)  ../ppc/boot -a "ugw=|-r mmapbusy -t mmap|" --exiton "UGW started";;
49         readbusy-write) ../ppc/boot -a "ugw=|-b 300|" --exiton "UGW started";;
50         readbusy-noirq) ../ppc/boot -a "ugw=|-b 300|" --kernel uImage.noirq --exiton "UGW started";;
51         *)
52             echo >&2 "Unknown method '$method'";
53             exit 1;
54     esac
55     set +x
56     for i in ${!dirs[*]}; do
57         arg=${args[$i]}
58         dir=${dirs[$i]}
59         set -x
60         ssh glab "latester -d can0 -d can1 -d can2 -c 10000 -q -n $method $arg"
61         mkdir -p $dir
62         scp glab:"$method-*.txt" $dir
63         (cd $dir && ln -sf ../Makefile ../plot.gp ../preprocess.m .)
64         set -x
65     done
66     sleep 2 # Wait for cu at glab to die
67 done
68
69 if [ ${#dirs[*]} -gt 1 ]; then
70     for d in ${dirs[@]}; do
71         make -C $d
72     done
73 fi