L4Sys: prepare script supports mem/reg experiments

Change-Id: Ibcbc9e99b063d4b019b4d68401c77fc964253da8
This commit is contained in:
Björn Döbel
2013-09-11 16:18:44 +02:00
parent 8caa63397a
commit 1a09d30127

View File

@ -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...."