diff options
author | csmartdalton <csmartdalton@google.com> | 2016-10-11 12:15:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-11 12:15:13 -0700 |
commit | 2a9610171b24aca1d1dce085b956572c7b57f183 (patch) | |
tree | 20d2da220bb1560afa705bba3d28d62a47accc5c /tools/skpbench | |
parent | bbdf45e34ffdd6a873033d393de433dca8931c04 (diff) |
skpbench: add debug prints for thermal trip points
Prints thermal trip points that have been exceeded when a
HardwareException is raised, and verbosity is set to debug. This can
help us correlate thermal trip points with throttling and detect
future throttling before it occurs.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2408893002
Review-Url: https://codereview.chromium.org/2408893002
Diffstat (limited to 'tools/skpbench')
-rw-r--r-- | tools/skpbench/_hardware.py | 4 | ||||
-rw-r--r-- | tools/skpbench/_hardware_android.py | 25 | ||||
-rwxr-xr-x | tools/skpbench/skpbench.py | 2 |
3 files changed, 31 insertions, 0 deletions
diff --git a/tools/skpbench/_hardware.py b/tools/skpbench/_hardware.py index f1c8c26843..9c929c43db 100644 --- a/tools/skpbench/_hardware.py +++ b/tools/skpbench/_hardware.py @@ -33,6 +33,10 @@ class Hardware: """Raises a HardwareException if any hardware state is not as expected.""" pass + def print_debug_diagnostics(self): + """Prints any info that may help improve or debug hardware monitoring.""" + pass + def sleep(self, sleeptime): """Puts the hardware into a resting state for a fixed amount of time.""" time.sleep(sleeptime) diff --git a/tools/skpbench/_hardware_android.py b/tools/skpbench/_hardware_android.py index a752ff5d93..d7990dcd81 100644 --- a/tools/skpbench/_hardware_android.py +++ b/tools/skpbench/_hardware_android.py @@ -89,5 +89,30 @@ class HardwareAndroid(Hardware): def sanity_check(self): Hardware.sanity_check(self) + def print_debug_diagnostics(self): + # search for and print thermal trip points that may have been exceeded. + self._adb.shell('''\ + THERMALDIR=/sys/class/thermal + if [ -e $THERMALDIR ]; then + for ZONE in $(cd $THERMALDIR; echo thermal_zone*); do + cd $THERMALDIR/$ZONE + if [ -e mode ] && grep -Fxq enabled mode; then + TEMP=$(cat temp) + TRIPPOINT= + let i=0 + while [ -e trip_point_${i}_temp ] && + [ $TEMP -gt $(cat trip_point_${i}_temp) ]; do + TRIPPOINT=trip_point_${i}_temp + let i=i+1 + done + if [ $TRIPPOINT ]; then + echo "$ZONE ($(cat type)): temp=$TEMP > $TRIPPOINT=$(cat $TRIPPOINT)" + fi + fi + done + fi''') + + Hardware.print_debug_diagnostics(self) + def sleep(self, sleeptime): Hardware.sleep(self, sleeptime) diff --git a/tools/skpbench/skpbench.py b/tools/skpbench/skpbench.py index 6bf39750a4..932d8d0461 100755 --- a/tools/skpbench/skpbench.py +++ b/tools/skpbench/skpbench.py @@ -230,6 +230,8 @@ def run_benchmarks(configs, skps, hardware): skpbench.best_result)) except HardwareException as exception: + if FLAGS.verbosity >= 5: + hardware.print_debug_diagnostics() skpbench.terminate() naptime = max(hardware.kick_in_time, exception.sleeptime) if FLAGS.verbosity >= 1: |