| 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()
|
|
|