]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - gw-tests/filter.sh
Fix for previous commit.
[can-benchmark.git] / gw-tests / filter.sh
1 #!/bin/bash
2
3 . lib.sh
4
5 ids="0 $(seq 255 256 2047)"
6
7 prepare() {
8     sshgw 'for i in `seq 0 2047`; do cangw -A -s can0 -d can1 -f $(printf %x $i):7ff; done'
9 }
10
11 main() {
12     if [ "$kvers" = 3.0.4-rt14-00008-gb2052fd -a "$load" = eth -a $traffic != oneatatime ]; then echo "Skipping eth test"; SKIPPED=1; return; fi
13     if [ "$kvers" = 3.4.33-rt47-00004-gc58c9ae -a "$load" = eth -a $traffic != oneatatime ]; then echo "Skipping eth test"; SKIPPED=1; return; fi
14
15     for i in $ids; do
16         latester -d can0 -d can1 -d can2 -c $COUNT -i $i $(traffic_and_length 2) -n id-$i
17     done
18 }
19
20 ADDITIONAL_PLOTS=detail
21
22 plot_cmds() {
23     if [[ "$1" = detail ]]; then
24         range=0:0.8
25         echo "set logscale y"
26     else
27         range=0.01:100
28         echo "set logscale xy"
29     fi
30     cat <<EOF
31 set title "2048 GW rules (one per id, mask 0x7FF), no modifications"
32 set grid xtics mxtics ytics mytics lw 1, lw 0.5
33 set xlabel "GW latency [ms]"
34 set ylabel "Latency profile [frames]"
35 plot [$range] [1:$COUNT] \\
36 EOF
37     lt=1
38     for i in $ids; do
39         echo_plot "\"id-$i-hist.txt\" with lp lt $lt title \"Message id $i\""
40         lt=$((lt+1))
41     done
42 }
43     
44 test_end