aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skpbench/skpbench.py
diff options
context:
space:
mode:
authorGravatar csmartdalton <csmartdalton@google.com>2016-11-09 08:41:23 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-11-09 08:41:23 -0800
commite4fd0780ec279845ea98e18899f03d939b01db16 (patch)
tree3c28ee9087ae05f2d719f2c54ed699ea77ead70f /tools/skpbench/skpbench.py
parent671ce62f35049808378ee966da0e7b3acd0be30a (diff)
skpbench: simplify adb and reduce number of invocations
This change reduces a bit of startup overhead by condensing more bash into fewer invocations of 'adb shell'. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2481413003 Review-Url: https://codereview.chromium.org/2481413003
Diffstat (limited to 'tools/skpbench/skpbench.py')
-rwxr-xr-xtools/skpbench/skpbench.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/skpbench/skpbench.py b/tools/skpbench/skpbench.py
index 3e5b45138f..fc5082b94e 100755
--- a/tools/skpbench/skpbench.py
+++ b/tools/skpbench/skpbench.py
@@ -68,7 +68,7 @@ else:
import _os_path as _path
def dump_commandline_if_verbose(commandline):
- if FLAGS.verbosity >= 4:
+ if FLAGS.verbosity >= 5:
quoted = ['\'%s\'' % re.sub(r'([\\\'])', r'\\\1', x) for x in commandline]
print(' '.join(quoted), file=sys.stderr)
@@ -253,14 +253,14 @@ def run_benchmarks(configs, skps, hardware):
except HardwareException as exception:
skpbench.terminate()
- if FLAGS.verbosity >= 5:
+ if FLAGS.verbosity >= 4:
hardware.print_debug_diagnostics()
if FLAGS.verbosity >= 1:
print("%s; taking a %i second nap..." %
(exception.message, exception.sleeptime), file=sys.stderr)
benches.appendleft(benchargs) # retry the same bench next time.
hardware.sleep(exception.sleeptime)
- if FLAGS.verbosity >= 5:
+ if FLAGS.verbosity >= 4:
hardware.print_debug_diagnostics()
SKPBench.run_warmup(hardware.warmup_time)
@@ -272,8 +272,9 @@ def main():
skps = _path.find_skps(FLAGS.skps)
if FLAGS.adb:
- adb = Adb(FLAGS.device_serial)
- model = adb.get_device_model()
+ adb = Adb(FLAGS.device_serial,
+ echofile=(sys.stderr if FLAGS.verbosity >= 5 else None))
+ model = adb.check('getprop ro.product.model').strip()
if model == 'Pixel C':
from _hardware_pixel_c import HardwarePixelC
hardware = HardwarePixelC(adb)