| 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // Computes pss (proportional set size) of a process. Note that this | 159 // Computes pss (proportional set size) of a process. Note that this |
| 160 // function is somewhat expensive on Windows (a few ms per process). | 160 // function is somewhat expensive on Windows (a few ms per process). |
| 161 bool GetProportionalSetSizeBytes(uint64_t* pss_bytes) const; | 161 bool GetProportionalSetSizeBytes(uint64_t* pss_bytes) const; |
| 162 | 162 |
| 163 #if defined(OS_MACOSX) | 163 #if defined(OS_MACOSX) |
| 164 // Fills both CommitedKBytes and WorkingSetKBytes in a single operation. This | 164 // Fills both CommitedKBytes and WorkingSetKBytes in a single operation. This |
| 165 // is more efficient on Mac OS X, as the two can be retrieved with a single | 165 // is more efficient on Mac OS X, as the two can be retrieved with a single |
| 166 // system call. | 166 // system call. |
| 167 bool GetCommittedAndWorkingSetKBytes(CommittedKBytes* usage, | 167 bool GetCommittedAndWorkingSetKBytes(CommittedKBytes* usage, |
| 168 WorkingSetKBytes* ws_usage) const; | 168 WorkingSetKBytes* ws_usage) const; |
| 169 |
| 170 // Returns the physical footprint, only available on macOS 10.11+. This |
| 171 // measures anonymous, non-discardable memory. Returns 0 on error, or if the |
| 172 // measurement was unavailable. |
| 173 size_t GetPhysicalFootprint() const; |
| 174 |
| 169 // Returns private, shared, and total resident bytes. |locked_bytes| refers to | 175 // Returns private, shared, and total resident bytes. |locked_bytes| refers to |
| 170 // bytes that must stay resident. |locked_bytes| only counts bytes locked by | 176 // bytes that must stay resident. |locked_bytes| only counts bytes locked by |
| 171 // this task, not bytes locked by the kernel. | 177 // this task, not bytes locked by the kernel. |
| 172 bool GetMemoryBytes(size_t* private_bytes, | 178 bool GetMemoryBytes(size_t* private_bytes, |
| 173 size_t* shared_bytes, | 179 size_t* shared_bytes, |
| 174 size_t* resident_bytes, | 180 size_t* resident_bytes, |
| 175 size_t* locked_bytes) const; | 181 size_t* locked_bytes) const; |
| 176 #endif | 182 #endif |
| 177 | 183 |
| 178 // Returns the CPU usage in percent since the last time this method or | 184 // Returns the CPU usage in percent since the last time this method or |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 // |size| and |info| are output parameters, only valid on Success. | 520 // |size| and |info| are output parameters, only valid on Success. |
| 515 BASE_EXPORT MachVMRegionResult GetBasicInfo(mach_port_t task, | 521 BASE_EXPORT MachVMRegionResult GetBasicInfo(mach_port_t task, |
| 516 mach_vm_size_t* size, | 522 mach_vm_size_t* size, |
| 517 mach_vm_address_t* address, | 523 mach_vm_address_t* address, |
| 518 vm_region_basic_info_64* info); | 524 vm_region_basic_info_64* info); |
| 519 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 525 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 520 | 526 |
| 521 } // namespace base | 527 } // namespace base |
| 522 | 528 |
| 523 #endif // BASE_PROCESS_PROCESS_METRICS_H_ | 529 #endif // BASE_PROCESS_PROCESS_METRICS_H_ |
| OLD | NEW |