--- /dev/null
+T=$(filter-out _lib.sh,$(wildcard *.sh))
+
+.PHONY: $(T)
+
+all: $(T)
+
+$(T):%:
+ ./$@ --pdf-only
while [ $# -gt 0 ]; do
case "$1" in
-p) OPT_PLOT_ONLY=1; shift;;
+ --pdf-only) OPT_PDF_ONLY=1; shift;;
esac
done
}
run_tests() {
- [ "$OPT_PLOT_ONLY" -eq 1 ] && return
-
- tests=${TESTS:-lincan_hw socketcan_hw}
+ tests=${TESTS:-socketcan_hw lincan_hw}
for i in $tests; do
prepare_$i
t
plot() {
if [ -n "$PLOT_CMD" ]; then
echo "set terminal postscript color eps enhanced;
- set output '`basename $0 .sh`.eps'; $PLOT_CMD" | gnuplot
- echo "set terminal x11 enhanced; $PLOT_CMD" | gnuplot -persist
+ $PLOT_CMD" | gnuplot | epstopdf --filter > `basename $0 .sh`.pdf
+ if [ -z "$OPT_PDF_ONLY" ]; then
+ echo "set terminal x11 enhanced; $PLOT_CMD" | gnuplot -persist
+ fi
fi
}
-trap 'run_tests && plot' EXIT
+go() {
+ d=results/`basename $0 .sh`/`uname -r`
+ mkdir -p $d
+ cd $d
+
+ [ -n "$OPT_PLOT_ONLY" ] || run_tests
+ plot
+
+}
+
+trap 'go' EXIT
--- /dev/null
+#!/bin/sh
+
+. _lib.sh
+
+t() {
+ PID_S=`vca_canping -s 1 -b -r -d $CAN1`
+ cpufreq-set -f 300
+ vca_canping -m 1 -r -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000
+ cpufreq-set -f 2400
+ kill $PID_S
+}
+
+
+
+PLOT_CMD='
+set title "Round-trip time (`uname -r`, CPU\\@300 MHz)"
+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/sh
+
+. _lib.sh
+
+t() {
+ PID_S=`vca_canping -s 1 -b -r -d $CAN0`
+ cpufreq-set -f 300
+ vca_canping -m 1 -r -v -g $DRIVER -t 1 -d $CAN0 -w 5 -c 10000
+ cpufreq-set -f 2400
+ kill $PID_S
+}
+
+TESTS="lincan_virtual socketcan_virtual"
+
+PLOT_CMD='
+set title "Round-trip time - virtual CAN (`uname -r`, CPU\\@300 MHz)"
+set logscale y
+set grid
+set xlabel "Time [{/Symbol m}s]"
+set ylabel "Latency profile [messages]"
+plot [0:] "socketcan-virtual-1000.dat" with lp title "Socketcan",\
+ "lincan-virtual-1000.dat" with lp title "Lincan"
+'
+
#!/bin/sh
-. lib.sh
+. _lib.sh
t() {
PID_S=`vca_canping -s 1 -b -r -d $CAN0`
TESTS="lincan_virtual socketcan_virtual"
PLOT_CMD='
+set title "Round-trip time - virtual CAN (`uname -r`)"
set logscale y
set grid
-set title "Round-trip time measurement - virtual CAN (`uname -r`)"
set xlabel "Time [{/Symbol m}s]"
set ylabel "Latency profile [messages]"
plot [0:] "socketcan-virtual-1000.dat" with lp title "Socketcan",\
#!/bin/sh
-. lib.sh
+. _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 5 -c 1000
+ vca_canping -m 1 -r -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000
kill $PID_S
}
+
+
PLOT_CMD='
+set title "Round-trip time (`uname -r`)"
set logscale y
set grid
-set title "Round-trip time measurement (`uname -r`)"
set xlabel "Time [{/Symbol m}s]"
set ylabel "Latency profile [messages]"
plot [0:] "socketcan-1000.dat" with lp title "Socketcan",\