aboutsummaryrefslogtreecommitdiff
path: root/android_bench_suite
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2019-07-24 23:20:57 -0700
committerGeorge Burgess <gbiv@chromium.org>2019-07-25 16:08:53 +0000
commit9a6dae865659ce5e32694ae92bd3f1f7310d0049 (patch)
treefb35dd1b9746822d1d98e6777744e288ba20bd8d /android_bench_suite
parentadcb8bff41c7f3756756cbe581547897ad49d098 (diff)
downloadtoolchain-utils-9a6dae865659ce5e32694ae92bd3f1f7310d0049.tar.gz
toolchain-utils: remove all xranges
This removes all mention of xrange from toolchain-utils (modulo ones being changed in other CLs that are in flight). It's now an apparent lint error to use xrange, and it hinders our move to python3. As commented on If90d26664c70ccb73750f17573b89933fdb048f4, xrange -> range in python2 is really only a space concern (or speed in pathological cases), so migrations of this nature are generally super straightforward. I glanced at each of these callsites, and none of them appear to be pathological, so my hope is that this should all be Just Fine :) (Also fun to note that this includes a .diff file that has python code embedded in it.) BUG=None TEST=Presubmit tests Change-Id: Ic9f3ac3a5044d7a07da8a249bc505278d98203de Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1717130 Commit-Queue: George Burgess <gbiv@chromium.org> Commit-Queue: Luis Lozano <llozano@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'android_bench_suite')
-rw-r--r--android_bench_suite/autotest.diff8
-rwxr-xr-xandroid_bench_suite/fix_skia_results.py2
-rwxr-xr-xandroid_bench_suite/gen_json.py2
-rwxr-xr-xandroid_bench_suite/run.py4
4 files changed, 8 insertions, 8 deletions
diff --git a/android_bench_suite/autotest.diff b/android_bench_suite/autotest.diff
index ef0029ae..c2fed83b 100644
--- a/android_bench_suite/autotest.diff
+++ b/android_bench_suite/autotest.diff
@@ -49,7 +49,7 @@ index 000000000..b233b586a
+ 'binderThroughputTest > /data/local/tmp/bench_result'
+ % os.getenv('TEST_MODE'))
+ # Next 4 runs add to bench_result
-+ for i in xrange(4):
++ for i in range(4):
+ self.client.run('taskset %s /data/local/tmp/'
+ 'binderThroughputTest >> '
+ '/data/local/tmp/bench_result'
@@ -165,11 +165,11 @@ index 000000000..dd6af0b53
+ 'bench_result'), 'w') as f:
+
+ # There are two benchmarks, chrome and camera.
-+ for i in xrange(2):
++ for i in range(2):
+ f.write('Test %d:\n' % i)
+ total_time = 0
+ # Run benchmark for several times for accurancy
-+ for j in xrange(3):
++ for j in range(3):
+ f.write('Iteration %d: ' % j)
+ result = self.client.run('time taskset %s dex2oat'
+ ' --dex-file=data/local/tmp/dex2oat_input/test%d.apk'
@@ -739,7 +739,7 @@ index 000000000..b317bd0f3
+ ' > /data/local/tmp/bench_result'
+ % os.getenv('TEST_MODE'))
+ # Next 4 runs add to bench_result
-+ for i in xrange(4):
++ for i in range(4):
+ self.client.run('taskset %s /data/local/tmp/synthmark'
+ ' >> /data/local/tmp/bench_result'
+ % os.getenv('TEST_MODE'))
diff --git a/android_bench_suite/fix_skia_results.py b/android_bench_suite/fix_skia_results.py
index 6eec6ccf..8c919d35 100755
--- a/android_bench_suite/fix_skia_results.py
+++ b/android_bench_suite/fix_skia_results.py
@@ -111,7 +111,7 @@ def _TransformBenchmarks(raw_benchmarks):
if len(results) < len(samples):
results.extend({
'retval': 0
- } for _ in xrange(len(samples) - len(results)))
+ } for _ in range(len(samples) - len(results)))
time_mul = _GetTimeMultiplier(friendly_name)
for sample, app in itertools.izip(samples, results):
diff --git a/android_bench_suite/gen_json.py b/android_bench_suite/gen_json.py
index ad617ff4..e1252933 100755
--- a/android_bench_suite/gen_json.py
+++ b/android_bench_suite/gen_json.py
@@ -81,7 +81,7 @@ def main(argv):
iteration = arguments.iterations
result = []
- for i in xrange(iteration):
+ for i in range(iteration):
result += collect_data(infile, bench, i)
with get_outfile(outfile, bench) as fout:
diff --git a/android_bench_suite/run.py b/android_bench_suite/run.py
index 55acb663..19d9b36f 100755
--- a/android_bench_suite/run.py
+++ b/android_bench_suite/run.py
@@ -301,7 +301,7 @@ def test_bench(bench, setting_no, iterations, serials, remote, mode):
logging.info('Start running benchmark on device...')
# Run benchmark and tests on DUT
- for i in xrange(iterations):
+ for i in range(iterations):
logging.info('Iteration No.%d:', i)
test_cmd = [
os.path.join(
@@ -463,7 +463,7 @@ def main(argv):
for bench in bench_list:
logging.info('Start building and running benchmark: [%s]', bench)
# Run script for each toolchain settings
- for setting_no in xrange(setting_count):
+ for setting_no in range(setting_count):
build_bench(setting_no, bench, compiler, llvm_version, build_os, cflags,
ldflags)