Index: tools/telemetry/telemetry/internal/platform/power_monitor/sysfs_power_monitor.py |
diff --git a/tools/telemetry/telemetry/internal/platform/power_monitor/sysfs_power_monitor.py b/tools/telemetry/telemetry/internal/platform/power_monitor/sysfs_power_monitor.py |
index 9ebbe088f194141de688783fe21cf5e6ccbe4e3c..ad39635c1b76d170b7f00c014689cd07db0141cc 100644 |
--- a/tools/telemetry/telemetry/internal/platform/power_monitor/sysfs_power_monitor.py |
+++ b/tools/telemetry/telemetry/internal/platform/power_monitor/sysfs_power_monitor.py |
@@ -18,11 +18,12 @@ class SysfsPowerMonitor(power_monitor.PowerMonitor): |
"""PowerMonitor that relies on sysfs to monitor CPU statistics on several |
different platforms. |
""" |
- def __init__(self, linux_based_platform_backend): |
+ def __init__(self, linux_based_platform_backend, standalone=False): |
"""Constructor. |
Args: |
linux_based_platform_backend: A LinuxBasedPlatformBackend object. |
+ standalone: If it is not wrapping another monitor, set to True. |
jdduke (slow)
2015/07/23 19:24:46
I see, should we add a TODO to convert other platf
rnephew (Reviews Here)
2015/07/23 19:34:46
Done.
|
Attributes: |
_cpus: A list of the CPUs on the target device. |
@@ -42,6 +43,7 @@ class SysfsPowerMonitor(power_monitor.PowerMonitor): |
self._initial_cstate = None |
self._initial_freq = None |
self._platform = linux_based_platform_backend |
+ self._standalone = standalone |
@decorators.Cache |
def CanMonitorPower(self): |
@@ -74,6 +76,8 @@ class SysfsPowerMonitor(power_monitor.PowerMonitor): |
for cpu in frequencies: |
out[cpu] = {'frequency_percent': frequencies[cpu]} |
out[cpu]['cstate_residency_percent'] = cstates[cpu] |
+ if self._standalone: |
+ return self.CombineResults(out, {}) |
return out |
finally: |
self._initial_cstate = None |