From: Michal Sojka Date: Mon, 13 Jan 2014 17:16:09 +0000 (+0100) Subject: Scripts for running all experiments, getting and processing results X-Git-Tag: fix-allnoconfig~83 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/can-benchmark.git/commitdiff_plain/52635808ae22d26ce0d4a7636b3b737b0a2dba1e Scripts for running all experiments, getting and processing results --- diff --git a/ugw/data/.gitignore b/ugw/data/.gitignore new file mode 100644 index 0000000..5b5f9b6 --- /dev/null +++ b/ugw/data/.gitignore @@ -0,0 +1,2 @@ +*.dat +*.txt diff --git a/ugw/data/Makefile b/ugw/data/Makefile new file mode 100644 index 0000000..2f38e23 --- /dev/null +++ b/ugw/data/Makefile @@ -0,0 +1,10 @@ +MSGS=$(wildcard *-msgs.txt) + +DAT=$(MSGS:%-msgs.txt=%.dat) + +result: $(DAT) preprocess.m + ./preprocess.m $(DAT) + + +%.dat: %-msgs.txt + awk '{print $$17}' < $< > $@ diff --git a/ugw/data/bench-all.sh b/ugw/data/bench-all.sh new file mode 100755 index 0000000..fa6cd93 --- /dev/null +++ b/ugw/data/bench-all.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -x + +methods=${@:-rtems kernel read-write mmap-write mmapbusy-write mmapbusy-mmap readbusy-write} + +for method in $methods; do + case $method in + rtems) ../../rtems/gw/boot --expect '"]", sub { shift->send_slow(0.1, "startGW\n"); }' --exiton 'tasks started';; + kernel) ../ppc/boot -a kernelgw --exiton "Kernel GW started";; + read-write) ../ppc/boot --exiton "UGW started";; + mmap-write) ../ppc/boot -a "ugw=|-r mmap|" --exiton "UGW started";; + mmapbusy-write) ../ppc/boot -a "ugw=|-r mmapbusy|" --exiton "UGW started";; + mmapbusy-mmap) ../ppc/boot -a "ugw=|-r mmapbusy -t mmap|" --exiton "UGW started";; + readbusy-write) ../ppc/boot -a "ugw=|-b 300|" --exiton "UGW started";; + *) + echo >&2 "Unknown method '$method'"; + exit 1; + esac + ssh glab "latester -d can0 -d can1 -d can2 --oneattime -c 1000 -q -n $method" + scp glab:"$method-*.txt" . + sleep 2 # Wait for cu at glab to die +done diff --git a/ugw/data/plot.gp b/ugw/data/plot.gp new file mode 100644 index 0000000..ba1a4e0 --- /dev/null +++ b/ugw/data/plot.gp @@ -0,0 +1,12 @@ +set title "CAN GW routing latency" +set xlabel "Method" +set ylabel "GW latency [µs]" +set style data histogram +set style histogram +set style fill solid border -1 +set boxwidth 0.9 +set key off +set grid +set xtics rotate by -20 +set style histogram errorbars gap 1 lw 1 +plot 'result' using 3:2:4:xtic(1); diff --git a/ugw/data/preprocess.m b/ugw/data/preprocess.m new file mode 100755 index 0000000..6e7b981 --- /dev/null +++ b/ugw/data/preprocess.m @@ -0,0 +1,20 @@ +#!/usr/bin/octave -q +## -*-octave-*- + +datafiles = argv(); +quantiles = [0 0.5 0.90 0.99]; + +mat = zeros(0, length(quantiles)); +names = {}; + +for i=1:length(argv), + x = load(datafiles{i})*1e6; + q = quantile (x, quantiles); + mat = [ mat; q' ]; + [d, n, e, v] = fileparts(datafiles{i}); + names{i} = n; +end + +[mat, ind] = sortrows(mat, 2); +result = [names(ind)', num2cell(mat)]; +cell2csv("result", result, ' ', '"'); diff --git a/ugw/ppc/S50ugw b/ugw/ppc/S50ugw index 01a0598..f9b28db 100644 --- a/ugw/ppc/S50ugw +++ b/ugw/ppc/S50ugw @@ -10,7 +10,13 @@ set -x # ifconfig eth0 192.168.2.3 # (echo boa; echo boa) | passwd -params=$(sed -e 's/.* ugw=|\([^"]*\)|.*/\1/' /proc/cmdline) +if grep -q kernelgw /proc/cmdline; then + cangw -A -s can0 -d can1 + echo "Kernel GW started" + exit 0 +fi + +params=$(sed -ne 's/.* ugw=|\([^"]*\)|.*/\1/p' /proc/cmdline) # mount -t debugfs none /sys/kernel/debug # cd /sys/kernel/debug/tracing/ diff --git a/ugw/ppc/boot b/ugw/ppc/boot index ba0bc4c..9c89c8f 100755 --- a/ugw/ppc/boot +++ b/ugw/ppc/boot @@ -1,6 +1,6 @@ #!/usr/bin/env novaboot # -*-sh-*- -EXITON=UGW started +#EXITON=UGW started uImage console=ttyPSC0,115200 shark-ryu.dtb rootfs2.uImage < $SRCDIR/mkinitramfs