| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 bool GetIOCounters(IoCounters* io_counters) const; | 216 bool GetIOCounters(IoCounters* io_counters) const; |
| 217 | 217 |
| 218 #if defined(OS_LINUX) | 218 #if defined(OS_LINUX) |
| 219 // Returns the number of file descriptors currently open by the process, or | 219 // Returns the number of file descriptors currently open by the process, or |
| 220 // -1 on error. | 220 // -1 on error. |
| 221 int GetOpenFdCount() const; | 221 int GetOpenFdCount() const; |
| 222 | 222 |
| 223 // Returns the soft limit of file descriptors that can be opened by the | 223 // Returns the soft limit of file descriptors that can be opened by the |
| 224 // process, or -1 on error. | 224 // process, or -1 on error. |
| 225 int GetOpenFdSoftLimit() const; | 225 int GetOpenFdSoftLimit() const; |
| 226 |
| 227 uint64_t GetVmSwapBytes() const; |
| 228 uint64_t GetRssAnonBytes() const; |
| 226 #endif // defined(OS_LINUX) | 229 #endif // defined(OS_LINUX) |
| 227 | 230 |
| 228 private: | 231 private: |
| 229 #if !defined(OS_MACOSX) || defined(OS_IOS) | 232 #if !defined(OS_MACOSX) || defined(OS_IOS) |
| 230 explicit ProcessMetrics(ProcessHandle process); | 233 explicit ProcessMetrics(ProcessHandle process); |
| 231 #else | 234 #else |
| 232 ProcessMetrics(ProcessHandle process, PortProvider* port_provider); | 235 ProcessMetrics(ProcessHandle process, PortProvider* port_provider); |
| 233 #endif // !defined(OS_MACOSX) || defined(OS_IOS) | 236 #endif // !defined(OS_MACOSX) || defined(OS_IOS) |
| 234 | 237 |
| 235 #if defined(OS_LINUX) || defined(OS_ANDROID) | 238 #if defined(OS_LINUX) || defined(OS_ANDROID) |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 // |size| and |info| are output parameters, only valid on Success. | 533 // |size| and |info| are output parameters, only valid on Success. |
| 531 BASE_EXPORT MachVMRegionResult GetBasicInfo(mach_port_t task, | 534 BASE_EXPORT MachVMRegionResult GetBasicInfo(mach_port_t task, |
| 532 mach_vm_size_t* size, | 535 mach_vm_size_t* size, |
| 533 mach_vm_address_t* address, | 536 mach_vm_address_t* address, |
| 534 vm_region_basic_info_64* info); | 537 vm_region_basic_info_64* info); |
| 535 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 538 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 536 | 539 |
| 537 } // namespace base | 540 } // namespace base |
| 538 | 541 |
| 539 #endif // BASE_PROCESS_PROCESS_METRICS_H_ | 542 #endif // BASE_PROCESS_PROCESS_METRICS_H_ |
| OLD | NEW |