Index: tools/telemetry/telemetry/core/platform/power_monitor/sysfs_power_monitor.py |
diff --git a/tools/telemetry/telemetry/core/platform/power_monitor/sysfs_power_monitor.py b/tools/telemetry/telemetry/core/platform/power_monitor/sysfs_power_monitor.py |
index 421f5830e26922c260ec16d4511cfeb7b92ff28b..5c708802a844aedac11e725c1be362e8ef7ce8cd 100644 |
--- a/tools/telemetry/telemetry/core/platform/power_monitor/sysfs_power_monitor.py |
+++ b/tools/telemetry/telemetry/core/platform/power_monitor/sysfs_power_monitor.py |
@@ -89,10 +89,12 @@ class SysfsPowerMonitor(power_monitor.PowerMonitor): |
stats = {} |
for cpu in self._cpus: |
cpu_state_path = os.path.join(CPU_PATH, cpu, 'cpuidle/state*') |
- stats[cpu] = self._platform.RunCommand( |
- 'cat %s %s %s; date +%%s' % (os.path.join(cpu_state_path, 'name'), |
- os.path.join(cpu_state_path, 'time'), |
- os.path.join(cpu_state_path, 'latency'))) |
+ output = self._platform.RunCommand( |
+ 'cat %s %s %s; date +%%s' % ( |
+ os.path.join(cpu_state_path, 'name'), |
+ os.path.join(cpu_state_path, 'time'), |
+ os.path.join(cpu_state_path, 'latency'))) |
+ stats[cpu] = re.sub('\n\n+', '\n', output) |
return stats |
def GetCpuFreq(self): |