]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - gw-tests/user-time.sh
Add reference from /usr/src/linux
[can-benchmark.git] / gw-tests / user-time.sh
1 #!/bin/bash
2
3 . lib.sh
4
5 NO_GW_NEEDED=true
6
7 main() {
8     #Check that the test wasn't skipped.
9     if [ "$(ls -A ../user)" ]; then
10         #Otherwise this would create *.txt file and plot.sh and break the automation
11         ln -s ../user/*.txt .
12     else
13         SKIPPED=1; return;
14     fi;
15 }
16
17 #ADDITIONAL_PLOTS=detail
18
19 plot_cmds() {
20     if [[ "$1" = detail ]]; then
21         range=0.0:0.3
22     else
23         range=0.01:800
24         echo "set logscale y"
25     fi
26     if [ -s user2-msgs.txt ]; then
27         min=$(head -n 1 user2-msgs.txt | awk '{ print $2 }')
28     else
29         min=$(head -n 1 user8-msgs.txt | awk '{ print $2 }')
30     fi
31     cat <<EOF
32 set title "Single GW rule for all messages, no modifications"
33 set grid xtics ytics mytics lw 1, lw 0.5
34 set xlabel "Experiment time [s]"
35 set ylabel "GW latency [ms]"
36 plot [:] [$range] \\
37           "user2-msgs.txt" using (\$2-$min):(1000*\$14-0.001*\$16) with points title "Userspace GW, 2 byte messages", \\
38           "user8-msgs.txt" using (\$2-$min):(1000*\$14-0.001*\$16) with points title "Userspace GW, 8 byte messages", \\
39           "kern2-msgs.txt" using (\$2-$min):(1000*\$14-0.001*\$16) with points title "Kernel GW, 2 byte messages", \\
40           "kern8-msgs.txt" using (\$2-$min):(1000*\$14-0.001*\$16) with points title "Kernel GW, 8 byte messages"
41 EOF
42 }
43     
44 test_end
45