This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Write to bench.out-tmp only once


Hi,

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.

OK to commit?

Siddhesh

	* benchtests/Makefile (bench): Write all output to
	bench-out.tmp together.

diff --git a/benchtests/Makefile b/benchtests/Makefile
index d330abb..965eceb 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -125,10 +125,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; \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]