update
[lttv.git] / markers-test / runtest.sh
index e62d589ca847c7c86fa0f6e69e094968e334f4bc..f8ee3b42ec2ee112d332f5ea62eb3ab3eb64f3e8 100644 (file)
 #!/bin/sh
 
+make clean
+make #build no flush modules
+
+ITER=10
+LOOPS=2000
+
+insmod test-mark-speed-empty.ko
+for a in `seq 1 $ITER`; do cat /proc/testmark;done
+rmmod test-mark-speed-empty
+RESEMP=`dmesg |tail -n 10 |sed 's/^\[.*\] //'| sed 's/cycles : \(.*\)$/\1/'`
+
 insmod test-mark-speed.ko
-for a in `seq 1 10`; do cat /proc/testmark;done
+for a in `seq 1 $ITER`; do cat /proc/testmark;done
 rmmod test-mark-speed
-RESSTD=`dmesg |tail -n 10 |sed 's/^\[.*\] cycles : \(.*\)$/\1/'`
+RESSTD=`dmesg |tail -n 10 |sed 's/^\[.*\] //'| sed 's/cycles : \(.*\)$/\1/'`
 
 insmod test-mark-speed-opt.ko
-for a in `seq 1 10`; do cat /proc/testmark;done
+for a in `seq 1 $ITER`; do cat /proc/testmark;done
 rmmod test-mark-speed-opt
-RESOPT=`dmesg |tail -n 10|sed 's/^\[.*\] cycles : \(.*\)$/\1/'`
+RESOPT=`dmesg |tail -n 10 |sed 's/^\[.*\] //'| sed 's/cycles : \(.*\)$/\1/'`
 
 insmod test-mark-speed-edit.ko
-for a in `seq 1 10`; do cat /proc/testmark;done
+#Patch with nops
+cat /proc/testmark
+
+for a in `seq 1 $ITER`; do cat /proc/testmark;done
 rmmod test-mark-speed-edit
-RESNOP=`dmesg |tail -n 10|sed 's/^\[.*\] cycles : \(.*\)$/\1/'`
+RESNOP=`dmesg |tail -n 10 |sed 's/^\[.*\] //'| sed 's/cycles : \(.*\)$/\1/'`
+
+insmod test-mark-speed-local.ko
+#Patch with nops
+cat /proc/testmark
+
+for a in `seq 1 $ITER`; do cat /proc/testmark;done
+rmmod test-mark-speed-local
+RESNOPLOCAL=`dmesg |tail -n 10 |sed 's/^\[.*\] //'| sed 's/cycles : \(.*\)$/\1/'`
+
+
+make clean
+make EXTRA_CFLAGS=-DCACHEFLUSH
+
+insmod test-mark-speed-empty.ko
+for a in `seq 1 $ITER`; do cat /proc/testmark;done
+rmmod test-mark-speed-empty
+RESEMPFL=`dmesg |tail -n 10 |sed 's/^\[.*\] //'| sed 's/cycles : \(.*\)$/\1/'`
+
+insmod test-mark-speed.ko
+for a in `seq 1 $ITER`; do cat /proc/testmark;done
+rmmod test-mark-speed
+RESSTDFL=`dmesg |tail -n 10 |sed 's/^\[.*\] //'| sed 's/cycles : \(.*\)$/\1/'`
+
+insmod test-mark-speed-opt.ko
+for a in `seq 1 $ITER`; do cat /proc/testmark;done
+rmmod test-mark-speed-opt
+RESOPTFL=`dmesg |tail -n 10 |sed 's/^\[.*\] //'| sed 's/cycles : \(.*\)$/\1/'`
+
+insmod test-mark-speed-edit.ko
+#Patch with nops
+cat /proc/testmark
+
+for a in `seq 1 $ITER`; do cat /proc/testmark;done
+rmmod test-mark-speed-edit
+RESNOPFL=`dmesg |tail -n 10 |sed 's/^\[.*\] //'| sed 's/cycles : \(.*\)$/\1/'`
+
+insmod test-mark-speed-local.ko
+#Patch with nops
+cat /proc/testmark
+
+for a in `seq 1 $ITER`; do cat /proc/testmark;done
+rmmod test-mark-speed-local
+RESNOPLOCALFL=`dmesg |tail -n 10 |sed 's/^\[.*\] //'| sed 's/cycles : \(.*\)$/\1/'`
 
-echo "20000 iterations"
 
-echo "Numbers for normal marker"
 
+
+echo "Results in cycles per loop"
+
+echo "Cycles for empty loop (will be substracted for cached runs)"
 SUM="0"
-for a in $RESSTD; do SUM=$[$SUM + $a]; done
-RESSTD=$[$SUM / 10]
+for a in $RESEMP; do SUM=$[$SUM + $a]; done
+RESEMP=`echo $SUM/$ITER/$LOOPS | bc -l /dev/stdin`
+echo $RESEMP
+
+echo "Cycles for wbinvd() loop (will be substracted non-cached runs)"
+SUM="0"
+for a in $RESEMPFL; do SUM=$[$SUM + $a]; done
+RESEMPFL=`echo $SUM/$ITER/$LOOPS | bc -l /dev/stdin`
+echo $RESEMPFL
+
 
+echo "Added cycles for normal marker (cached)"
+SUM="0"
+for a in $RESSTD; do SUM=$[$SUM + $a]; done
+RESSTD=`echo $SUM/$ITER/$LOOPS - $RESEMP | bc -l /dev/stdin`
 echo $RESSTD
 
-echo "Numbers for optimized marker"
+echo "Added cycles for normal marker (uncached)"
+SUM="0"
+for a in $RESSTDFL; do SUM=$[$SUM + $a]; done
+RESSTDFL=`echo $SUM/$ITER/$LOOPS - $RESEMPFL | bc -l /dev/stdin`
+echo $RESSTDFL
+
+
+
+echo "Added cycles for optimized marker (cached)"
 SUM="0"
 for a in $RESOPT; do SUM=$[$SUM + $a]; done
-RESOPT=$[$SUM / 10]
+RESOPT=`echo $SUM/$ITER/$LOOPS - $RESEMP | bc -l /dev/stdin`
 echo $RESOPT
 
-echo "Numbers for NOP replacement of function call"
+echo "Added cycles for optimized marker (uncached)"
+SUM="0"
+for a in $RESOPTFL; do SUM=$[$SUM + $a]; done
+RESOPTFL=`echo $SUM/$ITER/$LOOPS - $RESEMPFL | bc -l /dev/stdin`
+echo $RESOPTFL
+
+
+echo "Added cycles for NOP replacement of function call (cached) (1 pointer read, 5 local vars)"
 SUM="0"
 for a in $RESNOP; do SUM=$[$SUM + $a]; done
-RESNOP=$[$SUM / 10]
+RESNOP=`echo $SUM/$ITER/$LOOPS - $RESEMP | bc -l /dev/stdin`
 echo $RESNOP
 
+echo "Added cycles for NOP replacement of function call (uncached) (1 pointer read, 5 local vars)"
+SUM="0"
+for a in $RESNOPFL; do SUM=$[$SUM + $a]; done
+RESNOPFL=`echo $SUM/$ITER/$LOOPS - $RESEMPFL | bc -l /dev/stdin`
+echo $RESNOPFL
+
+
+echo "Added cycles for NOP replacement of function call (cached) (6 local vars)"
+SUM="0"
+for a in $RESNOPLOCAL; do SUM=$[$SUM + $a]; done
+RESNOPLOCAL=`echo $SUM/$ITER/$LOOPS - $RESEMP | bc -l /dev/stdin`
+echo $RESNOPLOCAL
+
+echo "Added cycles for NOP replacement of function call (uncached) (6 local vars)"
+SUM="0"
+for a in $RESNOPLOCALFL; do SUM=$[$SUM + $a]; done
+RESNOPLOCALFL=`echo $SUM/$ITER/$LOOPS - $RESEMPFL | bc -l /dev/stdin`
+echo $RESNOPLOCALFL
This page took 0.024823 seconds and 4 git commands to generate.