benchmarks/benchmark-runner.sh
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 04 Feb 2019 00:24:10 +0000
changeset 3886 292b73957757
parent 2965 bac7022ca26a
permissions -rwxr-xr-x
Fix initialization of system propertirs ...and use `amd64` consistenly instead of `x86_64`.

#!/bin/sh

DEBUGGER=
PROFILER=
PROFILER_OPTS=

if [ "$1" = "--gdb" ]
then
    shift
    DEBUGGER=gdb
fi

if [ "$1" = "--cgdb" ]
then
    shift
    DEBUGGER=cgdb
fi

if [ "$1" = "--callgrind" ]
then
    shift
    #PROFILER="/usr/local/bin/valgrind -v -v -d --tool=callgrind --instr-atstart=no"
    PROFILER="/usr/local/bin/valgrind -v --smc-check=all-non-file --tool=callgrind --instr-atstart=no"
    PROFILER="valgrind -v --smc-check=all-non-file --tool=callgrind --instr-atstart=no --branch-sim=yes --cache-sim=yes --collect-jumps=yes"
    #PROFILER_OPTS=--callgrind
fi

if [ "$1" = "--help" ]
then
    echo <<ENDHELP
  --gdb ................... run benchmark under gdb debugger. Start with 
                            (gdb) r -I -f "$DIR/benchmark-runner.st" -b ... 
  --cgdb .................. run benchmark under cgdb debugger
  --callgrind ............. run benchmark under callgrind profiler. 
ENDHELP
    "$DIR/../../projects/smalltalk/stx" -I  -f "$DIR/benchmark-runner.st" ${1+"$@"}
# .........................
fi

DIR=`dirname $0`
if [ ! -z "$DEBUGGER" ]; then
    exec $DEBUGGER $DIR/../../projects/smalltalk/stx 
fi
if [ ! -z "$PROFILER" ]; then
    exec $PROFILER $DIR/../../projects/smalltalk/stx \
        -I -f "$DIR/benchmark-runner.st" \
        ${1+"$@"}    
fi

    
exec "$DIR/../../projects/smalltalk/stx" \
    -I  -f "$DIR/benchmark-runner.st" \
    ${1+"$@"}