]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - gw-tests/vcans.sh
Add links to script sources
[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) -h hist-$i.dat -f time-$i.dat
19     done
20 }
21
22 plot_cmds() {
23     cat <<EOF
24 set title "Chained GW jobs on multiple VCAN interfaces"
25 set logscale y
26 set grid
27 set xlabel "Time [{/Symbol m}s]"
28 set ylabel "Latency profile [messages]"
29 plot [0:1000] [1:$COUNT] \\
30 EOF
31     lt=1
32     for i in $numjobs; do
33         echo_plot "\"hist-$i.dat\" with lp lt $lt title \"$i GW jobs, $((i-1)) vcans\""
34         lt=$((lt+1))
35     done
36 }
37
38
39 test_end