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

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

Issue 20766003: [Telemetry] Add the ability to flush the system file cache to platform. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simpler Android support Created 7 years, 5 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
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 68ecc34a4ad816f469dbd3112603b7cdd5bf7869..3c0a25c70693fa599bd2d9506f918f5ae95e640b 100644
--- a/tools/telemetry/telemetry/core/platform/cros_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/cros_platform_backend.py
@@ -2,10 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-from telemetry.core.platform import linux_platform_backend
+from telemetry.core.platform import platform_backend
+from telemetry.core.platform import proc_util
-class CrosPlatformBackend(linux_platform_backend.LinuxPlatformBackend):
+class CrosPlatformBackend(platform_backend.PlatformBackend):
def __init__(self, cri):
super(CrosPlatformBackend, self).__init__()
@@ -35,6 +36,15 @@ class CrosPlatformBackend(linux_platform_backend.LinuxPlatformBackend):
except AssertionError:
return ''
+ def GetSystemCommitCharge(self):
+ meminfo_contents = self._GetFileContents('/proc/meminfo')
+ return proc_util.GetSystemCommitCharge(meminfo_contents)
+
+ def GetMemoryStats(self, pid):
+ status = self._GetFileContents('/proc/%s/status' % pid)
+ stats = self._GetFileContents('/proc/%s/stat' % pid).split()
+ return proc_util.GetMemoryStats(status, stats)
+
def GetIOStats(self, pid):
# There is no '/proc/<pid>/io' file on CrOS platforms
# Returns empty dict as it does in PlatformBackend.
@@ -42,3 +52,12 @@ class CrosPlatformBackend(linux_platform_backend.LinuxPlatformBackend):
def GetOSName(self):
return 'chromeos'
+
+ def CanFlushIndividualFilesFromSystemCache(self):
+ return True
+
+ def FlushEntireSystemCache(self):
+ raise NotImplementedError()
+
+ def FlushSystemCacheForDirectory(self, directory, ignoring=None):
+ raise NotImplementedError()

Powered by Google App Engine
This is Rietveld 408576698