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

Side by Side Diff: build/android/pylib/perf/thermal_throttle.py

Issue 1314313004: [Android][telemetry] Update pylib imports for modules that moved into devil. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « build/android/pylib/perf/test_runner.py ('k') | build/android/pylib/ports.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 from pylib.device import device_utils 6
7 from devil.android import device_utils
7 8
8 9
9 class OmapThrottlingDetector(object): 10 class OmapThrottlingDetector(object):
10 """Class to detect and track thermal throttling on an OMAP 4.""" 11 """Class to detect and track thermal throttling on an OMAP 4."""
11 OMAP_TEMP_FILE = ('/sys/devices/platform/omap/omap_temp_sensor.0/' 12 OMAP_TEMP_FILE = ('/sys/devices/platform/omap/omap_temp_sensor.0/'
12 'temperature') 13 'temperature')
13 14
14 @staticmethod 15 @staticmethod
15 def IsSupported(device): 16 def IsSupported(device):
16 return device.FileExists(OmapThrottlingDetector.OMAP_TEMP_FILE) 17 return device.FileExists(OmapThrottlingDetector.OMAP_TEMP_FILE)
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 # Print temperature of battery, to give a system temperature 125 # Print temperature of battery, to give a system temperature
125 dumpsys_log = self._device.RunShellCommand('dumpsys battery') 126 dumpsys_log = self._device.RunShellCommand('dumpsys battery')
126 for line in dumpsys_log: 127 for line in dumpsys_log:
127 if 'temperature' in line: 128 if 'temperature' in line:
128 btemp = float([s for s in line.split() if s.isdigit()][0]) / 10.0 129 btemp = float([s for s in line.split() if s.isdigit()][0]) / 10.0
129 logging.debug(u'Current battery temperature of %s = %3.1f%sC', 130 logging.debug(u'Current battery temperature of %s = %3.1f%sC',
130 serial_number, btemp, degree_symbol) 131 serial_number, btemp, degree_symbol)
131 132
132 return has_been_throttled 133 return has_been_throttled
133 134
OLDNEW
« no previous file with comments | « build/android/pylib/perf/test_runner.py ('k') | build/android/pylib/ports.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698