#!/bin/ksh set -e # bonnie v1 #sets="3 5 7 9 11" # bonnie v2 sets="8 10 12 14 16" debug=0 # # format the data from bonnie tests so that it becomes readable by gnuplot # here we compare only two bench results with multiple runs (-x 5) # [[ -z $2 ]] && echo "usage: [inverse]" && exit 1 file1=$1 file2=$2 inverse=$3 output1=`grep -vE '^[[:alpha:]]' $file1` output2=`grep -vE '^[[:alpha:]]' $file2` runs=`echo "$output1" | wc -l` runs2=`echo "$output2" | wc -l` (( runs != runs2 )) && echo number of runs differ between $file1:$runs and $file2:$runs2 && exit 1 unset runs2 function inverse_set { (( set == 3 )) && echo 11 (( set == 5 )) && echo 9 (( set == 7 )) && echo 7 (( set == 9 )) && echo 5 (( set == 11 )) && echo 3 (( set == 8 )) && echo 16 (( set == 10 )) && echo 14 (( set == 12 )) && echo 12 (( set == 14 )) && echo 10 (( set == 16 )) && echo 8 } echo -n writing bonnie.dat ... (( run = 1 )) rm -f bonnie.dat until (( run > runs )); do (( debug > 0 )) && echo debug run is $run for set in $sets; do before=`echo "$output1" | sed -n ${run}p | cut -f$set -d,` after=`echo "$output2" | sed -n ${run}p | cut -f$set -d,` (( `echo "$before" | wc -l` != 1 )) && echo "that is not just one line: $before" (( `echo "$after" | wc -l` != 1 )) && echo "that is not just one line: $after" [[ $inverse = inverse ]] && (( debug > 0 )) && echo -n "set was $set " [[ $inverse = inverse ]] && set=`inverse_set` [[ $inverse = inverse ]] && (( debug > 0 )) && echo and became $set (( debug > 0 )) && echo "run $run -- set $set -- file1:$before -- file2:$after" echo -e "$run \t $set \t $before \t $after" >> bonnie.dat unset before after done (( run++ )) done && echo done cat > bonnie.plot <