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

Unified Diff: base/process/process_metrics.h

Issue 1384363002: [NOT TO COMMIT YET] Using proc/pid/status file contents to get process metrics in linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@smaps_fscan
Patch Set: Fixes. Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/process/process_metrics_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_metrics.h
diff --git a/base/process/process_metrics.h b/base/process/process_metrics.h
index 54b10aaacfa2f5cfb0ab3ffc702fbc226435c325..4dd2eb3de0ffd5acef38cf70561f6cfedd95dd9e 100644
--- a/base/process/process_metrics.h
+++ b/base/process/process_metrics.h
@@ -307,6 +307,14 @@ BASE_EXPORT bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo);
// Exposed for testing.
BASE_EXPORT int ParseProcStatCPU(const std::string& input);
+// Parses the /proc/<pid>/status file contents passed and sets |value| to the
+// size in bytes corresponding to the |field|. Only works for fields in the form
+// of "Field: value kB". Returns true on success.
+BASE_EXPORT bool ParseProcStatusAndGetField(
+ const base::StringPiece& proc_status_contents,
+ const std::string& field,
+ size_t* value);
+
// Get the number of threads of |process| as available in /proc/<pid>/stat.
// This should be used with care as no synchronization with running threads is
// done. This is mostly useful to guarantee being single-threaded.
« 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