]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - gw-tests/user.sh
c5cea0a98013db3b5b1afb9acdd51e80e1f6e367
[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     pid=$(sshgw 'chrt -f 90 candump -s2 -b can1 can0 & echo $!')
8     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -n user2
9     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -n user8
10     sshgw kill $pid
11     sshgw cangw -A -s can0 -d can1
12     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -n kern2
13     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -n kern8
14 }
15
16 ADDITIONAL_PLOTS=detail
17
18 plot_cmds() {
19     if [[ "$1" = detail ]]; then
20         [[ $traffic = eth ]] && return
21         range=0.0:0.5
22         echo "set logscale y"
23         echo "set mxtics 5"
24     else
25         range=0.01:1000
26         echo "set logscale xy"
27     fi
28     cat <<EOF
29 set termoption dashed
30 set style line 1 lt 1 lc 1 pt 1
31 set style line 2 lt 2 lc 1 pt 1
32 set style line 3 lt 1 lc 2 pt 2
33 set style line 4 lt 2 lc 2 pt 2
34 set title "Kernel vs. userspace GW, no modifications"
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           "user2-hist.txt" with lp ls 1 title "Userspace GW, 2 byte messages", \\
40           "user8-hist.txt" with lp ls 2 title "Userspace GW, 8 byte messages", \\
41           "kern2-hist.txt" with lp ls 3 title "Kernel GW, 2 byte messages", \\
42           "kern8-hist.txt" with lp ls 4 title "Kernel GW, 8 byte messages"
43 EOF
44 }
45     
46 test_end
47