]> rtime.felk.cvut.cz Git - can-benchmark.git/commitdiff
Add test to compare kernel vs. userspace gw
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 1 Dec 2010 13:39:27 +0000 (14:39 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 1 Dec 2010 13:39:27 +0000 (14:39 +0100)
gw-tests/user.sh [new file with mode: 0755]

diff --git a/gw-tests/user.sh b/gw-tests/user.sh
new file mode 100755 (executable)
index 0000000..1edfa74
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+. lib.sh
+
+main() {
+    pid=$(sshgw 'chrt -f 90 candump -s2 -b can1 can0 & echo $!')
+    latester -d can0 -d can1 -d can2 -o -c $COUNT -l 2 -h uhist2.dat -f utime2.dat
+    latester -d can0 -d can1 -d can2 -o -c $COUNT -l 8 -h uhist8.dat -f utime8.dat
+    sshgw kill $pid
+    sshgw cangw -A -s can0 -d can1
+    latester -d can0 -d can1 -d can2 -o -c $COUNT -l 2 -h khist2.dat -f ktime2.dat
+    latester -d can0 -d can1 -d can2 -o -c $COUNT -l 8 -h khist8.dat -f ktime8.dat
+}
+
+plot_cmds() {
+    cat <<EOF
+set title "Kernel vs. userspace GW, no modifications, no filters"
+set logscale y
+set grid
+set xlabel "Time [{/Symbol m}s]"
+set ylabel "Latency profile [messages]"
+plot [0:] [1:$COUNT] \
+          "khist2.dat" with lp lt 1 title "Kernel GW, 2 byte messages", \
+          "khist8.dat" with lp lt 2 title "Kernel GW, 8 byte messages", \
+          "uhist2.dat" with lp lt 1 title "Userspace GW, 2 byte messages", \
+          "uhist8.dat" with lp lt 2 title "Userspace GW, 8 byte messages"
+EOF
+}
+    
+test_end
+