diff options
-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: |