--- a/s/stx/benchmark-runner.sh Mon Apr 20 12:53:16 2015 +0100
+++ b/s/stx/benchmark-runner.sh Mon Apr 20 14:17:58 2015 +0100
@@ -36,6 +36,19 @@
--callgrind)
CALLGRIND="valgrind -v --smc-check=all-non-file --tool=callgrind --instr-atstart=no --collect-jumps=yes --cache-sim=yes --branch-sim=yes"
;;
+ --stap)
+ shift
+ if [ -z "$1" ]; then
+ echo "--stap requires systemtap script to run"
+ exit 1
+ fi
+ if [ ! -r "$1" ]; then
+ echo "$1 is not a readable systemtap script"
+ echo "--stap requires systemtap script to run"
+ exit 1
+ fi
+ STAPSCRIPT=$1
+ ;;
-T*)
VM_OPTS="$VM_OPTS $1"
;;
@@ -55,19 +68,23 @@
DIR=`dirname $0`
if [ ! -z "$DEBUGGER" ]; then
exec $DEBUGGER $VM
-fi
-if [ ! -z "$CALLGRIND" ]; then
+elif [ ! -z "$CALLGRIND" ]; then
JITMAP=$(mktemp --suffix=.txt)
- echo "JIT map saved to: $JITMAP"
- exec $CALLGRIND $VM \
+ $CALLGRIND $VM \
$VM_OPTS \
-I -Xdump-compile-map=$JITMAP \
--execute "$DIR/benchmark-runner.rc" \
$SMALLTALK_OPTS
+ echo "JIT map saved to: $JITMAP"
+ exit $?
+elif [ ! -z "$STAPSCRIPT" ]; then
+ stap \
+ --unprivileged $STAPSCRIPT -I "$TOP/stx/hacking/tapset" \
+ -c "$VM $VM_OPTS --execute $DIR/benchmark-runner.rc $SMALLTALK_OPTS"
+ exit $?
+else
+ exec "$VM" \
+ $VM_OPTS \
+ -I --execute "$DIR/benchmark-runner.rc" \
+ $SMALLTALK_OPTS
fi
-
-
-exec "$VM" \
- $VM_OPTS \
- -I --execute "$DIR/benchmark-runner.rc" \
- $SMALLTALK_OPTS