From c7dabff3aaab59649fba8dc18ae5dadf0c0b8f20 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 21 Nov 2017 08:34:22 +0200 Subject: Improve skipped update diagnostics Instead of printing a line for each target skipped we now print a summary with count at the end. We also now show the skip count in progress. --- build2/operation.cxx | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'build2/operation.cxx') diff --git a/build2/operation.cxx b/build2/operation.cxx index 09e7b8c..ea1e06e 100644 --- a/build2/operation.cxx +++ b/build2/operation.cxx @@ -268,10 +268,20 @@ namespace build2 [init, incr, what] (size_t c) -> size_t { size_t p ((init - c) * 100 / init); + size_t s (skip_count.load (memory_order_relaxed)); + diag_progress_lock pl; diag_progress = ' '; diag_progress += to_string (p); diag_progress += what; + + if (s != 0) + { + diag_progress += " ("; + diag_progress += to_string (s); + diag_progress += " skipped)"; + } + return c - incr; }); } @@ -302,6 +312,11 @@ namespace build2 wg.wait (); } + // We are now running serially. + // + + sched.tune (0); // Restore original scheduler settings. + // Clear the progress if present. // if (mg) @@ -310,9 +325,19 @@ namespace build2 diag_progress.clear (); } - sched.tune (0); // Restore original scheduler settings. + // Print skip count if not zero. Note that we print it regardless of the + // quiet flag since this is essentially a "summary" of all the commands + // that we did not (and, in fact, used to originally) print. + // + if (verb != 0) + { + if (size_t s = skip_count.load (memory_order_relaxed)) + { + text << "skipped " << diag_doing (a) << ' ' << s << " target(s)"; + } + } - // We are now running serially. Re-examine them all. + // Re-examine all the targets and print diagnostics. // bool fail (false); for (const void* vt: ts) -- cgit v1.1