Index: base/process/process_metrics.h |
diff --git a/base/process/process_metrics.h b/base/process/process_metrics.h |
index 5916b94148cb2e6e9a6782096bcca49fd7b8f41a..6bd6aad5da75a4468486964d5787389c8939f16b 100644 |
--- a/base/process/process_metrics.h |
+++ b/base/process/process_metrics.h |
@@ -247,6 +247,14 @@ BASE_EXPORT void SetFdLimit(unsigned int max_descriptors); |
// Exposed for testing. |
BASE_EXPORT int ParseProcStatCPU(const std::string& input); |
+// Extract the sum of the CPU-related ticks from the given |input| which |
+// contains the stats found in /proc/<pid>/stat. Returns -1 on error. |
+// |
+// Use this version instead of the above for faster results. |
+// |
+// Exposed for testing. |
+BASE_EXPORT int GetCpuFromProcStats(const std::string& input); |
danakj
2015/02/03 18:51:09
why are you adding a new method with the same retu
afakhry
2015/02/03 20:23:54
I wanted to keep the old one for reference, but yo
|
+ |
// 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. |