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

Unified Diff: tools/telemetry/telemetry/internal/platform/power_monitor/powermetrics_power_monitor.py

Issue 1419743003: [telemetry] Ignore missing C-state info from powermetrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reword Created 5 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/internal/platform/power_monitor/powermetrics_power_monitor.py
diff --git a/tools/telemetry/telemetry/internal/platform/power_monitor/powermetrics_power_monitor.py b/tools/telemetry/telemetry/internal/platform/power_monitor/powermetrics_power_monitor.py
index 913f7b80badeb4ef8b4759cc227e485a22874cda..77add66330f42475f1a2254dca14eadd847f2d7e 100644
--- a/tools/telemetry/telemetry/internal/platform/power_monitor/powermetrics_power_monitor.py
+++ b/tools/telemetry/telemetry/internal/platform/power_monitor/powermetrics_power_monitor.py
@@ -195,7 +195,12 @@ class PowerMetricsPowerMonitor(power_monitor.PowerMonitor):
(float(processor.get('package_joules', 0)) / 3600.) * 10 ** 3)
for m in metrics:
- m.samples.append(DataWithMetricKeyPath(m, plist))
+ try:
+ m.samples.append(DataWithMetricKeyPath(m, plist))
+ except KeyError:
+ # Old CPUs don't have c-states, so if data is missing, just ignore it.
+ logging.info('Field missing from powermetrics output: %s', m.src_path)
+ continue
# -------- Collect and Process Data --------
out_dict = {}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698