From e9d91d96d6532f6b5f830f08975c7a24a09d9d48 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 10 Jul 2008 13:57:56 +0000 Subject: [PATCH] Changed minimum time measurement error from 0.00 to 0.01. Command line arguments are now saved to the output file. And the output of all three runs is now present in the output file, not only the output of the last run. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@8415 --- drd/scripts/measurement-functions | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drd/scripts/measurement-functions b/drd/scripts/measurement-functions index f03534b66f..1964d125d1 100644 --- a/drd/scripts/measurement-functions +++ b/drd/scripts/measurement-functions @@ -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 -- 2.47.2