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

Unified Diff: tools/telemetry/telemetry/core/platform/power_monitor/android_dumpsys_power_monitor.py

Issue 617453004: [Telemetry] Support dumpsys power monitoring on the Nexus 5. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert stray change Created 6 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
Index: tools/telemetry/telemetry/core/platform/power_monitor/android_dumpsys_power_monitor.py
diff --git a/tools/telemetry/telemetry/core/platform/power_monitor/android_dumpsys_power_monitor.py b/tools/telemetry/telemetry/core/platform/power_monitor/android_dumpsys_power_monitor.py
index 7d708b0756bcf66895fb7be6b7d4c98e39fb684f..76558f498a38960b3a59a83328c06ee0bf0ec9ae 100644
--- a/tools/telemetry/telemetry/core/platform/power_monitor/android_dumpsys_power_monitor.py
+++ b/tools/telemetry/telemetry/core/platform/power_monitor/android_dumpsys_power_monitor.py
@@ -45,7 +45,8 @@ class DumpsysPowerMonitor(sysfs_power_monitor.SysfsPowerMonitor):
result = self._platform.RunCommand('dumpsys batterystats -c %s' % package)
assert result, 'Dumpsys produced no output'
return super(DumpsysPowerMonitor, self).CombineResults(
- cpu_stats, DumpsysPowerMonitor.ParseSamplingOutput(package, result))
+ cpu_stats, DumpsysPowerMonitor.ParseSamplingOutput(package,
+ result.split('\n')))
@staticmethod
def ParseSamplingOutput(package, dumpsys_output):
@@ -103,8 +104,9 @@ class DumpsysPowerMonitor(sysfs_power_monitor.SysfsPowerMonitor):
# Find the uid of for the given package.
if not package in uid_entries:
- logging.warning('Unable to parse dumpsys output. ' +
- 'Please upgrade the OS version of the device.')
+ logging.warning('Unable to parse dumpsys output. '
+ 'Please upgrade the OS version of the device.'
+ 'package=%s, uid_entries=%s' % (package, uid_entries))
out_dict['energy_consumption_mwh'] = 0
return out_dict
uid = uid_entries[package]
« build/android/pylib/android_commands.py ('K') | « build/android/pylib/android_commands.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698