Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: tools/skpbench/skpbench.py

Issue 2408893002: skpbench: add debug prints for thermal trip points (Closed)
Patch Set: skpbench: add warmup run Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/skpbench/skpbench.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skpbench/skpbench.py
diff --git a/tools/skpbench/skpbench.py b/tools/skpbench/skpbench.py
index 6bf39750a409809411ac87dcb30ed3c7ab9a764d..3b95166f9a1d36ee89807c4707a6958cf6af9fb3 100755
--- a/tools/skpbench/skpbench.py
+++ b/tools/skpbench/skpbench.py
@@ -113,6 +113,22 @@ class SKPBench:
def print_header(cls):
subprocess.call(cls.ARGV + ['--duration', '0'])
+ @classmethod
+ def run_warmup(cls, warmup_time):
+ if not warmup_time:
+ return
+ print('running %i second warmup...' % warmup_time)
+ commandline = cls.ARGV + ['--duration', str(warmup_time * 1000),
+ '--config', 'gpu',
+ '--skp', 'warmup']
+ output = subprocess.check_output(commandline).decode('utf-8')
+ # validate the warmup run output.
+ for line in output.split('\n'):
+ match = BenchResult.match(line.rstrip())
+ if match and match.bench == 'warmup':
+ return
+ raise Exception('Invalid warmup output:\n%s' % output)
+
def __init__(self, skp, config, max_stddev, best_result=None):
self.skp = skp
self.config = config
@@ -230,14 +246,15 @@ 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:
print("%s; taking a %i second nap..." %
- (exception.message, naptime), file=sys.stderr)
+ (exception.message, exception.sleeptime), file=sys.stderr)
benches.appendleft(benchargs) # retry the same bench next time.
- hardware.sleep(naptime - hardware.kick_in_time)
- time.sleep(hardware.kick_in_time)
+ hardware.sleep(exception.sleeptime)
+ SKPBench.run_warmup(hardware.warmup_time)
def main():
@@ -261,10 +278,7 @@ def main():
hardware = Hardware()
with hardware:
- if hardware.kick_in_time:
- print("sleeping %i seconds to allow hardware settings to kick in..." %
- hardware.kick_in_time, file=sys.stderr)
- time.sleep(hardware.kick_in_time)
+ SKPBench.run_warmup(hardware.warmup_time)
run_benchmarks(configs, skps, hardware)
« no previous file with comments | « tools/skpbench/skpbench.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698