Index: tools/perf/metrics/power.py |
diff --git a/tools/perf/metrics/power.py b/tools/perf/metrics/power.py |
index 596bfd818c54a2975fdc21ff662cb6d35598c3b0..ff9bd1278843abe2beda3d44c1ff143601c2dc53 100644 |
--- a/tools/perf/metrics/power.py |
+++ b/tools/perf/metrics/power.py |
@@ -70,6 +70,9 @@ class PowerMetric(Metric): |
def Start(self, _, tab): |
self._browser = tab.browser |
+ if self._platform.CanMeasureIdleWakeUps(): |
+ self._platform.StartMeasuringIdleWakeUps() |
+ |
if not self._platform.CanMonitorPower(): |
return |
@@ -77,11 +80,17 @@ class PowerMetric(Metric): |
self._StopInternal() |
# This line invokes top a few times, call before starting power measurement. |
+ # TODO(jdduke): Move idle wakeup measurement into standalone PowerMonitor |
+ # instances. Including wakeups in the "instantaneous" CPU stats object is |
+ # awkward on Linux-based platforms. |
self._starting_cpu_stats = self._browser.cpu_stats |
self._platform.StartMonitoringPower(self._browser) |
self._running = True |
def Stop(self, _, tab): |
+ if self._platform.CanMeasureIdleWakeUps(): |
+ self._platform.StopMeasuringIdleWakeUps() |
+ |
if not self._platform.CanMonitorPower(): |
return |