| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // Computes pss (proportional set size) of a process. Note that this | 155 // Computes pss (proportional set size) of a process. Note that this |
| 156 // function is somewhat expensive on Windows (a few ms per process). | 156 // function is somewhat expensive on Windows (a few ms per process). |
| 157 bool GetProportionalSetSizeBytes(uint64_t* pss_bytes) const; | 157 bool GetProportionalSetSizeBytes(uint64_t* pss_bytes) const; |
| 158 | 158 |
| 159 #if defined(OS_MACOSX) | 159 #if defined(OS_MACOSX) |
| 160 // Fills both CommitedKBytes and WorkingSetKBytes in a single operation. This | 160 // Fills both CommitedKBytes and WorkingSetKBytes in a single operation. This |
| 161 // is more efficient on Mac OS X, as the two can be retrieved with a single | 161 // is more efficient on Mac OS X, as the two can be retrieved with a single |
| 162 // system call. | 162 // system call. |
| 163 bool GetCommittedAndWorkingSetKBytes(CommittedKBytes* usage, | 163 bool GetCommittedAndWorkingSetKBytes(CommittedKBytes* usage, |
| 164 WorkingSetKBytes* ws_usage) const; | 164 WorkingSetKBytes* ws_usage) const; |
| 165 |
| 166 // Returns the physical footprint, only available on macOS 10.11+. This |
| 167 // measures anonymous, non-discardable memory. Returns 0 on error, or if the |
| 168 // measurement was unavailable. |
| 169 size_t GetPhysicalFootprint() const; |
| 170 |
| 165 // Returns private, shared, and total resident bytes. |locked_bytes| refers to | 171 // Returns private, shared, and total resident bytes. |locked_bytes| refers to |
| 166 // bytes that must stay resident. |locked_bytes| only counts bytes locked by | 172 // bytes that must stay resident. |locked_bytes| only counts bytes locked by |
| 167 // this task, not bytes locked by the kernel. | 173 // this task, not bytes locked by the kernel. |
| 168 bool GetMemoryBytes(size_t* private_bytes, | 174 bool GetMemoryBytes(size_t* private_bytes, |
| 169 size_t* shared_bytes, | 175 size_t* shared_bytes, |
| 170 size_t* resident_bytes, | 176 size_t* resident_bytes, |
| 171 size_t* locked_bytes) const; | 177 size_t* locked_bytes) const; |
| 172 #endif | 178 #endif |
| 173 | 179 |
| 174 // Returns the CPU usage in percent since the last time this method or | 180 // Returns the CPU usage in percent since the last time this method or |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 SystemDiskInfo disk_info_; | 480 SystemDiskInfo disk_info_; |
| 475 #endif | 481 #endif |
| 476 #if defined(OS_CHROMEOS) | 482 #if defined(OS_CHROMEOS) |
| 477 SwapInfo swap_info_; | 483 SwapInfo swap_info_; |
| 478 #endif | 484 #endif |
| 479 }; | 485 }; |
| 480 | 486 |
| 481 } // namespace base | 487 } // namespace base |
| 482 | 488 |
| 483 #endif // BASE_PROCESS_PROCESS_METRICS_H_ | 489 #endif // BASE_PROCESS_PROCESS_METRICS_H_ |
| OLD | NEW |