about summary refs log tree commit diff
path: root/benchtests
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2013-04-15 13:52:26 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2013-04-15 13:53:35 +0530
commit206a6699116215c591c8562c67106f7e17146608 (patch)
tree17edd62cc928c0f362ec36cefb86b584536195b3 /benchtests
parent0582f6b3d6fab2128ee43a06250571922ee7c1e3 (diff)
downloadglibc-206a6699116215c591c8562c67106f7e17146608.tar.gz
glibc-206a6699116215c591c8562c67106f7e17146608.tar.xz
glibc-206a6699116215c591c8562c67106f7e17146608.zip
Write to bench.out-tmp only once
Appending benchmark program output on every run could result in a case
where the benchmark run was cancelled, resulting in a partially
written file.  This file gets used again on the next run, resulting in
results being appended to old results.

It could have been possible to remove the file before every benchmark
run, but it is easier to just write the output to bench.out-tmp only
once.
Diffstat (limited to 'benchtests')
-rw-r--r--benchtests/Makefile8
1 files changed, 4 insertions, 4 deletions
diff --git a/benchtests/Makefile b/benchtests/Makefile
index 3e794d798e..bd0925b926 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -121,10 +121,10 @@ run-bench = $(test-wrapper-env) \
 	    $($*-ENV) $(rtld-prefix) $${run}
 
 bench: $(binaries-bench)
-	for run in $^; do \
-	  echo "Running $${run}"; \
-	  $(run-bench) >>  $(objpfx)bench.out-tmp; \
-	done; \
+	{ for run in $^; do \
+	  echo "Running $${run}" >&2; \
+	  $(run-bench); \
+	done; } > $(objpfx)bench.out-tmp; \
 	if [ -f $(objpfx)bench.out ]; then \
 	  mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \
 	fi; \