-rm -f /tmp/bench.txt
-# with markers
-echo ">running with markers activated"
-t2=$(/usr/bin/time -f%e usttrace ./bench2 $NR_CPUS $NR_EVENTS 2>&1 1> /dev/null)
-echo " time=$t2 sec"
+# with markers, connected, tracing
+n=0
+while [ $n -lt "$iters" ]; do
+ echo ">running with markers activated, trace recording"
+ echo 3 >/proc/sys/vm/drop_caches
+ t3=$(sh -c "$CMD_MARKERTRACE")
+ echo "$t3" >>result-marktrace.txt
+ echo " time=$t3 sec"
+ n=$(($n+1))
+done
+./average <result-marktrace.txt >average-marktrace.txt
+echo "( $(<average-marktrace.txt) - $(<average-nomark.txt) ) / $NR_EVENTS" | bc -l >perevent-marktrace.txt
+
+function print_penalty()
+{
+ echo ""
+
+ #penalty = t2 - t1
+ penalty=$(echo "$2 - $1;" | bc)
+ echo "Penalty ($3) = $penalty sec"