From: Michal Sojka Date: Thu, 27 Aug 2009 13:13:27 +0000 (+0200) Subject: HTML report + many modifications X-Git-Tag: fix-allnoconfig~376 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/commitdiff_plain/d48a4f69b198ff8b3bd026ec63a5ec0905c97c08 HTML report + many modifications --- diff --git a/prepare b/prepare index d0aebd4..3d241c9 100755 --- a/prepare +++ b/prepare @@ -3,7 +3,7 @@ set -e cd `dirname $0` -cvs -d :pserver:anonymous@ocera.cvs.sourceforge.net:/cvsroot/ocera checkout -D 2009-06-11 -d ocera-can ocera/components/comm/can +cvs -d :pserver:anonymous@ocera.cvs.sourceforge.net:/cvsroot/ocera checkout -D 2009-08-26 -d ocera-can ocera/components/comm/can svn checkout -r 1009 svn://svn.berlios.de/socketcan/trunk socketcan diff --git a/tests/Makefile b/tests/Makefile index 7094dba..b333eb0 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -2,7 +2,11 @@ T=$(filter-out _lib.sh,$(wildcard *.sh)) .PHONY: $(T) -all: $(T) +all: $(T) html $(T):%: - ./$@ --pdf-only + ./$@ -X + +.PHONY: html +html: + ./genhtml.py results diff --git a/tests/_lib.sh b/tests/_lib.sh index 281ddf9..1661814 100644 --- a/tests/_lib.sh +++ b/tests/_lib.sh @@ -2,7 +2,7 @@ while [ $# -gt 0 ]; do case "$1" in -p) OPT_PLOT_ONLY=1; shift;; - --pdf-only) OPT_PDF_ONLY=1; shift;; + -X|--no-x11-plot) OPT_NO_X11=1; shift;; esac done @@ -12,14 +12,19 @@ set -e PATH=$PWD/../_compiled/bin/:$PATH RTPRIO=60 +COUNT=10000 boost_irq_prio() { local PRIO=${1:-50} CAN_IRQ=`sed -ne '/can/ s/:.*//p' /proc/interrupts` if [ -n "$CAN_IRQ" ]; then IRQ_PID=`pidof IRQ-${CAN_IRQ/ /}` || true - [ -z "$IRQ_PID" ] || schedtool -F -p $PRIO $IRQ_PID + if [ -n "$IRQ_PID" ]; then + schedtool -F -p $PRIO $IRQ_PID + return 0 + fi fi + return 1 } rmmod_can() { @@ -70,33 +75,65 @@ prepare_socketcan_virtual() { run_tests() { tests=${TESTS:-socketcan_hw lincan_hw} - for i in $tests; do - cpufreq-set -f 2400MHz - boost_irq_prio 50 - prepare_$i + for tst in $tests; do + boost_irq_prio 50 || true + prepare_$tst t done } plot() { for i in "${!PLOT_CMD[@]}"; do - if [ -z "$OPT_PDF_ONLY" ]; then - echo "set terminal x11 enhanced; ${PLOT_CMD[$i]}" | gnuplot -persist + cmd="${PLOT_CMD[$i]}"; + cmd=$(echo "$cmd" | sed -e "/set title/ s/[\"']\(.*\)[\"']/'\1 ($(uname -r), CPU\\\\@${clk}Mhz)'/") + if [ -z "$OPT_NO_X11" ]; then + echo "set terminal x11 enhanced; ${cmd}" | gnuplot -persist fi I=${i/0/} echo "set terminal postscript color eps enhanced; - ${PLOT_CMD[$i]}" | gnuplot | epstopdf --filter > `basename $0 .sh`$I.pdf + ${cmd}" | gnuplot | epstopdf --filter > `basename $0 .sh`$I.pdf + mkdir -p thumb + convert -geometry 1000x100 -gamma 0.3 `basename $0 .sh`$I.pdf thumb/`basename $0 .sh`$I.png + convert -density 200 -gamma 0.7 -geometry 1000x500 `basename $0 .sh`$I.pdf `basename $0 .sh`$I.png done } -go() { - d=results/`basename $0 .sh`/`uname -r` - set -x +create_dirs_and_links() { + local test=$1 + local kver=$2 + local clck=$3 + + local d=results/by-test/$test/$kver/$clck mkdir -p $d - cd $d - - [ -n "$OPT_PLOT_ONLY" ] || run_tests - plot + mkdir -p results/by-test/$test/$clck # 1 + mkdir -p results/by-kern/$kver/$clck # 2 + mkdir -p results/by-kern/$kver/$test # 3 + mkdir -p results/by-clck/$clck/$kver # 4 + mkdir -p results/by-clck/$clck/$test # 5 + ln -sfT ../../../${d#results/} results/by-test/$test/$clck/$kver # 1 + ln -sfT ../../../${d#results/} results/by-kern/$kver/$clck/$test # 2 + ln -sfT ../../../${d#results/} results/by-kern/$kver/$test/$clck # 3 + ln -sfT ../../../${d#results/} results/by-clck/$clck/$kver/$test # 4 + ln -sfT ../../../${d#results/} results/by-clck/$clck/$test/$kver # 5 + echo $d +} + +go() { + mhz=${MHZ:-2400 300} + for clk in $mhz; do + dir=$(create_dirs_and_links `basename $0 .sh` `uname -r` $clk) + set -x + pushd $dir + + if [ ! -n "$OPT_PLOT_ONLY" ]; then + cpufreq-set -f ${clk}MHz + run_tests + cpufreq-set -f 2400MHz + fi + plot + popd + set +x + done } diff --git a/tests/ethflood.sh b/tests/ethflood.sh index c25d447..54911eb 100755 --- a/tests/ethflood.sh +++ b/tests/ethflood.sh @@ -3,24 +3,30 @@ . _lib.sh t() { - ssh root@${SSH_CONNECTION%% *} 'ping -f "${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 + for i in norm boost; do + ssh root@${SSH_CONNECTION%% *} 'ping -f "${SSH_CONNECTION%% *}"' & + PID_PING=$! + echo 0 1 > $DRIVER-$i-1000.dat + if [ $i != "boost" ] || boost_irq_prio 90; then + 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 $COUNT + kill $PID_S + fi + kill $PID_PING + done } PLOT_CMD=' -set title "Round-trip time with ethenet load - ping -f (`uname -r`)" +set title "Round-trip time with ethernet load - ping -f" 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" +plot [0:] "socketcan-norm-1000.dat" with lp lt 1 title "Socketcan",\ + "lincan-norm-1000.dat" with lp lt 2 title "Lincan",\ + "socketcan-boost-1000.dat" with lp lt 1 title "Socketcan boosted IRQ prio",\ + "lincan-boost-1000.dat" with lp lt 2 title "Lincan boosted IRQ prio" ' diff --git a/tests/ethflood64k.sh b/tests/ethflood64k.sh index aa32581..f83ccaa 100755 --- a/tests/ethflood64k.sh +++ b/tests/ethflood64k.sh @@ -3,23 +3,30 @@ . _lib.sh t() { - ssh root@${SSH_CONNECTION%% *} 'ping -fs 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 + for i in norm boost; do + ssh root@${SSH_CONNECTION%% *} 'ping -fs 64000 ${SSH_CONNECTION%% *}' & + PID_PING=$! + echo 0 1 > $DRIVER-$i-1000.dat + if [ $i != "boost" ] || boost_irq_prio 90; then + 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 $COUNT + kill $PID_S + fi + kill $PID_PING + done } PLOT_CMD=' -set title "Round-trip time with ethenet load - ping -fs 64000 (`uname -r`)" +set title "Round-trip time with ethernet load - ping -fs 64000" 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" +plot [0:] "socketcan-norm-1000.dat" with lp lt 1 title "Socketcan",\ + "lincan-norm-1000.dat" with lp lt 2 title "Lincan",\ + "socketcan-boost-1000.dat" with lp lt 1 title "Socketcan boosted IRQ prio",\ + "lincan-boost-1000.dat" with lp lt 2 title "Lincan boosted IRQ prio" ' diff --git a/tests/ethload.sh b/tests/ethload.sh index 5b31c54..8aecd34 100755 --- a/tests/ethload.sh +++ b/tests/ethload.sh @@ -6,10 +6,12 @@ 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 0 -c 10000 - kill $PID_S + echo 0 1 > $DRIVER-$i-1000.dat + if [ $i != "boost" ] || boost_irq_prio 90; then + 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 0 -c $COUNT + kill $PID_S + fi kill $PID_LOAD done } @@ -17,7 +19,7 @@ t() { PLOT_CMD=' -set title "Round-trip time with receive ethenet load (`uname -r`)" +set title "Round-trip time with receive ethernet load" set logscale y set grid set xlabel "Time [{/Symbol m}s]" diff --git a/tests/ethload300MHz.sh b/tests/ethload300MHz.sh deleted file mode 100755 index c7ee55d..0000000 --- a/tests/ethload300MHz.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/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 0 -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 lt 1 title "Socketcan",\ - "lincan-norm-1000.dat" with lp lt 2 title "Lincan",\ - "socketcan-boost-1000.dat" with lp lt 1 title "Socketcan boosted IRQ prio",\ - "lincan-boost-1000.dat" with lp lt 2 title "Lincan boosted IRQ prio" -' diff --git a/tests/ethloadsend.sh b/tests/ethloadsend.sh index a720202..8a9fc16 100755 --- a/tests/ethloadsend.sh +++ b/tests/ethloadsend.sh @@ -3,18 +3,18 @@ . _lib.sh t() { - ( find -L /usr/src/linux -type f -exec cat '{}' ';'|ssh root@${SSH_CONNECTION%% *} 'cat > /dev/null' ) & + 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 + vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 0 -c $COUNT kill $PID_S - kill $PID_LOAD + kill %% # Kill the whole pipe above } PLOT_CMD=' -set title "Round-trip time with receive ethenet load (`uname -r`)" +set title "Round-trip time with send ethernet load" set logscale y set grid set xlabel "Time [{/Symbol m}s]" diff --git a/tests/genhtml.py b/tests/genhtml.py new file mode 100755 index 0000000..8fd6da2 --- /dev/null +++ b/tests/genhtml.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python + +import os; +import dircache; +import sys; + +os.chdir(sys.argv[1]) + +class Axis: + def __init__(self, atype): + self.type = atype + self.values = dircache.listdir('by-%s'%atype) + + def __str__(self): + if self.type == "kern": return "kernel" + elif self.type == "clck": return "CPU clock" + elif self.type == "test": return "test" + else: raise Exception, "Unknown type" + + def __iter__(self): + return iter(self.values) + + def __getitem__(self, key): + return self.values[key] + + def getLabel(self, v): + if self.type == "clck": return v+" MHz" + elif self.type == "test": return "%s"%(v, v) + else: return v + + + def labels(self): + for v in self.values: + yield self.getLabel(v) + +kernels = Axis('kern') +clocks = Axis('clck') +tests = Axis('test') + +class PageSet: + def __init__(self, values, x, y): + self.values = values + self.x = x + self.y = y + + def getPages(self): + for v in self.values: + yield Page(self.values.type, str(self.values), v, self.x, self.y) + +class Page: + def __init__(self, prefix, name, value, xvals, yvals): + self.prefix = prefix + self.name = name + self.value = value + self.xvals = xvals + self.yvals = yvals + + def generate(self, pagesets): + html = open("%s-%s.html"%(self.prefix, self.value), "w") + print >> html, """ + +CAN driver benchmark for %s %s + + + +

CAN driver benchmark for %s %s

""" % (self.name, self.value, self.name, self.value) + for ps in pagesets: + print >>html, "View by %s: " % str(ps.values) + for v in ps.values: + print >>html, "%s | "%(ps.values.type, v, v) + print >>html, "
" + print >>html, "" + for x in self.xvals.labels(): + print >>html, "" % x + print >>html, "" + for y in self.yvals: + print >>html, "" % self.yvals.getLabel(y) + + for x in self.xvals: + print >>html, "" + print >>html, "" + print >> html, """ +
%s
%s" + d="by-%s/%s/%s/%s/" % (self.prefix, self.value, y, x) + dthumb = d+"thumb" + try: + for img in dircache.listdir(dthumb): + print >>html, "" % (d, img, d, img) + except OSError: + print "error" + print >>html, "
+ +""" + + +pagesets = [ PageSet(kernels, clocks, tests), + PageSet(tests, clocks, kernels), + PageSet(clocks, kernels, tests)] + +for ps in pagesets: + for p in ps.getPages(): + p.generate(pagesets) + +try: + os.remove("index.html") +except OSError: pass + +os.symlink("%s-%s.html"%(kernels.type, kernels[0]), "index.html") + +os.system("source-highlight -d --output-dir=. ../*.sh") + + + diff --git a/tests/rtt-300MHz.sh b/tests/rtt-300MHz.sh deleted file mode 100755 index e6f0913..0000000 --- a/tests/rtt-300MHz.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -. _lib.sh - -t() { - PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1` - cpufreq-set -f 300MHz - 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 -} - - - -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" -' - diff --git a/tests/rtt-virtual-300MHz.sh b/tests/rtt-virtual-300MHz.sh deleted file mode 100755 index 2bac3f6..0000000 --- a/tests/rtt-virtual-300MHz.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -. _lib.sh - -t() { - PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN0` - cpufreq-set -f 300MHz - 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 -} - -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" -' - diff --git a/tests/rtt-virtual.sh b/tests/rtt-virtual.sh index 918cac7..cf8cca4 100755 --- a/tests/rtt-virtual.sh +++ b/tests/rtt-virtual.sh @@ -4,14 +4,14 @@ t() { 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 0 -c 10000 + vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 0 -c $COUNT kill $PID_S } TESTS="lincan_virtual socketcan_virtual" PLOT_CMD=' -set title "Round-trip time - virtual CAN (`uname -r`)" +set title "Round-trip time - virtual CAN" set logscale y set grid set xlabel "Time [{/Symbol m}s]" diff --git a/tests/rtt-w.sh b/tests/rtt-w.sh index 7fed8b5..a91308b 100755 --- a/tests/rtt-w.sh +++ b/tests/rtt-w.sh @@ -4,16 +4,16 @@ t() { PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1` - vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER-0 -t 1 -d $CAN0 -w 0 -n 10 -c 10000 - vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER-1 -t 1 -d $CAN0 -w 1 -n 10 -c 10000 - vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER-2 -t 1 -d $CAN0 -w 2 -n 10 -c 10000 + vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER-0 -t 1 -d $CAN0 -w 0 -n 10 -c $COUNT + vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER-1 -t 1 -d $CAN0 -w 1 -n 10 -c $COUNT + vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER-2 -t 1 -d $CAN0 -w 2 -n 10 -c $COUNT kill $PID_S } PLOT_CMD=' -set title "Round-trip time depending on delay between sends (`uname -r`)" +set title "Round-trip time depending on delay between sends" set logscale y set grid set xlabel "Time [{/Symbol m}s]" diff --git a/tests/rtt.sh b/tests/rtt.sh index cf0a346..757ff45 100755 --- a/tests/rtt.sh +++ b/tests/rtt.sh @@ -4,14 +4,14 @@ t() { PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1` - vca_canping -m 1 -R FF:$RTPRIO -v -e $DRIVER-times -g $DRIVER -t 1 -d $CAN0 -w 0 -n 10 -c 10000 + vca_canping -m 1 -R FF:$RTPRIO -v -e $DRIVER-times -g $DRIVER -t 1 -d $CAN0 -w 0 -n 10 -c $COUNT kill $PID_S } PLOT_CMD=' -set title "Round-trip time (`uname -r`)" +set title "Round-trip time" set logscale y set grid set xlabel "Time [{/Symbol m}s]" @@ -21,8 +21,8 @@ plot [0:] "socketcan-1000.dat" with lp title "Socketcan",\ ' PLOT_CMD[1]=' -set title "Round-trip time history (`uname -r`)" -set logscale y +set title "Round-trip time history" +set logscale xy set grid set xlabel "Ping number" set ylabel "Round-trip time [{/Symbol m}s]"