Date:2011-09-18 16:06:35 (8 years 9 hours ago)
Author:Werner Almesberger
Commit:3727324a2c73a39a3e4b3cc2524f53e05506f7c5
Message:m1/perf/: scripts for bulk test runs and tabulating the results

Files: m1/perf/all-runs (1 diff)
m1/perf/runs (1 diff)
m1/perf/tabulate (1 diff)

Change Details

m1/perf/all-runs
1#!/bin/sh -ex
2
3rm -rf data
4
5mkdir data
6for n in ref new opt; do
7
8        case $n in
9        ref) flags=;;
10        new) flags=-n;;
11        opt) flags="-n -o";;
12        esac
13
14    mkdir data/$n
15        for m in out expr prof; do
16                case $m in
17                out) more=-s;;
18                expr) more=-e;;
19                prof) more=-p;;
20                esac
21
22                mkdir data/$n/$m
23                ./runs $flags $more data/$n/$m || exit
24        done
25done
26
m1/perf/runs
1#!/bin/sh -x
2
3
4sanitize()
5{
6    basename "$1" .fnp | tr ' ' _ | tr -cd 'A-Za-z0-9_-' | tr -s _ _
7}
8
9
10usage()
11{
12cat <<EOF 1>&2
13usage: $0 [-e|-p] [-n [-o] [-s]] dir
14
15  -e generate the calculated expression (default: just dump debug output)
16  -p profile 10000 runs (default: just dump debug output)
17  -n use "new" scheduler
18  -o enable LCPF optimizer
19  -s enable register pressure statistics
20EOF
21
22}
23
24
25M1=`make path`
26
27extra=
28sched=
29profile=false
30evaluate=false
31
32while [ "${1#-}" != "$1" ]; do
33    case "$1" in
34    -e) evaluate=true;;
35    -p) profile=true;;
36    -n) sched=SCHED=sched.o;;
37    -o) extra="$extra -DLCPF";;
38    -s) extra="$extra -DREG_STATS";;
39    *) usage;;
40    esac
41    shift
42done
43
44[ -z "$1" -o "$2" ] && usage
45if [ ! -d "$1" ]; then
46    echo "$1: directory not found" 1>&2
47    exit 1
48fi
49
50$profile || extra="$extra -DCOMP_DEBUG"
51
52make CFLAGS_EXTRA="$extra" $sched clean all
53
54for n in $M1/flickernoise/patches/*/*.fnp; do
55    s=`sanitize "$n"`
56    if $profile; then
57        ./main "$n" 10000 || exit
58        gprof main >"$1"/$s
59    elif $evaluate; then
60        ./main "$n" | ./eval.pl >"$1"/$s || exit
61    else
62        ./main "$n" >"$1"/$s || exit
63    fi
64done
m1/perf/tabulate
1#!/bin/sh -x
2
3M1=`make path`
4
5
6time()
7{
8    sed '/^.*of \([0-9.]*\) seconds.*/s//\1/p;d' <data/$1/prof/$2
9}
10
11
12size()
13{
14    sed '/^0*\([1-9][0-9]*\): VECTOUT.*/s//\1/p;d' <data/$1/out/$2 |
15        tail -n 1
16}
17
18
19eff()
20{
21    sed '/^Efficiency: \([0-9.]*\)%/s//\1/p;d' <data/$1/out/$2 | tail -n 1
22}
23
24
25regs()
26{
27    sed '/^regs: 0/s///p;d' <data/$1/out/$2 | tail -n 1
28}
29
30
31sum()
32{
33    md5sum <data/$1/expr/$2 | sed 's/ .*//'
34}
35
36
37eq()
38{
39    if [ "$1" = "$2" ]; then
40        echo Y
41    else
42        echo N
43    fi
44}
45
46
47echo "Original Unoptimized Optimized Equiv Name"
48echo "Time Size Eff Time Size Eff Regs Time Size Eff Regs"
49
50for n in `ls -1 data/ref/out`; do
51    ref=`sum ref $n`
52    new=`sum new $n`
53    opt=`sum opt $n`
54    printf "%5.1f %4d%3d%% %5.1f %4d%3d%% %4d %5.1f %4d%3d%% %4d %s " \
55      `time ref $n` `size ref $n` `eff ref $n` \
56      `time new $n` `size new $n` `eff new $n` `regs new $n` \
57      `time opt $n` `size opt $n` `eff opt $n` `regs opt $n` \
58      `eq $ref $new`/`eq $ref $opt`/`eq $new $opt`
59    echo $n
60done

Archive Download the corresponding diff file

Branches:
master



interactive