]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - gw-tests/vcans.sh
Fix a few bugs in scripts
[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     for i in $numjobs; do
9         cleanupgw
10         lastif=can0
11         for j in `seq $((i-1))`; do
12             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"
13             sshgw cangw -A -s $lastif -d vcan$j -e -f $(printf %x:C00007FF $((j-1))) -m SET:I:$(printf %x $j).0.0000000000000000
14             lastif=vcan$j
15         done
16         sshgw cangw -A -s $lastif -d can1 -f $(printf %x:C00007FF $((i-1)))
17
18         latester -d can0 -d can1 -d can2 -c $COUNT -i 0 $(traffic_and_length 2) -n hops$i
19     done
20 }
21
22 ADDITIONAL_PLOTS=detail
23
24 plot_cmds() {
25     if [[ "$1" = detail ]]; then
26         range=0.1:0.4
27         echo "set logscale y"
28         echo "set mxtics 5"
29     else
30         range=0.1:1000
31         echo "set logscale xy"
32     fi
33     cat <<EOF
34 set title "Chained GWs on multiple VCAN interfaces"
35 set grid xtics mxtics ytics mytics lw 1, lw 0.5
36 set xlabel "Time [ms]"
37 set ylabel "Latency profile [messages]"
38 plot [$range] [1:$COUNT] \\
39 EOF
40     lt=1
41     for i in $numjobs; do
42         echo_plot "\"hops$i-hist.txt\" with lp lt $lt title \"$i GW jobs, $((i-1)) vcans\""
43         lt=$((lt+1))
44     done
45 }
46
47
48 test_end