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] Update bench.out and bench.out.old only upon completion


Hi,

Another tweak to the benchmark make rules.  This patch modifies the
rule to write output from the currently running benchmark into a
temporary file and move files around only once the current run is
complete.  That way we don't lose data from the last two runs due to
an incomplete run.  OK to commit?

Siddhesh

	* Rules (bench): Move bench.out after the run is complete.

diff --git a/Rules b/Rules
index 6973261..282af60 100644
--- a/Rules
+++ b/Rules
@@ -197,13 +197,14 @@ run-bench = $(test-wrapper-env) \
 	    $($*-ENV) $(run-via-rtld-prefix) $${run}
 
 bench: $(binaries-bench)
-	if [ -f $(objpfx)bench.out ]; then \
-	  mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \
-	fi
 	for run in $^; do \
 	  echo "Running $${run}"; \
-	  eval $(run-bench) >>  $(objpfx)bench.out; \
-	done
+	  eval $(run-bench) >>  $(objpfx)bench.out-tmp; \
+	done; \
+	if [ -f $(objpfx)bench.out ]; then \
+	  mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \
+	fi; \
+	mv -f $(objpfx)bench.out-tmp $(objpfx)bench.out
 
 $(binaries-bench): %: %.o \
   $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \


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