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

Side by Side Diff: dm/DMReporter.cpp

Issue 445963002: DM: expand peak RAM usage to Mac and Android too. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: bar bar Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "DMReporter.h" 1 #include "DMReporter.h"
2 2
3 #include "SkDynamicAnnotations.h" 3 #include "SkDynamicAnnotations.h"
4 #include "SkCommonFlags.h" 4 #include "SkCommonFlags.h"
5 #include "OverwriteLine.h" 5 #include "OverwriteLine.h"
6 6
7 #ifdef SK_BUILD_FOR_UNIX 7 #if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_ FOR_ANDROID)
8 #include <sys/resource.h> 8 #include <sys/resource.h>
9 static long get_max_rss_kb() { 9 static long get_max_rss_kb() {
10 struct rusage ru; 10 struct rusage ru;
11 getrusage(RUSAGE_SELF, &ru); 11 getrusage(RUSAGE_SELF, &ru);
12 return ru.ru_maxrss; 12 #if defined(SK_BUILD_FOR_MAC)
13 return ru.ru_maxrss / 1024; // Darwin reports bytes.
14 #else
15 return ru.ru_maxrss; // Linux reports kilobytes.
16 #endif
13 } 17 }
14 #else 18 #else
15 static long get_max_rss_kb() { return 0; } 19 static long get_max_rss_kb() { return 0; }
16 #endif 20 #endif
17 21
18 namespace DM { 22 namespace DM {
19 23
20 void Reporter::printStatus(SkString name, SkMSec timeMs) const { 24 void Reporter::printStatus(SkString name, SkMSec timeMs) const {
21 if (FLAGS_quiet) { 25 if (FLAGS_quiet) {
22 return; 26 return;
(...skipping 23 matching lines...) Expand all
46 SkAutoMutexAcquire writer(&fMutex); 50 SkAutoMutexAcquire writer(&fMutex);
47 fFailures.push_back(msg); 51 fFailures.push_back(msg);
48 } 52 }
49 53
50 void Reporter::getFailures(SkTArray<SkString>* failures) const { 54 void Reporter::getFailures(SkTArray<SkString>* failures) const {
51 SkAutoMutexAcquire reader(&fMutex); 55 SkAutoMutexAcquire reader(&fMutex);
52 *failures = fFailures; 56 *failures = fFailures;
53 } 57 }
54 58
55 } // namespace DM 59 } // namespace DM
OLDNEW
« 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