]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - gw-tests/user.sh
Merge branch 'master' of rtime.felk.cvut.cz:/can-benchmark
[can-benchmark.git] / gw-tests / user.sh
1 #!/bin/bash
2
3 . lib.sh
4
5 main() {
6     pid=$(sshgw 'chrt -f 90 candump -s2 -b can1 can0 & echo $!')
7     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -n user2
8     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -n user8
9     sshgw kill $pid
10     sshgw cangw -A -s can0 -d can1
11     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 2) -n kern2
12     latester -d can0 -d can1 -d can2 -c $COUNT $(traffic_and_length 8) -n kern8
13 }
14
15 ADDITIONAL_PLOTS=detail
16
17 plot_cmds() {
18     if [[ "$1" = detail ]]; then
19         [[ $traffic = eth ]] && return
20         range=0.05:0.5
21         echo "set logscale y"
22         echo "set mxtics 5"
23     else
24         range=0.05:1000
25         echo "set logscale xy"
26     fi
27     cat <<EOF
28 set title "Kernel vs. userspace GW, no modifications"
29 set grid xtics mxtics ytics mytics lw 1, lw 0.5
30 set xlabel "Time [ms]"
31 set ylabel "Latency profile [messages]"
32 plot [$range] [1:$COUNT] \
33           "user2-hist.txt" with lp lt 1 title "Userspace GW, 2 byte messages", \
34           "user8-hist.txt" with lp lt 2 title "Userspace GW, 8 byte messages", \
35           "kern2-hist.txt" with lp lt 1 title "Kernel GW, 2 byte messages", \
36           "kern8-hist.txt" with lp lt 2 title "Kernel GW, 8 byte messages"
37 EOF
38 }
39     
40 test_end
41