]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Changed minimum time measurement error from 0.00 to 0.01. Command line arguments...
authorBart Van Assche <bvanassche@acm.org>
Thu, 10 Jul 2008 13:57:56 +0000 (13:57 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 10 Jul 2008 13:57:56 +0000 (13:57 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8415

drd/scripts/measurement-functions

index f03534b66f2d3b0ec6852663d8b13eaefa00aca4..1964d125d183c86025d05404f29a075bc55449ba 100644 (file)
@@ -40,7 +40,7 @@ function get_cache_size {
 ## Read a stream of numbers from stdin (one per line), and print the average
 #  and standard deviation.
 function avgstddev {
-  awk '{n++;m=NF;for(i=1;i<=NF;i++){sum[i]+=$i;sumsq[i]+=$i*$i}}END{for(i=1;i<=m;i++){d=sumsq[i]/n-sum[i]*sum[i]/n/n;printf "%.2f %.2f ",sum[i]/n,(d>0?sqrt(d):0)}}'
+  awk '{n++;m=NF;for(i=1;i<=NF;i++){sum[i]+=$i;sumsq[i]+=$i*$i}}END{for(i=1;i<=m;i++){d=sumsq[i]/n-sum[i]*sum[i]/n/n;printf "%.2f %.2f ",sum[i]/n,(d>0?sqrt(d):0.01)}}'
 }
 
 ## Query the virtual memory size for the last invocation of command $1 from
@@ -99,11 +99,14 @@ function measure_runtime {
   local i
 
   echo "$@" >&2
+  if [ "${test_output}" != "" ]; then
+    echo "$@" >"${test_output}"
+  fi
   for ((i=0;i<3;i++))
   do
     echo -n "$("${test_input:-true}" $p | \
       /usr/bin/time --format="%e" "$@" 2>&1 | \
-      tee "${test_output:-/dev/null}" | \
+      tee -a "${test_output:-/dev/null}" | \
       tail -n 1) "
     query_vsz "$@"
   done