diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-18 22:48:19 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-18 22:48:19 +0000 |
commit | 14620b39945285390b90a0d84cae39c677ce18aa (patch) | |
tree | 93b5966947f6c9e04632decdd88d8d480c36b6bd /base/trace_event.cc | |
parent | a8c8b34888746435dfe73ff529aaf3b1d9ace3e3 (diff) | |
download | chromium_src-14620b39945285390b90a0d84cae39c677ce18aa.zip chromium_src-14620b39945285390b90a0d84cae39c677ce18aa.tar.gz chromium_src-14620b39945285390b90a0d84cae39c677ce18aa.tar.bz2 |
Fix cpu/memory measurements on OS X.
Right now, this only works for the current process; support for child processes will be added in a later CL.
BUG=13156,25454
TEST=Hook up task manager (connect menu item to commandDispatch:, give it the right tag). Stats for the browser process should now be right, and %cpu should be 0 (for now) for all other processes.
Review URL: http://codereview.chromium.org/500118
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34994 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/trace_event.cc')
-rw-r--r-- | base/trace_event.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/base/trace_event.cc b/base/trace_event.cc index 13c0c2c..ff834ea 100644 --- a/base/trace_event.cc +++ b/base/trace_event.cc @@ -29,7 +29,14 @@ static const FilePath::CharType* kLogFileName = TraceLog::TraceLog() : enabled_(false), log_file_(NULL) { base::ProcessHandle proc = base::GetCurrentProcessHandle(); +#if !defined(OS_MACOSX) process_metrics_.reset(base::ProcessMetrics::CreateProcessMetrics(proc)); +#else + // The default port provider is sufficient to get data for the current + // process. + process_metrics_.reset(base::ProcessMetrics::CreateProcessMetrics(proc, + NULL)); +#endif } TraceLog::~TraceLog() { |