PROGRAM=MP3Player
SOURCE_FILES=MP3Player.java
+ifndef INV_ERROR_PROB
+INV_ERROR_PROB=1000
+endif
+
+ifndef RANDOMSEED
+RANDOMSEED=12345
+endif
+
SSJAVA= -ssjava -ssjavadebug
BSFLAGS= -32bit -mainclass $(PROGRAM) -heapsize-mb 1000 -nooptimize -debug -garbagestats #-printlinenum #-joptimize
NORMAL= -ssjava-inject-error 0 0
-INJECT_ERROR= -ssjava-inject-error 1000 12345
+INJECT_ERROR= -ssjava-inject-error $(INV_ERROR_PROB) $(RANDOMSEED)
default: $(PROGRAM)s.bin
$(PROGRAM)e.bin: $(SOURCE_FILES) makefile
$(BUILDSCRIPT) $(INJECT_ERROR) $(BSFLAGS) -o $(PROGRAM)e -builddir injerr $(SOURCE_FILES)
+cleanerror:
+ rm -f $(PROGRAM)e.bin
+ rm -rf injerr
+
clean:
rm -f $(PROGRAM)s.bin $(PROGRAM)n.bin $(PROGRAM)e.bin
rm -fr ssj norm injerr
--- /dev/null
+#!/bin/bash
+
+if [[ -z $1 ]] ; then
+ echo 'Please supply an inverse probability (e.g. 1000).'
+ exit
+fi
+
+if [[ -z $2 ]] ; then
+ echo 'Please supply a random seed.'
+ exit
+fi
+
+trycommand () {
+ $1
+ if [[ ! $? ]] ; then
+ echo "FAILED: $1"
+ exit
+ fi
+}
+
+trycommand "make normal"
+trycommand "make cleanerror"
+trycommand "make error INV_ERROR_PROB=$1 RANDOMSEED=$2"
+trycommand "run-normal.sh"
+trycommand "run-error.sh"
+trycommand "plot-normal-vs-error.sh"
#!/bin/bash
MP3Playere.bin focus.mp3 > error.txt
+grep "SSJAVA: Injecting error" error.txt
+
mp3samples2plotData.sh error.txt
\ No newline at end of file