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

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

Issue 1315743004: [Android] Add a custom pylintrc for build/android/. (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
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 6
7 from devil.android import device_utils
8
9 7
10 class OmapThrottlingDetector(object): 8 class OmapThrottlingDetector(object):
11 """Class to detect and track thermal throttling on an OMAP 4.""" 9 """Class to detect and track thermal throttling on an OMAP 4."""
12 OMAP_TEMP_FILE = ('/sys/devices/platform/omap/omap_temp_sensor.0/' 10 OMAP_TEMP_FILE = ('/sys/devices/platform/omap/omap_temp_sensor.0/'
13 'temperature') 11 'temperature')
14 12
15 @staticmethod 13 @staticmethod
16 def IsSupported(device): 14 def IsSupported(device):
17 return device.FileExists(OmapThrottlingDetector.OMAP_TEMP_FILE) 15 return device.FileExists(OmapThrottlingDetector.OMAP_TEMP_FILE)
18 16
(...skipping 28 matching lines...) Expand all
47 pass 45 pass
48 46
49 @staticmethod 47 @staticmethod
50 def BecameThrottled(log_line): 48 def BecameThrottled(log_line):
51 return 'exynos_tmu: Throttling interrupt' in log_line 49 return 'exynos_tmu: Throttling interrupt' in log_line
52 50
53 @staticmethod 51 @staticmethod
54 def BecameUnthrottled(log_line): 52 def BecameUnthrottled(log_line):
55 return 'exynos_thermal_unthrottle: not throttling' in log_line 53 return 'exynos_thermal_unthrottle: not throttling' in log_line
56 54
55 # pylint: disable=unused-argument
57 @staticmethod 56 @staticmethod
58 def GetThrottlingTemperature(_log_line): 57 def GetThrottlingTemperature(_log_line):
59 return None 58 return None
60 59
61 @staticmethod 60 @staticmethod
62 def GetCurrentTemperature(): 61 def GetCurrentTemperature():
63 return None 62 return None
64 63
65 64
66 class ThermalThrottle(object): 65 class ThermalThrottle(object):
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 # Print temperature of battery, to give a system temperature 124 # Print temperature of battery, to give a system temperature
126 dumpsys_log = self._device.RunShellCommand('dumpsys battery') 125 dumpsys_log = self._device.RunShellCommand('dumpsys battery')
127 for line in dumpsys_log: 126 for line in dumpsys_log:
128 if 'temperature' in line: 127 if 'temperature' in line:
129 btemp = float([s for s in line.split() if s.isdigit()][0]) / 10.0 128 btemp = float([s for s in line.split() if s.isdigit()][0]) / 10.0
130 logging.debug(u'Current battery temperature of %s = %3.1f%sC', 129 logging.debug(u'Current battery temperature of %s = %3.1f%sC',
131 serial_number, btemp, degree_symbol) 130 serial_number, btemp, degree_symbol)
132 131
133 return has_been_throttled 132 return has_been_throttled
134 133
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698