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

Unified Diff: tools/perf/metrics/power.py

Issue 1242943005: [Android] Support idle wakeup measurement with /proc/timer_stats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Working test Created 5 years, 5 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/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

Powered by Google App Engine
This is Rietveld 408576698