aboutsummaryrefslogtreecommitdiff
path: root/build2/operation.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-11-21 08:34:22 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-11-21 08:34:22 +0200
commitc7dabff3aaab59649fba8dc18ae5dadf0c0b8f20 (patch)
tree77a5a41ce83b4534690be24b3ab7945f3434fb6c /build2/operation.cxx
parenta3bb87987bf152eaa63cc0ffda475ebd33247763 (diff)
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.
Diffstat (limited to 'build2/operation.cxx')
-rw-r--r--build2/operation.cxx29
1 files changed, 27 insertions, 2 deletions
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)