]> rtime.felk.cvut.cz Git - can-benchmark.git/commitdiff
Scripts for running all experiments, getting and processing results
authorMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 13 Jan 2014 17:16:09 +0000 (18:16 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Mon, 13 Jan 2014 17:16:09 +0000 (18:16 +0100)
ugw/data/.gitignore [new file with mode: 0644]
ugw/data/Makefile [new file with mode: 0644]
ugw/data/bench-all.sh [new file with mode: 0755]
ugw/data/plot.gp [new file with mode: 0644]
ugw/data/preprocess.m [new file with mode: 0755]
ugw/ppc/S50ugw
ugw/ppc/boot

diff --git a/ugw/data/.gitignore b/ugw/data/.gitignore
new file mode 100644 (file)
index 0000000..5b5f9b6
--- /dev/null
@@ -0,0 +1,2 @@
+*.dat
+*.txt
diff --git a/ugw/data/Makefile b/ugw/data/Makefile
new file mode 100644 (file)
index 0000000..2f38e23
--- /dev/null
@@ -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 (executable)
index 0000000..fa6cd93
--- /dev/null
@@ -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 (file)
index 0000000..ba1a4e0
--- /dev/null
@@ -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 (executable)
index 0000000..6e7b981
--- /dev/null
@@ -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, ' ', '"');
index 01a0598b3e0837502fb047d6bfaf4661ef09301a..f9b28db5f3f97e0d22c16510a3211c4001bdb109 100644 (file)
@@ -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/
index ba0bc4c19077fc92cd17060dcaf92bc8caf496b1..9c89c8ffa66ffea0b41fc4e72b5aedf86d50bea2 100755 (executable)
@@ -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