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

Unified Diff: dm/DMReporter.cpp

Issue 448993003: Process Statistics header, add max RSS to render_pdfs (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: compiles on macos and ios 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gyp/apptype_console.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMReporter.cpp
diff --git a/dm/DMReporter.cpp b/dm/DMReporter.cpp
index 14f50871021ea42e811e547fc452b48089c2f300..12bcfac0f3f7f233b5a7ebc780f75813ece9f536 100644
--- a/dm/DMReporter.cpp
+++ b/dm/DMReporter.cpp
@@ -3,21 +3,7 @@
#include "SkDynamicAnnotations.h"
#include "SkCommonFlags.h"
#include "OverwriteLine.h"
-
-#if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_ANDROID)
- #include <sys/resource.h>
- static long get_max_rss_kb() {
- struct rusage ru;
- getrusage(RUSAGE_SELF, &ru);
- #if defined(SK_BUILD_FOR_MAC)
- return ru.ru_maxrss / 1024; // Darwin reports bytes.
- #else
- return ru.ru_maxrss; // Linux reports kilobytes.
- #endif
- }
-#else
- static long get_max_rss_kb() { return 0; }
-#endif
+#include "ProcStats.h"
namespace DM {
@@ -36,8 +22,9 @@ void Reporter::printStatus(SkString name, SkMSec timeMs) const {
status.appendf(", %d failed", failed);
}
if (FLAGS_verbose) {
- if (long max_rss_kb = get_max_rss_kb()) {
- status.appendf("\t%4ldM peak", max_rss_kb / 1024);
+ int max_rss_kb = sk_tools::getMaxResidentSetSizeKB();
+ if (max_rss_kb >= 0) {
+ status.appendf("\t%4dM peak", max_rss_kb / 1024);
}
status.appendf("\t%5dms\t%s", timeMs, name.c_str());
}
« no previous file with comments | « no previous file | gyp/apptype_console.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698