diff --git a/scripts/l4sys/l4sys-prepare.sh b/scripts/l4sys/l4sys-prepare.sh index dc7c8372..2d94acb2 100755 --- a/scripts/l4sys/l4sys-prepare.sh +++ b/scripts/l4sys/l4sys-prepare.sh @@ -15,6 +15,20 @@ BAK=experimentInfo.hpp.bak CFG=experimentInfo.hpp FAIL_CMD="fail-client -q" # -rc bochs-dbg.rc" FAILDIR=/home/doebel/src/fail +DBNAME=fiasco + +if [ -n "$1" ] ; then + if [ "$1" = "mem" ]; then + IMPORTER=MemoryImporter; + fi +fi + +if [ "$IMPORTER" = "MemoryImporter" ]; then + echo "Preparing memory injection experiment." +else + IMPORTER=RegisterImporter; + echo "Preparing register injection experiment." +fi function buildfail { echo -e "\033[33mCompiling....\033[0m" @@ -39,6 +53,7 @@ BuildNRun -f bochsrc-bd echo -e "\033[35;1m[$(date)] ================== Step 2: Get Instruction Count ===============\033[0m" cat $BAK | sed -e 's/PREPARATION_STEP.*/PREPARATION_STEP 2/' >$CFG buildfail + echo -e "\033[32mRunning...\033[0m" values=`$FAIL_CMD 2>/dev/null | grep instructions\; | sed -e 's/.*after \(.*\) instructions;\(.*\) accepted/\1 \2/'` echo $values @@ -58,8 +73,8 @@ rm $BAK $BAK.2 $BAK.3 buildfail echo -e "\033[35;1m[$(date)] ================== Step 5: Trace Import/Prune ==============\033[0m" -import-trace --importer RegisterImporter -e fiasco.image -d fail -prune-trace -d fail +import-trace --importer $IMPORTER -e fiasco.image -d $DBNAME -t trace.pb +prune-trace -d $DBNAME echo -e "\033[32;1m==========================================================================================" echo "[$(date)] Preparations are finished. Happy injecting...."