OLD | NEW |
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // Returns private and sharedusage, in bytes. Private bytes is the amount of | 133 // Returns private and sharedusage, in bytes. Private bytes is the amount of |
134 // memory currently allocated to a process that cannot be shared. Returns | 134 // memory currently allocated to a process that cannot be shared. Returns |
135 // false on platform specific error conditions. Note: |private_bytes| | 135 // false on platform specific error conditions. Note: |private_bytes| |
136 // returns 0 on unsupported OSes: prior to XP SP2. | 136 // returns 0 on unsupported OSes: prior to XP SP2. |
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. |
144 // function is somewhat expensive on Windows (a few ms per process). | |
145 bool GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const; | 144 bool GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const; |
146 | 145 |
147 #if defined(OS_MACOSX) | 146 #if defined(OS_MACOSX) |
148 // Fills both CommitedKBytes and WorkingSetKBytes in a single operation. This | 147 // 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 | 148 // is more efficient on Mac OS X, as the two can be retrieved with a single |
150 // system call. | 149 // system call. |
151 bool GetCommittedAndWorkingSetKBytes(CommittedKBytes* usage, | 150 bool GetCommittedAndWorkingSetKBytes(CommittedKBytes* usage, |
152 WorkingSetKBytes* ws_usage) const; | 151 WorkingSetKBytes* ws_usage) const; |
153 #endif | 152 #endif |
154 | 153 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 SystemDiskInfo disk_info_; | 383 SystemDiskInfo disk_info_; |
385 #endif | 384 #endif |
386 #if defined(OS_CHROMEOS) | 385 #if defined(OS_CHROMEOS) |
387 SwapInfo swap_info_; | 386 SwapInfo swap_info_; |
388 #endif | 387 #endif |
389 }; | 388 }; |
390 | 389 |
391 } // namespace base | 390 } // namespace base |
392 | 391 |
393 #endif // BASE_PROCESS_PROCESS_METRICS_H_ | 392 #endif // BASE_PROCESS_PROCESS_METRICS_H_ |
OLD | NEW |