android/benchmark: don't wait before first iteration
Even when --iterations-pause is used, doesn't make much sense to pause
before the first iteration.
Prevent that by using an iterations counter.
Signed-off-by: Juri Lelli <juri.lelli@arm.com>
diff --git a/libs/utils/android/benchmark.py b/libs/utils/android/benchmark.py
index 8f3a54c..842d3cf 100644
--- a/libs/utils/android/benchmark.py
+++ b/libs/utils/android/benchmark.py
@@ -221,6 +221,8 @@
if self.bm_reboot and not self.bm_iterations_reboot:
self.reboot_target()
+ self.iterations_count = 1
+
def _preRun(self):
"""
Code executed before every iteration of the benchmark
@@ -230,11 +232,13 @@
if self.bm_reboot and self.bm_iterations_reboot:
rebooted = self.reboot_target()
- if not rebooted:
- self._log.info('Waiting {}[s] before executing iteration...'\
- .format(self.bm_iterations_pause))
+ if not rebooted and self.iterations_count > 1:
+ self._log.info('Waiting {}[s] before executing iteration {}...'\
+ .format(self.bm_iterations_pause, self.iterations_count))
sleep(self.bm_iterations_pause)
+ self.iterations_count += 1
+
def __init__(self):
"""
Set up logging and trigger running experiments