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

Side by Side Diff: base/process/process_metrics.h

Issue 1384363002: [NOT TO COMMIT YET] Using proc/pid/status file contents to get process metrics in linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@smaps_fscan
Patch Set: Renames and fixes. Created 5 years, 2 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains routines for gathering resource statistics for processes 5 // This file contains routines for gathering resource statistics for processes
6 // running on the system. 6 // running on the system.
7 7
8 #ifndef BASE_PROCESS_PROCESS_METRICS_H_ 8 #ifndef BASE_PROCESS_PROCESS_METRICS_H_
9 #define BASE_PROCESS_PROCESS_METRICS_H_ 9 #define BASE_PROCESS_PROCESS_METRICS_H_
10 10
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 bool GetMemoryBytes(size_t* private_bytes, 137 bool GetMemoryBytes(size_t* private_bytes,
138 size_t* shared_bytes); 138 size_t* shared_bytes);
139 // Fills a CommittedKBytes with both resident and paged 139 // Fills a CommittedKBytes with both resident and paged
140 // memory usage as per definition of CommittedBytes. 140 // memory usage as per definition of CommittedBytes.
141 void GetCommittedKBytes(CommittedKBytes* usage) const; 141 void GetCommittedKBytes(CommittedKBytes* usage) const;
142 // Fills a WorkingSetKBytes containing resident private and shared memory 142 // Fills a WorkingSetKBytes containing resident private and shared memory
143 // usage in bytes, as per definition of WorkingSetBytes. Note that this 143 // usage in bytes, as per definition of WorkingSetBytes. Note that this
144 // function is somewhat expensive on Windows (a few ms per process). 144 // function is somewhat expensive on Windows (a few ms per process).
145 bool GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const; 145 bool GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const;
146 146
147 #if defined(OS_LINUX) || defined(OS_ANDROID)
148 // Returns the current and the peak resident set size on passing a file
149 // descriptor to "proc/<pid>/status" file:
150 size_t GetWorkingSetSize(int proc_status_fd) const;
151 size_t GetPeakWorkingSetSize(int proc_status_fd) const;
152 #endif
153
147 #if defined(OS_MACOSX) 154 #if defined(OS_MACOSX)
148 // Fills both CommitedKBytes and WorkingSetKBytes in a single operation. This 155 // Fills both CommitedKBytes and WorkingSetKBytes in a single operation. This
149 // is more efficient on Mac OS X, as the two can be retrieved with a single 156 // is more efficient on Mac OS X, as the two can be retrieved with a single
150 // system call. 157 // system call.
151 bool GetCommittedAndWorkingSetKBytes(CommittedKBytes* usage, 158 bool GetCommittedAndWorkingSetKBytes(CommittedKBytes* usage,
152 WorkingSetKBytes* ws_usage) const; 159 WorkingSetKBytes* ws_usage) const;
153 #endif 160 #endif
154 161
155 // Returns the CPU usage in percent since the last time this method or 162 // Returns the CPU usage in percent since the last time this method or
156 // GetPlatformIndependentCPUUsage() was called. The first time this method 163 // GetPlatformIndependentCPUUsage() was called. The first time this method
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 SystemDiskInfo disk_info_; 410 SystemDiskInfo disk_info_;
404 #endif 411 #endif
405 #if defined(OS_CHROMEOS) 412 #if defined(OS_CHROMEOS)
406 SwapInfo swap_info_; 413 SwapInfo swap_info_;
407 #endif 414 #endif
408 }; 415 };
409 416
410 } // namespace base 417 } // namespace base
411 418
412 #endif // BASE_PROCESS_PROCESS_METRICS_H_ 419 #endif // BASE_PROCESS_PROCESS_METRICS_H_
OLDNEW
« no previous file with comments | « no previous file | base/process/process_metrics_linux.cc » ('j') | base/process/process_metrics_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698