]> rtime.felk.cvut.cz Git - can-benchmark.git/commitdiff
Added tests with ethernet load
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 15 Jun 2009 16:30:18 +0000 (18:30 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 15 Jun 2009 16:30:18 +0000 (18:30 +0200)
12 files changed:
canping
tests/_lib.sh
tests/ethflood.sh [new file with mode: 0755]
tests/ethflood64k.sh [new file with mode: 0755]
tests/ethload.sh [new file with mode: 0755]
tests/ethload300MHz.sh [new file with mode: 0755]
tests/ethloadsend.sh [new file with mode: 0755]
tests/rtt-300MHz.sh
tests/rtt-overload.sh
tests/rtt-virtual-300MHz.sh
tests/rtt-virtual.sh
tests/rtt.sh

diff --git a/canping b/canping
index f09a8c7c0507c66ca87474479ed6f1185aa76bde..6991851c166330d9dd36cc88cbb1ef839f5c0c7c 160000 (submodule)
--- a/canping
+++ b/canping
@@ -1 +1 @@
-Subproject commit f09a8c7c0507c66ca87474479ed6f1185aa76bde
+Subproject commit 6991851c166330d9dd36cc88cbb1ef839f5c0c7c
index 47facb0603d5755fbb8e4cb0ec073e1fff531169..183f1891b374963e42a7ee4225492c91abd31c19 100644 (file)
@@ -11,10 +11,18 @@ set -e
 
 PATH=$PWD/../_compiled/bin/:$PATH
 
 
 PATH=$PWD/../_compiled/bin/:$PATH
 
+RTPRIO=60
+
+boost_irq_prio() {
+    local P=${1:-50}
+    CAN_IRQ=`sed -ne '/can/ s/:.*//p' /proc/interrupts`
+    if [ -n "$CAN_IRQ" ]; then
+       schedtool -F -p $P `pidof IRQ-${CAN_IRQ/ /}`
+    fi
+}
+
 rmmod_can() {
 rmmod_can() {
-    modprobe -r lincan
-    modprobe -r kvaser_pci
-    modprobe -r vcan
+    modprobe -r lincan kvaser_pci vcan
 }
 
 prepare_lincan_hw() {
 }
 
 prepare_lincan_hw() {
@@ -63,6 +71,7 @@ run_tests() {
     tests=${TESTS:-socketcan_hw lincan_hw}
     for i in $tests; do
        cpufreq-set -f 2400MHz
     tests=${TESTS:-socketcan_hw lincan_hw}
     for i in $tests; do
        cpufreq-set -f 2400MHz
+       boost_irq_prio 50
        prepare_$i
        t
     done
        prepare_$i
        t
     done
diff --git a/tests/ethflood.sh b/tests/ethflood.sh
new file mode 100755 (executable)
index 0000000..e2c1edd
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+. _lib.sh
+
+t() {
+    ssh root@${SSH_CONNECTION%% *} 'ping -qf "${SSH_CONNECTION%% *}"' &
+    PID_PING=$!
+    boost_irq_prio
+    PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1`
+    vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000
+    kill $PID_S
+    kill $PID_PING
+}
+
+
+
+PLOT_CMD='
+set title "Round-trip time with ethenet load - ping -f (`uname -r`)"
+set logscale y
+set grid
+set xlabel "Time [{/Symbol m}s]"
+set ylabel "Latency profile [messages]"
+plot [0:] "socketcan-1000.dat" with lp title "Socketcan",\
+          "lincan-1000.dat" with lp title "Lincan"
+'
+
diff --git a/tests/ethflood64k.sh b/tests/ethflood64k.sh
new file mode 100755 (executable)
index 0000000..9702093
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+. _lib.sh
+
+t() {
+    ssh root@${SSH_CONNECTION%% *} 'ping -qfs 64000 "${SSH_CONNECTION%% *}"' &
+    PID_PING=$!
+    PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1`
+    vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000
+    kill $PID_S
+    kill $PID_PING
+}
+
+
+
+PLOT_CMD='
+set title "Round-trip time with ethenet load - ping -fs 64000 (`uname -r`)"
+set logscale y
+set grid
+set xlabel "Time [{/Symbol m}s]"
+set ylabel "Latency profile [messages]"
+plot [0:] "socketcan-1000.dat" with lp title "Socketcan",\
+          "lincan-1000.dat" with lp title "Lincan"
+'
+
diff --git a/tests/ethload.sh b/tests/ethload.sh
new file mode 100755 (executable)
index 0000000..a5e57f6
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+. _lib.sh
+
+t() {
+    for i in norm boost; do
+       ssh root@${SSH_CONNECTION%% *} 'find -L /usr/src/linux -type f -exec cat "{}" ";"' > /dev/null &
+       PID_LOAD=$!
+       [ $i == "boost" ] && boost_irq_prio 90
+       PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1`
+       vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER-$i -t 1 -d $CAN0 -w 2 -c 10000
+       kill $PID_S
+       kill $PID_LOAD
+    done
+}
+
+
+
+PLOT_CMD='
+set title "Round-trip time with receive ethenet load (`uname -r`)"
+set logscale y
+set grid
+set xlabel "Time [{/Symbol m}s]"
+set ylabel "Latency profile [messages]"
+plot [0:] "socketcan-norm-1000.dat" with lp title "Socketcan",\
+          "lincan-norm-1000.dat" with lp title "Lincan",\
+          "socketcan-boost-1000.dat" with lp title "Socketcan boosted IRQ prio",\
+          "lincan-boost-1000.dat" with lp title "Lincan boosted IRQ prio"
+'
+
diff --git a/tests/ethload300MHz.sh b/tests/ethload300MHz.sh
new file mode 100755 (executable)
index 0000000..8ce6775
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+. _lib.sh
+
+t() {
+    for i in norm boost; do
+       ssh root@${SSH_CONNECTION%% *} 'find -L /usr/src/linux -type f -exec cat "{}" ";"' > /dev/null &
+       PID_LOAD=$!
+       [ $i == "boost" ] && boost_irq_prio 90
+       cpufreq-set -f 300MHz
+       PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1`
+       vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER-$i -t 1 -d $CAN0 -w 2 -c 10000
+       cpufreq-set -f 2400MHz
+       kill $PID_S
+       kill $PID_LOAD
+    done
+}
+
+
+
+PLOT_CMD='
+set title "Round-trip time with receive ethenet load (`uname -r`, CPU\\@300 MHz)"
+set logscale y
+set grid
+set xlabel "Time [{/Symbol m}s]"
+set ylabel "Latency profile [messages]"
+plot [0:] "socketcan-norm-1000.dat" with lp title "Socketcan",\
+          "lincan-norm-1000.dat" with lp title "Lincan",\
+          "socketcan-boost-1000.dat" with lp title "Socketcan boosted IRQ prio",\
+          "lincan-boost-1000.dat" with lp title "Lincan boosted IRQ prio"
+'
+
diff --git a/tests/ethloadsend.sh b/tests/ethloadsend.sh
new file mode 100755 (executable)
index 0000000..a720202
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+. _lib.sh
+
+t() {
+    ( find -L /usr/src/linux -type f -exec cat '{}' ';'|ssh root@${SSH_CONNECTION%% *} 'cat > /dev/null' ) &
+    PID_LOAD=$!
+    PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1`
+    vca_canping -m 1 -R FF:$RTPRIO FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000
+    kill $PID_S
+    kill $PID_LOAD
+}
+
+
+
+PLOT_CMD='
+set title "Round-trip time with receive ethenet load (`uname -r`)"
+set logscale y
+set grid
+set xlabel "Time [{/Symbol m}s]"
+set ylabel "Latency profile [messages]"
+plot [0:] "socketcan-1000.dat" with lp title "Socketcan",\
+          "lincan-1000.dat" with lp title "Lincan"
+'
+
index c6a65c665db54900978c56f8fee85b31e5f45d1d..aaac12a1b7c82530574ff20d4906f46b9bf33a11 100755 (executable)
@@ -3,9 +3,9 @@
 . _lib.sh
 
 t() {
 . _lib.sh
 
 t() {
-    PID_S=`vca_canping -s 1 -b -r -d $CAN1`
+    PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1`
     cpufreq-set -f 300MHz
     cpufreq-set -f 300MHz
-    vca_canping -m 1 -r -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000
+    vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000
     cpufreq-set -f 2400Mhz
     kill $PID_S
 }
     cpufreq-set -f 2400Mhz
     kill $PID_S
 }
index 7aad5040babe2bdf34dce473c9f26c50dfe9579d..52b1a97599f8a049fb29d70f57f0e3b7d6952f3b 100755 (executable)
@@ -5,11 +5,13 @@
 C=100
 
 t() {
 C=100
 
 t() {
-    PID_S=`vca_canping -s $C -b -r -d $CAN1`
-    vca_canping -m $C -r -v -g $DRIVER -t 1 -d $CAN0 -w 500 -c 10
+    PID_S=`vca_canping -s $C -b -R FF:$RTPRIO -d $CAN0`
+    vca_canping -m $C -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 500 -c 10
     kill $PID_S
 }
 
     kill $PID_S
 }
 
+TESTS="lincan_virtual socketcan_virtual"
+
 
 
 PLOT_CMD="
 
 
 PLOT_CMD="
index b001d6bd2fd48f55a3765fc0727524cadb4afbd9..951af92f6d8bf43f1c1e7a7528af0e669473bac7 100755 (executable)
@@ -3,9 +3,9 @@
 . _lib.sh
 
 t() {
 . _lib.sh
 
 t() {
-    PID_S=`vca_canping -s 1 -b -r -d $CAN0`
+    PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN0`
     cpufreq-set -f 300MHz
     cpufreq-set -f 300MHz
-    vca_canping -m 1 -r -v -g $DRIVER -t 1 -d $CAN0 -w 5 -c 10000
+    vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 5 -c 10000
     cpufreq-set -f 2400MHz
     kill $PID_S
 }
     cpufreq-set -f 2400MHz
     kill $PID_S
 }
index fb42e3ca89deb0227a31080684f20f65e539205a..a057e2867cb2fec90d835da52de958c2e9fb8c6b 100755 (executable)
@@ -3,8 +3,8 @@
 . _lib.sh
 
 t() {
 . _lib.sh
 
 t() {
-    PID_S=`vca_canping -s 1 -b -r -d $CAN0`
-    vca_canping -m 1 -r -v -g $DRIVER -t 1 -d $CAN0 -w 1 -c 10000
+    PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN0`
+    vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 1 -c 10000
     kill $PID_S
 }
 
     kill $PID_S
 }
 
index 73978696465e3e6c54628078ab2550335a7e8c57..0b781188fbfa02705f1b8530868a5b6b05738ad1 100755 (executable)
@@ -3,8 +3,8 @@
 . _lib.sh
 
 t() {
 . _lib.sh
 
 t() {
-    PID_S=`vca_canping -s 1 -b -r -d $CAN1`
-    vca_canping -m 1 -r -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000
+    PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1`
+    vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000
     kill $PID_S
 }
 
     kill $PID_S
 }