diff options
-rw-r--r-- | bench/nanobench.cpp | 6 | ||||
-rw-r--r-- | dm/DMReporter.cpp | 6 | ||||
-rw-r--r-- | gm/gmmain.cpp | 6 | ||||
-rw-r--r-- | gyp/bench.gyp | 1 | ||||
-rw-r--r-- | gyp/dm.gypi | 2 | ||||
-rw-r--r-- | gyp/gm.gyp | 1 | ||||
-rw-r--r-- | gyp/tools.gyp | 4 | ||||
-rw-r--r-- | tools/ProcStats.cpp | 8 | ||||
-rw-r--r-- | tools/ProcStats.h | 2 | ||||
-rw-r--r-- | tools/render_pdfs_main.cpp | 6 |
10 files changed, 24 insertions, 18 deletions
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp index a1fea22a85..507507bd0a 100644 --- a/bench/nanobench.cpp +++ b/bench/nanobench.cpp @@ -10,6 +10,7 @@ #include "Benchmark.h" #include "CrashHandler.h" #include "GMBench.h" +#include "ProcStats.h" #include "ResultsWriter.h" #include "SKPBench.h" #include "Stats.h" @@ -590,7 +591,7 @@ int nanobench_main() { } else if (FLAGS_quiet) { SkDebugf("median\tbench\tconfig\n"); } else { - SkDebugf("loops\tmin\tmedian\tmean\tmax\tstddev\tsamples\tconfig\tbench\n"); + SkDebugf("maxrss\tloops\tmin\tmedian\tmean\tmax\tstddev\tsamples\tconfig\tbench\n"); } SkTDArray<Config> configs; @@ -673,7 +674,8 @@ int nanobench_main() { SkDebugf("%s\t%s\t%s\n", HUMANIZE(stats.median), bench->getName(), config); } else { const double stddev_percent = 100 * sqrt(stats.var) / stats.mean; - SkDebugf("%d\t%s\t%s\t%s\t%s\t%.0f%%\t%s\t%s\t%s\n" + SkDebugf("%4dM\t%d\t%s\t%s\t%s\t%s\t%.0f%%\t%s\t%s\t%s\n" + , sk_tools::getMaxResidentSetSizeMB() , loops , HUMANIZE(stats.min) , HUMANIZE(stats.median) diff --git a/dm/DMReporter.cpp b/dm/DMReporter.cpp index 12bcfac0f3..7b2cea8136 100644 --- a/dm/DMReporter.cpp +++ b/dm/DMReporter.cpp @@ -22,9 +22,9 @@ void Reporter::printStatus(SkString name, SkMSec timeMs) const { status.appendf(", %d failed", failed); } if (FLAGS_verbose) { - int max_rss_kb = sk_tools::getMaxResidentSetSizeKB(); - if (max_rss_kb >= 0) { - status.appendf("\t%4dM peak", max_rss_kb / 1024); + int max_rss_mb = sk_tools::getMaxResidentSetSizeMB(); + if (max_rss_mb >= 0) { + status.appendf("\t%4dM peak", max_rss_mb); } status.appendf("\t%5dms\t%s", timeMs, name.c_str()); } diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index 7f012bc79c..674cab9dc0 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -18,6 +18,7 @@ #include "gm_expectations.h" #include "system_preferences.h" #include "CrashHandler.h" +#include "ProcStats.h" #include "Resources.h" #include "SamplePipeControllers.h" #include "SkBitmap.h" @@ -2386,10 +2387,11 @@ int tool_main(int argc, char** argv) { gmsRun++; SkISize size = gm->getISize(); - SkDebugf("%sdrawing... %s [%d %d]\n", moduloStr.c_str(), shortName, + SkDebugf("%4dM %sdrawing... %s [%d %d]\n", + sk_tools::getMaxResidentSetSizeMB(), moduloStr.c_str(), shortName, size.width(), size.height()); if (!FLAGS_dryRun) - run_multiple_configs(gmmain, gm, configs, pdfRasterizers, tileGridReplayScales, + run_multiple_configs(gmmain, gm, configs, pdfRasterizers, tileGridReplayScales, grFactory, gpuAPI); } diff --git a/gyp/bench.gyp b/gyp/bench.gyp index 398700f5ea..d53e0f7ac6 100644 --- a/gyp/bench.gyp +++ b/gyp/bench.gyp @@ -24,6 +24,7 @@ 'jsoncpp.gyp:jsoncpp', 'skia_lib.gyp:skia_lib', 'tools.gyp:crash_handler', + 'tools.gyp:proc_stats', 'tools.gyp:timer', ], }, diff --git a/gyp/dm.gypi b/gyp/dm.gypi index 238c153099..1ecccd82b2 100644 --- a/gyp/dm.gypi +++ b/gyp/dm.gypi @@ -19,7 +19,7 @@ 'jsoncpp.gyp:jsoncpp', 'skia_lib.gyp:skia_lib', 'tools.gyp:crash_handler', - 'tools.gyp:sk_tool_proc_stats', + 'tools.gyp:proc_stats', 'tools.gyp:sk_tool_utils', ], 'includes': [ diff --git a/gyp/gm.gyp b/gyp/gm.gyp index a11fde5368..658a0677c3 100644 --- a/gyp/gm.gyp +++ b/gyp/gm.gyp @@ -33,6 +33,7 @@ 'skia_lib.gyp:skia_lib', 'tools.gyp:crash_handler', 'tools.gyp:gm_expectations', + 'tools.gyp:proc_stats', 'tools.gyp:resources', 'tools.gyp:sk_tool_utils', ], diff --git a/gyp/tools.gyp b/gyp/tools.gyp index 1766a0975f..d02aaca99c 100644 --- a/gyp/tools.gyp +++ b/gyp/tools.gyp @@ -530,7 +530,7 @@ 'pdf.gyp:pdf', 'skia_lib.gyp:skia_lib', 'tools.gyp:picture_utils', - 'tools.gyp:sk_tool_proc_stats', + 'tools.gyp:proc_stats', ], 'conditions': [ ['skia_win_debuggers_path and skia_os == "win"', @@ -648,7 +648,7 @@ ], }, { - 'target_name': 'sk_tool_proc_stats', + 'target_name': 'proc_stats', 'type': 'static_library', 'sources': [ '../tools/ProcStats.h', diff --git a/tools/ProcStats.cpp b/tools/ProcStats.cpp index 94660394f8..eaa1379301 100644 --- a/tools/ProcStats.cpp +++ b/tools/ProcStats.cpp @@ -12,19 +12,19 @@ defined(SK_BUILD_FOR_ANDROID) #include <sys/resource.h> - int sk_tools::getMaxResidentSetSizeKB() { + int sk_tools::getMaxResidentSetSizeMB() { struct rusage ru; getrusage(RUSAGE_SELF, &ru); #if defined(SK_BUILD_FOR_MAC) - return static_cast<int>(ru.ru_maxrss / 1024); // Darwin reports bytes. + return static_cast<int>(ru.ru_maxrss / 1024 / 1024); // Darwin reports bytes. #else - return static_cast<int>(ru.ru_maxrss); // Linux reports kilobytes. + return static_cast<int>(ru.ru_maxrss / 1024); // Linux reports kilobytes. #endif } #else - int sk_tools::getMaxResidentSetSizeKB() { + int sk_tools::getMaxResidentSetSizeMB() { return -1; } diff --git a/tools/ProcStats.h b/tools/ProcStats.h index 42849f1401..14b98b7a28 100644 --- a/tools/ProcStats.h +++ b/tools/ProcStats.h @@ -18,7 +18,7 @@ namespace sk_tools { * If not implemented for this OS, returns -1. Otherwise, return * the maximum resident set size, as reported by getrusage(). */ -int getMaxResidentSetSizeKB(); +int getMaxResidentSetSizeMB(); } // namespace sk_tools diff --git a/tools/render_pdfs_main.cpp b/tools/render_pdfs_main.cpp index a1bd62d4f4..8e791d9608 100644 --- a/tools/render_pdfs_main.cpp +++ b/tools/render_pdfs_main.cpp @@ -268,9 +268,9 @@ int tool_main_core(int argc, char** argv) { ++failures; } - int max_rss_kb = sk_tools::getMaxResidentSetSizeKB(); - if (max_rss_kb >= 0) { - SkDebugf(" %4dM peak rss", max_rss_kb / 1024); + int max_rss_mb = sk_tools::getMaxResidentSetSizeMB(); + if (max_rss_mb >= 0) { + SkDebugf(" %4dM peak rss", max_rss_mb); } SkDebugf("\n"); |