Index: build/android/pylib/thermal_throttle.py |
diff --git a/build/android/pylib/thermal_throttle.py b/build/android/pylib/thermal_throttle.py |
index 385a48e7ef5f6a4c63e570e729e0247b5b83451b..2e02a8a0f4a3e50959da33dd52293ed9b36578b1 100644 |
--- a/build/android/pylib/thermal_throttle.py |
+++ b/build/android/pylib/thermal_throttle.py |
@@ -32,16 +32,39 @@ class ThermalThrottle(object): |
def _ReadLog(self): |
has_been_throttled = False |
+ serial_number = self._adb.Adb().GetSerialNumber() |
log = self._adb.RunShellCommand('dmesg -c') |
for line in log: |
if 'omap_thermal_throttle' in line: |
if not self._throttled: |
- logging.warning('>>> Thermally Throttled') |
+ logging.warning('>>> Device %s Thermally Throttled', serial_number) |
self._throttled = True |
has_been_throttled = True |
if 'omap_thermal_unthrottle' in line: |
if self._throttled: |
- logging.warning('>>> Thermally Unthrottled') |
+ logging.warning('>>> Device %s Thermally Unthrottled', serial_number) |
self._throttled = False |
has_been_throttled = True |
+ if 'throttle_delayed_work_fn' in line: |
+ temp = float([s for s in line.split() if s.isdigit()][0])/1000.0 |
bulach
2012/12/11 13:30:14
nit: spaces around /
It's not quite clear the [0]
aberent
2012/12/11 14:03:05
Spacing done. The list expression splits the line
|
+ # \u00B0 is the degree symbol |
bulach
2012/12/11 13:30:14
nit: it'd be clearer and avoid the comment to have
aberent
2012/12/11 14:03:05
Done.
|
+ logging.info(u' Device %s Thermally Thottled at %3.1f\u00B0C', |
+ serial_number, temp) |
+ |
+ # Print temperature of CPU SoC. |
+ omap_temp_file = '/sys/devices/platform/omap/omap_temp_sensor.0/temperature' |
+ if self._adb.FileExistsOnDevice(omap_temp_file): |
+ tempdata = self._adb.GetFileContents(omap_temp_file) |
+ temp = float(tempdata[0])/1000.0 |
bulach
2012/12/11 13:30:14
nit: spaces around /
aberent
2012/12/11 14:03:05
Done.
|
+ logging.info(u'Current OMAP Temperature of %s = %3.1f\u00B0C', |
+ serial_number, temp) |
+ |
+ # Print temperature of battery, to give a system temperature |
+ dumpsys_log = self._adb.RunShellCommand('dumpsys battery') |
+ for line in dumpsys_log: |
+ if 'temperature' in line: |
+ btemp = float([s for s in line.split() if s.isdigit()][0])/10.0 |
bulach
2012/12/11 13:30:14
nit: same for [0] here..
aberent
2012/12/11 14:03:05
As above
On 2012/12/11 13:30:14, bulach wrote:
|
+ logging.info(u'Current battery temperature of %s = %3.1f\u00B0C', |
+ serial_number, btemp) |
bulach
2012/12/11 13:30:14
nit: serial should be aligned with parens..
aberent
2012/12/11 14:03:05
Done.
|
+ |
return has_been_throttled |