]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - ugw/data/bench-all.sh
We need more data
[can-benchmark.git] / ugw / data / bench-all.sh
1 #!/bin/bash
2
3 set -e
4
5 args=
6 dirs=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 120 160))
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 readnb-mmap read-mmap mmap-write mmap-mmap mmapbusy-write mmapbusy-mmap readbusy-write readbusynoirq-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         readnb-mmap)    ../ppc/boot -a "ugw=|-n -t mmap|" --exiton "UGW started";;
46         read-mmap)      ../ppc/boot -a "ugw=|-t mmap|" --exiton "UGW started";;
47         mmap-write)     ../ppc/boot -a "ugw=|-r mmap|" --exiton "UGW started";;
48         mmap-mmap)      ../ppc/boot -a "ugw=|-r mmap -t mmap|" --exiton "UGW started";;
49         mmapbusy-write) ../ppc/boot -a "ugw=|-r mmapbusy|" --exiton "UGW started";;
50         mmapbusy-mmap)  ../ppc/boot -a "ugw=|-r mmapbusy -t mmap|" --exiton "UGW started";;
51         readbusy-write) ../ppc/boot -a "ugw=|-b 300|" --exiton "UGW started";;
52         readbusynoirq-write) ../ppc/boot -a "ugw=|-b 300|" --kernel uImage.noirq --exiton "UGW started";;
53         *)
54             echo >&2 "Unknown method '$method'";
55             exit 1;
56     esac
57     set +x
58     for i in ${!dirs[*]}; do
59         arg=${args[$i]}
60         dir=${dirs[$i]}
61         set -x
62         ssh glab "sudo ip l set eth0 down; sudo ~/bin/latester -d can0 -d can1 -d can2 -c 5000 -q -n $method $arg; r=\$?; sudo ip l set eth0 up; exit \$r"
63         mkdir -p $dir
64         scp glab:"$method-*.txt" $dir
65         (cd $dir && ln -sf ../Makefile ../plot.gp ../preprocess.m .)
66         set -x
67     done
68     sleep 2 # Wait for cu at glab to die
69 done
70
71 if [ ${#dirs[*]} -gt 1 ]; then
72     for d in ${dirs[@]}; do
73         make -C $d
74     done
75 fi