]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - gw-tests/user.sh
Add when the graps were generated
[can-benchmark.git] / gw-tests / user.sh
1 #!/bin/bash
2
3 . lib.sh
4
5 main() {
6     if [ "$kvers" = 3.0.4-rt14-00008-gb2052fd -a "$load" = eth -a $traffic != oneatatime ]; then echo "Skipping eth test"; SKIPPED=1; return; fi
7     if [ "$kvers" = 3.4.33-rt47-00004-gc58c9ae -a "$load" = eth -a $traffic != oneattime ]; then echo "Skipping eth test"; SKIPPED=1; return; fi;
8     pid=$(sshgw 'chrt -f 90 candump -s2 -b can1 can0 & echo $!')
9     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -n user2
10     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -n user8
11     sshgw kill $pid
12     sshgw cangw -A -s can0 -d can1
13     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -n kern2
14     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -n kern8
15 }
16
17 ADDITIONAL_PLOTS=detail
18
19 plot_cmds() {
20     if [[ "$1" = detail ]]; then
21         [[ $traffic = eth ]] && return
22         range=0.0:0.5
23         echo "set logscale y"
24         echo "set mxtics 5"
25     else
26         range=0.01:1000
27         echo "set logscale xy"
28     fi
29     cat <<EOF
30 set termoption dashed
31 set style line 1 lt 1 lc 1 pt 1
32 set style line 2 lt 2 lc 1 pt 1
33 set style line 3 lt 1 lc 2 pt 2
34 set style line 4 lt 2 lc 2 pt 2
35 set title "Kernel vs. userspace GW, no modifications"
36 set grid xtics mxtics ytics mytics lw 1, lw 0.5
37 set xlabel "GW latency [ms]"
38 set ylabel "Latency profile [frames]"
39 plot [$range] [1:$COUNT] \\
40           "user2-hist.txt" with lp ls 1 title "Userspace GW, 2 byte messages", \\
41           "user8-hist.txt" with lp ls 2 title "Userspace GW, 8 byte messages", \\
42           "kern2-hist.txt" with lp ls 3 title "Kernel GW, 2 byte messages", \\
43           "kern8-hist.txt" with lp ls 4 title "Kernel GW, 8 byte messages"
44 EOF
45 }
46     
47 test_end
48