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

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

Issue 2925073002: Move malloc/partition_alloc memory usage functions to base (Closed)
Patch Set: Moved to ProcessMetrics method, etc Created 3 years, 6 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
« no previous file with comments | « no previous file | base/process/process_metrics_posix.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 #endif // defined(OS_LINUX) || defined(OS_AIX) 226 #endif // defined(OS_LINUX) || defined(OS_AIX)
227 227
228 #if defined(OS_LINUX) || defined(OS_ANDROID) 228 #if defined(OS_LINUX) || defined(OS_ANDROID)
229 // Bytes of swap as reported by /proc/[pid]/status. 229 // Bytes of swap as reported by /proc/[pid]/status.
230 uint64_t GetVmSwapBytes() const; 230 uint64_t GetVmSwapBytes() const;
231 #endif // defined(OS_LINUX) || defined(OS_ANDROID) 231 #endif // defined(OS_LINUX) || defined(OS_ANDROID)
232 232
233 // Returns total memory usage of malloc.
234 size_t GetMallocUsage();
235
233 private: 236 private:
234 #if !defined(OS_MACOSX) || defined(OS_IOS) 237 #if !defined(OS_MACOSX) || defined(OS_IOS)
235 explicit ProcessMetrics(ProcessHandle process); 238 explicit ProcessMetrics(ProcessHandle process);
236 #else 239 #else
237 ProcessMetrics(ProcessHandle process, PortProvider* port_provider); 240 ProcessMetrics(ProcessHandle process, PortProvider* port_provider);
238 #endif // !defined(OS_MACOSX) || defined(OS_IOS) 241 #endif // !defined(OS_MACOSX) || defined(OS_IOS)
239 242
240 #if defined(OS_LINUX) || defined(OS_ANDROID) | defined(OS_AIX) 243 #if defined(OS_LINUX) || defined(OS_ANDROID) | defined(OS_AIX)
241 bool GetWorkingSetKBytesStatm(WorkingSetKBytes* ws_usage) const; 244 bool GetWorkingSetKBytesStatm(WorkingSetKBytes* ws_usage) const;
242 #endif 245 #endif
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 // |size| and |info| are output parameters, only valid on Success. 542 // |size| and |info| are output parameters, only valid on Success.
540 BASE_EXPORT MachVMRegionResult GetBasicInfo(mach_port_t task, 543 BASE_EXPORT MachVMRegionResult GetBasicInfo(mach_port_t task,
541 mach_vm_size_t* size, 544 mach_vm_size_t* size,
542 mach_vm_address_t* address, 545 mach_vm_address_t* address,
543 vm_region_basic_info_64* info); 546 vm_region_basic_info_64* info);
544 #endif // defined(OS_MACOSX) && !defined(OS_IOS) 547 #endif // defined(OS_MACOSX) && !defined(OS_IOS)
545 548
546 } // namespace base 549 } // namespace base
547 550
548 #endif // BASE_PROCESS_PROCESS_METRICS_H_ 551 #endif // BASE_PROCESS_PROCESS_METRICS_H_
OLDNEW
« no previous file with comments | « no previous file | base/process/process_metrics_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698