OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "CrashHandler.h" | 8 #include "CrashHandler.h" |
9 #include "DMJsonWriter.h" | 9 #include "DMJsonWriter.h" |
10 #include "DMSrcSink.h" | 10 #include "DMSrcSink.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 } | 82 } |
83 } | 83 } |
84 } | 84 } |
85 if (!FLAGS_verbose) { | 85 if (!FLAGS_verbose) { |
86 note = ""; | 86 note = ""; |
87 } | 87 } |
88 if (!log.isEmpty()) { | 88 if (!log.isEmpty()) { |
89 log.prepend("\n"); | 89 log.prepend("\n"); |
90 } | 90 } |
91 auto pending = sk_atomic_dec(&gPending)-1; | 91 auto pending = sk_atomic_dec(&gPending)-1; |
92 SkDebugf("%s(%4d/%-4dMB %5d) %s\t%s%s%s", FLAGS_verbose ? "\n" : kSkOverwrit
eLine | 92 if (!FLAGS_quiet) { |
93 , sk_tools::getCurrResidentSetSizeMB() | 93 SkDebugf("%s(%4d/%-4dMB %5d) %s\t%s%s%s", FLAGS_verbose ? "\n" : kSkOver
writeLine |
94 , sk_tools::getMaxResidentSetSizeMB() | 94 , sk_tools::getCurrResidentSetSizeMB(
) |
95 , pending | 95 , sk_tools::getMaxResidentSetSizeMB() |
96 , HumanizeMs(ms).c_str() | 96 , pending |
97 , id.c_str() | 97 , HumanizeMs(ms).c_str() |
98 , note.c_str() | 98 , id.c_str() |
99 , log.c_str()); | 99 , note.c_str() |
| 100 , log.c_str()); |
| 101 } |
100 // We write our dm.json file every once in a while in case we crash. | 102 // We write our dm.json file every once in a while in case we crash. |
101 // Notice this also handles the final dm.json when pending == 0. | 103 // Notice this also handles the final dm.json when pending == 0. |
102 if (pending % 500 == 0) { | 104 if (pending % 500 == 0) { |
103 JsonWriter::DumpJson(); | 105 JsonWriter::DumpJson(); |
104 } | 106 } |
105 } | 107 } |
106 | 108 |
107 static void start(ImplicitString config, ImplicitString src, | 109 static void start(ImplicitString config, ImplicitString src, |
108 ImplicitString srcOptions, ImplicitString name) { | 110 ImplicitString srcOptions, ImplicitString name) { |
109 SkString id = SkStringPrintf("%s %s %s %s", config.c_str(), src.c_str(), | 111 SkString id = SkStringPrintf("%s %s %s %s", config.c_str(), src.c_str(), |
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 } | 760 } |
759 return 0; | 761 return 0; |
760 } | 762 } |
761 | 763 |
762 #if !defined(SK_BUILD_FOR_IOS) | 764 #if !defined(SK_BUILD_FOR_IOS) |
763 int main(int argc, char** argv) { | 765 int main(int argc, char** argv) { |
764 SkCommandLineFlags::Parse(argc, argv); | 766 SkCommandLineFlags::Parse(argc, argv); |
765 return dm_main(); | 767 return dm_main(); |
766 } | 768 } |
767 #endif | 769 #endif |
OLD | NEW |