From 3727324a2c73a39a3e4b3cc2524f53e05506f7c5 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 18 Sep 2011 11:06:35 -0300 Subject: [PATCH] m1/perf/: scripts for bulk test runs and tabulating the results --- m1/perf/all-runs | 26 ++++++++++++++++++++ m1/perf/runs | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ m1/perf/tabulate | 60 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100755 m1/perf/all-runs create mode 100755 m1/perf/runs create mode 100755 m1/perf/tabulate diff --git a/m1/perf/all-runs b/m1/perf/all-runs new file mode 100755 index 0000000..bbd35da --- /dev/null +++ b/m1/perf/all-runs @@ -0,0 +1,26 @@ +#!/bin/sh -ex + +rm -rf data + +mkdir data +for n in ref new opt; do + + case $n in + ref) flags=;; + new) flags=-n;; + opt) flags="-n -o";; + esac + + mkdir data/$n + for m in out expr prof; do + case $m in + out) more=-s;; + expr) more=-e;; + prof) more=-p;; + esac + + mkdir data/$n/$m + ./runs $flags $more data/$n/$m || exit + done +done + diff --git a/m1/perf/runs b/m1/perf/runs new file mode 100755 index 0000000..9a544dd --- /dev/null +++ b/m1/perf/runs @@ -0,0 +1,64 @@ +#!/bin/sh -x + + +sanitize() +{ + basename "$1" .fnp | tr ' ' _ | tr -cd 'A-Za-z0-9_-' | tr -s _ _ +} + + +usage() +{ +cat <&2 +usage: $0 [-e|-p] [-n [-o] [-s]] dir + + -e generate the calculated expression (default: just dump debug output) + -p profile 10000 runs (default: just dump debug output) + -n use "new" scheduler + -o enable LCPF optimizer + -s enable register pressure statistics +EOF + +} + + +M1=`make path` + +extra= +sched= +profile=false +evaluate=false + +while [ "${1#-}" != "$1" ]; do + case "$1" in + -e) evaluate=true;; + -p) profile=true;; + -n) sched=SCHED=sched.o;; + -o) extra="$extra -DLCPF";; + -s) extra="$extra -DREG_STATS";; + *) usage;; + esac + shift +done + +[ -z "$1" -o "$2" ] && usage +if [ ! -d "$1" ]; then + echo "$1: directory not found" 1>&2 + exit 1 +fi + +$profile || extra="$extra -DCOMP_DEBUG" + +make CFLAGS_EXTRA="$extra" $sched clean all + +for n in $M1/flickernoise/patches/*/*.fnp; do + s=`sanitize "$n"` + if $profile; then + ./main "$n" 10000 || exit + gprof main >"$1"/$s + elif $evaluate; then + ./main "$n" | ./eval.pl >"$1"/$s || exit + else + ./main "$n" >"$1"/$s || exit + fi +done diff --git a/m1/perf/tabulate b/m1/perf/tabulate new file mode 100755 index 0000000..b8e9cfd --- /dev/null +++ b/m1/perf/tabulate @@ -0,0 +1,60 @@ +#!/bin/sh -x + +M1=`make path` + + +time() +{ + sed '/^.*of \([0-9.]*\) seconds.*/s//\1/p;d'