From: Pierre-Marc Fournier Date: Tue, 11 May 2010 21:01:07 +0000 (-0400) Subject: Update benchmark X-Git-Tag: v0.5~25 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5f06028d2ecf84724fbe380b1d18e766f5c838c1;p=ust.git Update benchmark --- diff --git a/tests/benchmark/run b/tests/benchmark/run index 1e84dc2..7fa580c 100755 --- a/tests/benchmark/run +++ b/tests/benchmark/run @@ -3,36 +3,95 @@ # run ust benchmark # +iters=20 +NR_EVENTS=7000000 +NR_CPUS=1 + +TIME="./ptime" + +#PROG_NOMARKER="find /usr" +PROG_NOMARKER="./bench1 $NR_CPUS $NR_EVENTS" +#PROG_MARKER=$PROG_NOMARKER +PROG_MARKER="./bench2 $NR_CPUS $NR_EVENTS" + +CMD_NOMARKER="$TIME '$PROG_NOMARKER >/dev/null 2>&1'" +CMD_MARKER="$TIME '$PROG_MARKER >/dev/null 2>&1'" +CMD_MARKERCONN="UST_AUTOPROBE=1 $TIME '$PROG_MARKER >/dev/null 2>&1'" +CMD_MARKERTRACE="UST_TRACE=1 UST_AUTOPROBE=1 UST_OVERWRITE=1 UST_AUTOCOLLECT=0 $TIME '$PROG_MARKER >/dev/null 2>&1'" + echo "ust benchmark" -NR_EVENTS=4000000 -NR_CPUS=2 +rm -f result-*.txt average-*.txt perevent-*.txt + echo "using $NR_CPUS processor(s)" echo "using $NR_EVENTS events per cpu" +n=0 +while [ $n -lt "$iters" ]; do + # without markers + echo ">running without markers" + echo 3 >/proc/sys/vm/drop_caches + t1=$(sh -c "$CMD_NOMARKER") + echo "$t1" >>result-nomark.txt + echo " time=$t1 sec" + n=$(($n+1)) +done +./average average-nomark.txt -rm -f /tmp/bench.txt -# without markers -echo ">running without markers" -#t1=$(/usr/bin/time -f%e usttrace ./bench1 $NR_CPUS $NR_EVENTS 2>&1 1> /dev/null) -t1=$(/usr/bin/time -f%e ./bench1 $NR_CPUS $NR_EVENTS 2>&1 1> /dev/null) -echo " time=$t1 sec" +## with markers, not connected +#n=0 +#while [ $n -lt "$iters" ]; do +# echo ">running with markers, not connected" +# echo 3 >/proc/sys/vm/drop_caches +# t2=$(sh -c "$CMD_MARKER") +# echo "$t2" >>result-mark.txt +# echo " time=$t2 sec" +# n=$(($n+1)) +#done +#./average average-mark.txt +#echo "( $(perevent-mark.txt +## with markers, connected +#n=0 +#while [ $n -lt "$iters" ]; do +# echo ">running with markers activated" +# echo 3 >/proc/sys/vm/drop_caches +# t2=$(sh -c "$CMD_MARKERCONN") +# echo "$t2" >>result-markconn.txt +# echo " time=$t2 sec" +# n=$(($n+1)) +#done +#./average average-markconn.txt +#echo "( $(perevent-markconn.txt -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 average-marktrace.txt +echo "( $(perevent-marktrace.txt + +function print_penalty() +{ + echo "" + + #penalty = t2 - t1 + penalty=$(echo "$2 - $1;" | bc) + echo "Penalty ($3) = $penalty sec" + #event = penalty / (nr_events * nr_cpus) + event=$(echo "scale=10; ($penalty / ($NR_EVENTS * $NR_CPUS));" | bc) + echo "Penalty per event ($3) = $event sec" +} -#penalty = t2 - t1 -echo -penalty=$(echo "$t2 - $t1;" | bc) -echo "time penalty=$penalty sec" +#print_penalty $t1 $t2 "Penalty for markers enabled, not tracing" +#print_penalty $t1 $t3 "Penalty for markers enabled, tracing" -#event = penalty / (nr_events * nr_cpus) -event=$(echo "scale=10; ($penalty / ($NR_EVENTS * $NR_CPUS));" | bc) -echo "time penalty per event=$event sec" rm -f /tmp/bench.txt diff --git a/tests/runtests b/tests/runtests index 116bb1f..54ca69b 100755 --- a/tests/runtests +++ b/tests/runtests @@ -109,6 +109,9 @@ wait $! echo "Valgrind output is in $VALG_OUT" NOFAIL [ -z "$(<$VALG_OUT)" ] +### Valgrind libust ### +starttest "libust valgrind check" + echo "************************************" echo "$0: All passed" echo "************************************"