benchmarks/benchmark-runner.sh
author Jan Vrany <jan.vrany@fit.cvut.cz>
Fri, 19 Apr 2013 13:50:19 +0200
branchdevelopment
changeset 2532 64a784c73d1e
parent 2380 9195eccdcbd9
child 2579 147986458348
permissions -rwxr-xr-x
Update bytecode and constpool upon context restart. This way the restarted method can execute new code. This allows for fix & continue workflow. Should check for exceptions - will do it later.

#!/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_OPTS=--callgrind
fi

if [ "$1" = "--help" ]
then
    "$DIR/../../projects/smalltalk/stx" -I  -f "$DIR/benchmark-runner.st" ${1+"$@"}
    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
# .........................
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+"$@"}