aboutsummaryrefslogtreecommitdiff
path: root/crosperf/schedv2.py
diff options
context:
space:
mode:
authorDenis Nikitin <denik@google.com>2019-09-06 16:04:18 -0700
committerDenis Nikitin <denik@chromium.org>2019-09-13 03:43:31 +0000
commit985566350786bf556c1d16c8f61f54c05ca035ec (patch)
tree80e06005f28b058d627551d317dd77eb8dfd6948 /crosperf/schedv2.py
parentd7cded2656ca4892dacfcaca9b50829e26538f6c (diff)
downloadtoolchain-utils-985566350786bf556c1d16c8f61f54c05ca035ec.tar.gz
crosperf: Wait for CPU cooldown and setup governor.
Based on dut_config['cooldown_temp'] and dut_config['cooldown_time'] wait for CPU to cooldown to a temperature 'cooldown_temp' or until timeout 'cooldown_time' expires. While waiting change CPU governor to a power saving mode. With 'cooldown_time' = 0 don't wait. Setup CPU governor based on dut_config['governor'] for a benchmark run. Additionally function helper DutWrapper is added in SuiteRunner which simplifies remote DUT calls. BUG=chromium:966514 TEST=Unitest and local HW tests passed. Change-Id: I2b946b570e7a8d8c4e2321f8bb8de3be2c3162d0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1790131 Tested-by: Denis Nikitin <denik@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'crosperf/schedv2.py')
-rw-r--r--crosperf/schedv2.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/crosperf/schedv2.py b/crosperf/schedv2.py
index 1ef0b938..a7983d9f 100644
--- a/crosperf/schedv2.py
+++ b/crosperf/schedv2.py
@@ -198,6 +198,8 @@ class DutWorker(Thread):
intel_pstate = self._sched.get_experiment().intel_pstate
# Firstly, handle benchmarkruns that have cache hit.
br = self._sched.get_cached_benchmark_run()
+ # Total wait time for cooling down.
+ total_waittime = 0
while br:
try:
self._stat_annotation = 'finishing cached {}'.format(br)
@@ -236,7 +238,11 @@ class DutWorker(Thread):
# Execute the br.
self._execute_benchmark_run(br)
+ total_waittime += br.suite_runner.GetCooldownWaitTime()
+ br.suite_runner.ResetCooldownWaitTime()
finally:
+ self._logger.LogOutput('Total wait time for cooldown: %d min'
+ % (total_waittime / 60))
self._stat_annotation = 'finished'
# Thread finishes. Notify scheduler that I'm done.
self._sched.dut_worker_finished(self)