Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2602)

Unified Diff: dm/DM.cpp

Issue 872443003: Write dm.json periodically instead of only once at the end. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DM.cpp
diff --git a/dm/DM.cpp b/dm/DM.cpp
index d4991ef312d0999d77ecbf12edc3675c78944081..708d8558f33fb28c63c1e76a3776b0861200ab9f 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -45,13 +45,19 @@ static void fail(ImplicitString err) {
static int32_t gPending = 0; // Atomic.
static void done(double ms, ImplicitString config, ImplicitString src, ImplicitString name) {
+ int32_t pending = sk_atomic_dec(&gPending)-1;
SkDebugf("%s(%4dMB %5d) %s\t%s %s %s ", FLAGS_verbose ? "\n" : kSkOverwriteLine
, sk_tools::getMaxResidentSetSizeMB()
- , sk_atomic_dec(&gPending)-1
+ , pending
, HumanizeMs(ms).c_str()
, config.c_str()
, src.c_str()
, name.c_str());
+ // We write our dm.json file every once in a while in case we crash.
+ // Notice this also handles the final dm.json when pending == 0.
+ if (pending % 500 == 0) {
+ JsonWriter::DumpJson();
+ }
}
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
@@ -450,8 +456,6 @@ int dm_main() {
// At this point we're back in single-threaded land.
SkDebugf("\n");
- JsonWriter::DumpJson();
-
if (gFailures.count() > 0) {
SkDebugf("Failures:\n");
for (int i = 0; i < gFailures.count(); i++) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698