]> sourceware.org Git - glibc.git/commitdiff
Update bench.out and bench.out.old only upon completion
authorSiddhesh Poyarekar <siddhesh@redhat.com>
Wed, 3 Apr 2013 08:50:56 +0000 (14:20 +0530)
committerSiddhesh Poyarekar <siddhesh@redhat.com>
Wed, 3 Apr 2013 10:22:16 +0000 (15:52 +0530)
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.

ChangeLog
Rules

index bb6fc28ac8c9d2517fe75993252c8598c624cc09..78a0fa36d062bbbdab8208ea076e00406a5070d1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2013-04-03  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
+       * Rules (bench): Move bench.out after the run is complete.
+
        * Rules (bench): Echo currently running benchmark.
 
        * benchtests/Makefile (bench): Add atan and slowatan.
diff --git a/Rules b/Rules
index 9ad1d1112709a7594317a7e1ab133e94a8c026ab..d4a0027dd69717b8035a18e2f21d796902501fb2 100644 (file)
--- 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))) \
This page took 0.116573 seconds and 5 git commands to generate.