aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skpbench/skpbench.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/skpbench/skpbench.py')
-rwxr-xr-xtools/skpbench/skpbench.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/tools/skpbench/skpbench.py b/tools/skpbench/skpbench.py
index 0477db2227..9d111f0ff0 100755
--- a/tools/skpbench/skpbench.py
+++ b/tools/skpbench/skpbench.py
@@ -79,9 +79,9 @@ __argparse.add_argument('--gpuThreads',
type=int, default=-1,
help="Create this many extra threads to assist with GPU work, including"
" software path rendering. Defaults to two.")
-__argparse.add_argument('skps',
+__argparse.add_argument('srcs',
nargs='+',
- help=".skp files or directories to expand for .skp files")
+ help=".skp files or directories to expand for .skp files, and/or .svg files")
FLAGS = __argparse.parse_args()
if FLAGS.adb:
@@ -167,7 +167,7 @@ class SKPBench:
print('running %i second warmup...' % warmup_time, file=sys.stderr)
commandline = cls.ARGV + ['--duration', str(warmup_time * 1000),
'--config', config,
- '--skp', 'warmup']
+ '--src', 'warmup']
dump_commandline_if_verbose(commandline)
output = subprocess.check_output(commandline, stderr=subprocess.STDOUT)
@@ -178,8 +178,8 @@ class SKPBench:
return
raise Exception('Invalid warmup output:\n%s' % output)
- def __init__(self, skp, config, max_stddev, best_result=None):
- self.skp = skp
+ def __init__(self, src, config, max_stddev, best_result=None):
+ self.src = src
self.config = config
self.max_stddev = max_stddev
self.best_result = best_result
@@ -202,11 +202,11 @@ class SKPBench:
self._schedule_hardware_poll()
commandline = self.ARGV + ['--config', self.config,
- '--skp', self.skp,
+ '--src', self.src,
'--suppressHeader', 'true']
if FLAGS.write_path:
pngfile = _path.join(FLAGS.write_path, self.config,
- _path.basename(self.skp) + '.png')
+ _path.basename(self.src) + '.png')
commandline.extend(['--png', pngfile])
dump_commandline_if_verbose(commandline)
self._proc = subprocess.Popen(commandline, stdout=subprocess.PIPE,
@@ -269,10 +269,10 @@ def emit_result(line, resultsfile=None):
print(line, file=resultsfile)
resultsfile.flush()
-def run_benchmarks(configs, skps, hardware, resultsfile=None):
+def run_benchmarks(configs, srcs, hardware, resultsfile=None):
hasheader = False
- benches = collections.deque([(skp, config, FLAGS.max_stddev)
- for skp in skps
+ benches = collections.deque([(src, config, FLAGS.max_stddev)
+ for src in srcs
for config in configs])
while benches:
try:
@@ -291,7 +291,7 @@ def run_benchmarks(configs, skps, hardware, resultsfile=None):
resultsfile)
else:
print("WARNING: no result for %s with config %s" %
- (skpbench.skp, skpbench.config), file=sys.stderr)
+ (skpbench.src, skpbench.config), file=sys.stderr)
except StddevException:
retry_max_stddev = skpbench.max_stddev * math.sqrt(2)
@@ -302,7 +302,7 @@ def run_benchmarks(configs, skps, hardware, resultsfile=None):
skpbench.best_result.stddev, skpbench.max_stddev,
retry_max_stddev),
file=sys.stderr)
- benches.append((skpbench.skp, skpbench.config, retry_max_stddev,
+ benches.append((skpbench.src, skpbench.config, retry_max_stddev,
skpbench.best_result))
except HardwareException as exception:
@@ -322,7 +322,7 @@ def main():
# Delimiter is ',' or ' ', skip if nested inside parens (e.g. gpu(a=b,c=d)).
DELIMITER = r'[, ](?!(?:[^(]*\([^)]*\))*[^()]*\))'
configs = re.split(DELIMITER, FLAGS.config)
- skps = _path.find_skps(FLAGS.skps)
+ srcs = _path.find_skps(FLAGS.srcs)
if FLAGS.adb:
adb = Adb(FLAGS.device_serial, FLAGS.adb_binary,
@@ -350,9 +350,9 @@ def main():
if FLAGS.resultsfile:
with open(FLAGS.resultsfile, mode='a+') as resultsfile:
- run_benchmarks(configs, skps, hardware, resultsfile=resultsfile)
+ run_benchmarks(configs, srcs, hardware, resultsfile=resultsfile)
else:
- run_benchmarks(configs, skps, hardware)
+ run_benchmarks(configs, srcs, hardware)
if __name__ == '__main__':