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

Side by Side Diff: dm/DM.cpp

Issue 990723002: DM: display current memory usage (instead of peak) when available. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: better best Created 5 years, 9 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
OLDNEW
1 #include "CrashHandler.h" 1 #include "CrashHandler.h"
2 #include "DMJsonWriter.h" 2 #include "DMJsonWriter.h"
3 #include "DMSrcSink.h" 3 #include "DMSrcSink.h"
4 #include "DMSrcSinkAndroid.h" 4 #include "DMSrcSinkAndroid.h"
5 #include "OverwriteLine.h" 5 #include "OverwriteLine.h"
6 #include "ProcStats.h" 6 #include "ProcStats.h"
7 #include "SkBBHFactory.h" 7 #include "SkBBHFactory.h"
8 #include "SkChecksum.h" 8 #include "SkChecksum.h"
9 #include "SkCommonFlags.h" 9 #include "SkCommonFlags.h"
10 #include "SkForceLinking.h" 10 #include "SkForceLinking.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 static int32_t gPending = 0; // Atomic. 51 static int32_t gPending = 0; // Atomic.
52 52
53 static void done(double ms, 53 static void done(double ms,
54 ImplicitString config, ImplicitString src, ImplicitString name, 54 ImplicitString config, ImplicitString src, ImplicitString name,
55 ImplicitString log) { 55 ImplicitString log) {
56 if (!log.isEmpty()) { 56 if (!log.isEmpty()) {
57 log.prepend("\n"); 57 log.prepend("\n");
58 } 58 }
59 auto pending = sk_atomic_dec(&gPending)-1; 59 auto pending = sk_atomic_dec(&gPending)-1;
60 SkDebugf("%s(%4dMB %5d) %s\t%s %s %s%s", FLAGS_verbose ? "\n" : kSkOverwrite Line 60 SkDebugf("%s(%4dMB %5d) %s\t%s %s %s%s", FLAGS_verbose ? "\n" : kSkOverwrite Line
61 , sk_tools::getMaxResidentSetSizeMB() 61 , sk_tools::getBestResidentSetSizeMB( )
62 , pending 62 , pending
63 , HumanizeMs(ms).c_str() 63 , HumanizeMs(ms).c_str()
64 , config.c_str() 64 , config.c_str()
65 , src.c_str() 65 , src.c_str()
66 , name.c_str() 66 , name.c_str()
67 , log.c_str()); 67 , log.c_str());
68 // We write our dm.json file every once in a while in case we crash. 68 // We write our dm.json file every once in a while in case we crash.
69 // Notice this also handles the final dm.json when pending == 0. 69 // Notice this also handles the final dm.json when pending == 0.
70 if (pending % 500 == 0) { 70 if (pending % 500 == 0) {
71 JsonWriter::DumpJson(); 71 JsonWriter::DumpJson();
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 } 578 }
579 return 0; 579 return 0;
580 } 580 }
581 581
582 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 582 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
583 int main(int argc, char** argv) { 583 int main(int argc, char** argv) {
584 SkCommandLineFlags::Parse(argc, argv); 584 SkCommandLineFlags::Parse(argc, argv);
585 return dm_main(); 585 return dm_main();
586 } 586 }
587 #endif 587 #endif
OLDNEW
« no previous file with comments | « bench/nanobench.cpp ('k') | tools/ProcStats.h » ('j') | tools/ProcStats.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698