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

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

Issue 2070083002: Add Linux MemAvailable to SystemMemoryInfoKB (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Exclude Android and improve commenting Created 4 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_linux.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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 struct BASE_EXPORT SystemMemoryInfoKB { 265 struct BASE_EXPORT SystemMemoryInfoKB {
266 SystemMemoryInfoKB(); 266 SystemMemoryInfoKB();
267 SystemMemoryInfoKB(const SystemMemoryInfoKB& other); 267 SystemMemoryInfoKB(const SystemMemoryInfoKB& other);
268 268
269 // Serializes the platform specific fields to value. 269 // Serializes the platform specific fields to value.
270 std::unique_ptr<Value> ToValue() const; 270 std::unique_ptr<Value> ToValue() const;
271 271
272 int total; 272 int total;
273 int free; 273 int free;
274 274
275 #if defined(OS_LINUX)
276 // This provides an estimate of available memory as described here:
277 // https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id= 34e431b0ae398fc54ea69ff85ec700722c9da773
278 // NOTE: this is ONLY valid in kernels 3.14 and up. Its value will always
279 // be 0 in earlier kernel versions.
280 int available;
281 #endif
282
275 #if !defined(OS_MACOSX) 283 #if !defined(OS_MACOSX)
276 int swap_total; 284 int swap_total;
277 int swap_free; 285 int swap_free;
278 #endif 286 #endif
279 287
280 #if defined(OS_ANDROID) || defined(OS_LINUX) 288 #if defined(OS_ANDROID) || defined(OS_LINUX)
281 int buffers; 289 int buffers;
282 int cached; 290 int cached;
283 int active_anon; 291 int active_anon;
284 int inactive_anon; 292 int inactive_anon;
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 SystemDiskInfo disk_info_; 423 SystemDiskInfo disk_info_;
416 #endif 424 #endif
417 #if defined(OS_CHROMEOS) 425 #if defined(OS_CHROMEOS)
418 SwapInfo swap_info_; 426 SwapInfo swap_info_;
419 #endif 427 #endif
420 }; 428 };
421 429
422 } // namespace base 430 } // namespace base
423 431
424 #endif // BASE_PROCESS_PROCESS_METRICS_H_ 432 #endif // BASE_PROCESS_PROCESS_METRICS_H_
OLDNEW
« no previous file with comments | « no previous file | base/process/process_metrics_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698