L4Sys: fix use of L4SYS_NUMINSTR
* L4SYS_NUMINSTR counts the instructions that were selected for injection and is used by the campaign server to generate experiments * L4SYS_TOTINSTR counts the total number of instructions executed. It is used by the experiment to determine the timeout value. Change-Id: Ibf37aea2a1f5ad5afad2b1232ce22fe070b08490
This commit is contained in:
@ -40,7 +40,10 @@ echo -e "\033[35;1m[$(date)] ================== Step 2: Get Instruction Count ==
|
||||
cat $BAK | sed -e 's/PREPARATION_STEP.*/PREPARATION_STEP 2/' >$CFG
|
||||
buildfail
|
||||
echo -e "\033[32mRunning...\033[0m"
|
||||
num_inst=`$FAIL_CMD 2>/dev/null | grep instructions\; | sed -e 's/.*after \(.*\) instructions.*/\1/'`
|
||||
values=`$FAIL_CMD 2>/dev/null | grep instructions\; | sed -e 's/.*after \(.*\) instructions;\(.*\) accepted/\1 \2/'`
|
||||
echo $values
|
||||
filtered_instr=`echo $values | cut -d\ -f 2`
|
||||
total_instr=`echo $values | cut -d\ -f 1`
|
||||
|
||||
echo -e "\033[35;1m[$(date)] ================== Step 3: Golden Run ==========================\033[0m"
|
||||
cat $BAK | sed -e 's/PREPARATION_STEP.*/PREPARATION_STEP 3/' >$CFG
|
||||
@ -48,9 +51,10 @@ BuildNRun
|
||||
|
||||
# now get ready to rumble...
|
||||
echo -e "\033[35;1m[$(date)] ================== Step 4: Build Injection Client ==============\033[0m"
|
||||
cat $BAK | sed -e "s/L4SYS_NUMINSTR.*/L4SYS_NUMINSTR $((num_inst*10))/" >$BAK.2
|
||||
cat $BAK.2 | sed -e "s/PREPARATION_STEP.*/PREPARATION_STEP 0/">$CFG
|
||||
rm $BAK $BAK.2
|
||||
cat $BAK | sed -e "s/L4SYS_NUMINSTR.*/L4SYS_NUMINSTR $filtered_instr/" >$BAK.2
|
||||
cat $BAK.2 | sed -e "s/L4SYS_TOTINSTR.*/L4SYS_TOTINSTR $total_instr/" >$BAK.3
|
||||
cat $BAK.3 | sed -e "s/PREPARATION_STEP.*/PREPARATION_STEP 0/">$CFG
|
||||
rm $BAK $BAK.2 $BAK.3
|
||||
buildfail
|
||||
|
||||
echo -e "\033[32;1m=========================================================================================="
|
||||
|
||||
Reference in New Issue
Block a user