]> rtime.felk.cvut.cz Git - can-benchmark.git/blob - gw-tests/user-time.sh
Add script to convert CANalyzer logs to gnuplot-friendly histograms
[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         ln -s ../user/*.txt .
9 }
10
11 #ADDITIONAL_PLOTS=detail
12
13 plot_cmds() {
14     if [[ "$1" = detail ]]; then
15         range=0.06:0.3
16     else
17         range=0.06:800
18         echo "set logscale y"
19     fi
20     if [ -s user2-msgs.txt ]; then
21         min=$(head -n 1 user2-msgs.txt | awk '{ print $2 }')
22     else
23         min=$(head -n 1 user8-msgs.txt | awk '{ print $2 }')
24     fi
25     cat <<EOF
26 set title "Single GW job for all messages, no modifications"
27 set grid xtics ytics mytics lw 1, lw 0.5
28 set xlabel "Time [s]"
29 set ylabel "Latency [ms]"
30 plot [:] [$range] \
31           "user2-msgs.txt" using (\$2-$min):(1000*\$14) with points title "Userspace GW, 2 byte messages", \
32           "user8-msgs.txt" using (\$2-$min):(1000*\$14) with points title "Userspace GW, 8 byte messages", \
33           "kern2-msgs.txt" using (\$2-$min):(1000*\$14) with points title "Kernel GW, 2 byte messages", \
34           "kern8-msgs.txt" using (\$2-$min):(1000*\$14) with points title "Kernel GW, 8 byte messages"
35 EOF
36 }
37     
38 test_end
39