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

Side by Side Diff: dm/DMReporter.cpp

Issue 788243008: Sketch DM refactor. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: better failure messages, disable a few things temporarily to try to go green 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 unified diff | Download patch
« no previous file with comments | « dm/DMReporter.h ('k') | dm/DMSKPTask.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include "DMReporter.h"
2
3 #include "SkDynamicAnnotations.h"
4 #include "SkCommonFlags.h"
5 #include "OverwriteLine.h"
6 #include "ProcStats.h"
7
8 namespace DM {
9
10 void Reporter::printStatus(SkString name, SkMSec timeMs) const {
11 if (FLAGS_quiet) {
12 return;
13 }
14
15 // It's okay if these are a little off---they're just for show---so we can r ead unprotectedly.
16 const int32_t failed = SK_ANNOTATE_UNPROTECTED_READ(fFailed);
17 const int32_t pending = SK_ANNOTATE_UNPROTECTED_READ(fPending) - 1;
18
19 SkString status;
20 status.printf("%s%d tasks left", FLAGS_verbose ? "\n" : kSkOverwriteLine, pe nding);
21 if (failed > 0) {
22 status.appendf(", %d failed", failed);
23 }
24 if (FLAGS_verbose) {
25 int max_rss_mb = sk_tools::getMaxResidentSetSizeMB();
26 if (max_rss_mb >= 0) {
27 status.appendf("\t%4dM peak", max_rss_mb);
28 }
29 status.appendf("\t%5dms\t%s", timeMs, name.c_str());
30 }
31 SkDebugf("%s", status.c_str());
32 }
33
34 void Reporter::fail(SkString msg) {
35 sk_atomic_inc(&fFailed);
36
37 SkAutoMutexAcquire writer(&fMutex);
38 fFailures.push_back(msg);
39 }
40
41 void Reporter::getFailures(SkTArray<SkString>* failures) const {
42 SkAutoMutexAcquire reader(&fMutex);
43 *failures = fFailures;
44 }
45
46 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMReporter.h ('k') | dm/DMSKPTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698