]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - gw-tests/vcans.sh
Allow ranning experiments for all kernels
[can-benchmark.git] / gw-tests / vcans.sh
1 #!/bin/bash
2
3 . lib.sh
4
5 numjobs=" 1 `seq 2 2 10`"
6
7 main() {
8     if [ "$kvers" = 3.0.4-rt14-00008-gb2052fd -a "$load" = eth -a $traffic != oneatatime ]; then echo "Skipping eth test"; SKIPPED=1; return; fi
9     for i in $numjobs; do
10         cleanupgw
11         lastif=can0
12         for j in `seq $((i-1))`; do
13             sshgw "if ! ip l show dev vcan$j >/dev/null 2>&1; then ip link add dev vcan$j type vcan && ip link set vcan$j up; fi"
14             sshgw cangw -A -s $lastif -d vcan$j -e -f $(printf %x:C00007FF $((j-1))) -m SET:I:$(printf %x $j).0.0000000000000000
15             lastif=vcan$j
16         done
17         sshgw cangw -A -s $lastif -d can1 -f $(printf %x:C00007FF $((i-1)))
18
19         latester -d can0 -d can1 -d can2 -c $COUNT -i 0 $(traffic_and_length 2) -n hops$i
20     done
21 }
22
23 ADDITIONAL_PLOTS=detail
24
25 plot_cmds() {
26     if [[ "$1" = detail ]]; then
27         range=0.1:0.4
28         echo "set logscale y"
29         echo "set mxtics 5"
30     else
31         range=0.1:1000
32         echo "set logscale xy"
33     fi
34     cat <<EOF
35 set title "Chained GWs on multiple VCAN interfaces"
36 set grid xtics mxtics ytics mytics lw 1, lw 0.5
37 set xlabel "Time [ms]"
38 set ylabel "Latency profile [messages]"
39 plot [$range] [1:$COUNT] \\
40 EOF
41     lt=1
42     for i in $numjobs; do
43         echo_plot "\"hops$i-hist.txt\" with lp lt $lt title \"$i GW jobs, $((i-1)) vcans\""
44         lt=$((lt+1))
45     done
46 }
47
48
49 test_end