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

Unified Diff: tools/telemetry/telemetry/core/platform/cros_platform_backend.py

Issue 23902020: Implement cpu_stats for cros backend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/core/platform/cros_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/cros_platform_backend.py b/tools/telemetry/telemetry/core/platform/cros_platform_backend.py
index af2312f6525d4e321f0d104c00d08a91196e9c6b..62e37875d25eff0380e5c7889392e7c2f491a847 100644
--- a/tools/telemetry/telemetry/core/platform/cros_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/cros_platform_backend.py
@@ -40,6 +40,14 @@ class CrosPlatformBackend(platform_backend.PlatformBackend):
meminfo_contents = self._GetFileContents('/proc/meminfo')
return proc_util.GetSystemCommitCharge(meminfo_contents)
+ def GetCpuStats(self, pid):
+ stats = self._GetFileContents('/proc/%s/stat' % pid).split()
+ return proc_util.GetCpuStats(stats)
+
+ def GetCpuTimestamp(self):
+ timer_list = self._GetFileContents('/proc/timer_list')
+ return proc_util.GetTimestampJiffies(timer_list)
+
def GetMemoryStats(self, pid):
status = self._GetFileContents('/proc/%s/status' % pid)
stats = self._GetFileContents('/proc/%s/stat' % pid).split()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698