diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-11 12:45:45 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-11 12:45:45 +0000 |
commit | 796da7c88c4a3e801fc3ed5eb292470f029db9a4 (patch) | |
tree | 69b05c6c0e9810f7548f8c53dfe6a185354c1021 | |
parent | 6233deeca757293ccf93110e470e7f42520f6fd9 (diff) | |
download | chromium_src-796da7c88c4a3e801fc3ed5eb292470f029db9a4.zip chromium_src-796da7c88c4a3e801fc3ed5eb292470f029db9a4.tar.gz chromium_src-796da7c88c4a3e801fc3ed5eb292470f029db9a4.tar.bz2 |
Revert 18159 since it wasn't using all the data it should be.
TEST=none
BUG=none
TBR=mark
Review URL: http://codereview.chromium.org/123016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18160 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/process_util.h | 8 | ||||
-rw-r--r-- | base/process_util_mac.mm | 46 | ||||
-rw-r--r-- | chrome/test/page_cycler/page_cycler_test.cc | 4 |
3 files changed, 11 insertions, 47 deletions
diff --git a/base/process_util.h b/base/process_util.h index 81b6d18..4fe081f 100644 --- a/base/process_util.h +++ b/base/process_util.h @@ -332,13 +332,13 @@ class ProcessMetrics { ~ProcessMetrics(); // Returns the current space allocated for the pagefile, in bytes (these pages - // may or may not be in memory). On Linux and Mac, this returns the total - // virtual memory size of the calling process. + // may or may not be in memory). On Linux, this returns the total virtual + // memory size. size_t GetPagefileUsage() const; // Returns the peak space allocated for the pagefile, in bytes. size_t GetPeakPagefileUsage() const; - // Returns the current working set size, in bytes. On Linux & Mac, this - // returns the resident set size. + // Returns the current working set size, in bytes. On Linux, this returns + // the resident set size. size_t GetWorkingSetSize() const; // Returns the peak working set size, in bytes. size_t GetPeakWorkingSetSize() const; diff --git a/base/process_util_mac.mm b/base/process_util_mac.mm index a55e279..de59896 100644 --- a/base/process_util_mac.mm +++ b/base/process_util_mac.mm @@ -7,9 +7,6 @@ #import <Cocoa/Cocoa.h> #include <crt_externs.h> -#include <mach/shared_memory_server.h> -#include <mach/task_info.h> -#include <mach/task.h> #include <spawn.h> #include <sys/sysctl.h> #include <sys/types.h> @@ -237,29 +234,8 @@ bool ProcessMetrics::GetIOCounters(IoCounters* io_counters) const { } size_t ProcessMetrics::GetPagefileUsage() const { - size_t result = 0; - - kern_return_t kr; - struct task_basic_info info; - mach_msg_type_number_t info_count = TASK_BASIC_INFO_COUNT; - - kr = task_info(mach_task_self(), TASK_BASIC_INFO, - reinterpret_cast<task_info_t>(static_cast<void*>(&info)), - &info_count); - if (kr == KERN_SUCCESS) { - // The app's virtual address map contains lots of shared code that will - // show up as part of our virtual_size. So, in order to reflect a "vsize" - // that is more inline with what Activity Monitor and top report, we need - // to subtract this stuff out. - if (info.virtual_size > (SHARED_TEXT_REGION_SIZE + SHARED_DATA_REGION_SIZE)) - info.virtual_size -= (SHARED_TEXT_REGION_SIZE + SHARED_DATA_REGION_SIZE); - - result = info.virtual_size; - } else { - LOG(ERROR) << "failed to collect the process virtual size"; - } - - return result; + NOTIMPLEMENTED(); + return 0; } size_t ProcessMetrics::GetPeakPagefileUsage() const { @@ -268,22 +244,8 @@ size_t ProcessMetrics::GetPeakPagefileUsage() const { } size_t ProcessMetrics::GetWorkingSetSize() const { - size_t result = 0; - - kern_return_t kr; - struct task_basic_info info; - mach_msg_type_number_t info_count = TASK_BASIC_INFO_COUNT; - - kr = task_info(mach_task_self(), TASK_BASIC_INFO, - reinterpret_cast<task_info_t>(static_cast<void*>(&info)), - &info_count); - if (kr == KERN_SUCCESS) { - result = info.resident_size; - } else { - LOG(ERROR) << "failed to collect the process resident size"; - } - - return result; + NOTIMPLEMENTED(); + return 0; } size_t ProcessMetrics::GetPeakWorkingSetSize() const { diff --git a/chrome/test/page_cycler/page_cycler_test.cc b/chrome/test/page_cycler/page_cycler_test.cc index 4bc49c5..34bafe6 100644 --- a/chrome/test/page_cycler/page_cycler_test.cc +++ b/chrome/test/page_cycler/page_cycler_test.cc @@ -189,7 +189,7 @@ class PageCyclerTest : public UITest { "ws_f" + chrome_name + trace_name, process_metrics->GetWorkingSetSize(), "bytes", false /* not important */); -#else +#elif defined(OS_LINUX) PrintResult("vm_size_final", chrome_name, "vm_size_f" + chrome_name + trace_name, process_metrics->GetPagefileUsage(), "bytes", @@ -198,6 +198,8 @@ class PageCyclerTest : public UITest { "vm_rss_f" + chrome_name + trace_name, process_metrics->GetWorkingSetSize(), "bytes", true /* important */); +#else + NOTIMPLEMENTED(); #endif base::CloseProcessHandle(process_handle); } |