-Subproject commit f09a8c7c0507c66ca87474479ed6f1185aa76bde
+Subproject commit 6991851c166330d9dd36cc88cbb1ef839f5c0c7c
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() {
- modprobe -r lincan
- modprobe -r kvaser_pci
- modprobe -r vcan
+ modprobe -r lincan kvaser_pci vcan
}
prepare_lincan_hw() {
tests=${TESTS:-socketcan_hw lincan_hw}
for i in $tests; do
cpufreq-set -f 2400MHz
+ boost_irq_prio 50
prepare_$i
t
done
--- /dev/null
+#!/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"
+'
+
--- /dev/null
+#!/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"
+'
+
--- /dev/null
+#!/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"
+'
+
--- /dev/null
+#!/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"
+'
+
--- /dev/null
+#!/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"
+'
+
. _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
- 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
}
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
}
+TESTS="lincan_virtual socketcan_virtual"
+
PLOT_CMD="
. _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
- 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
}
. _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
}
. _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
}