diff options
Diffstat (limited to 'android_bench_suite')
-rw-r--r-- | android_bench_suite/README.md | 49 | ||||
-rw-r--r-- | android_bench_suite/README.txt | 41 | ||||
-rw-r--r-- | android_bench_suite/autotest.diff | 8 | ||||
-rwxr-xr-x | android_bench_suite/fix_skia_results.py | 2 | ||||
-rwxr-xr-x | android_bench_suite/gen_json.py | 2 | ||||
-rwxr-xr-x | android_bench_suite/run.py | 4 |
6 files changed, 49 insertions, 57 deletions
diff --git a/android_bench_suite/README.md b/android_bench_suite/README.md deleted file mode 100644 index b539c7cd..00000000 --- a/android_bench_suite/README.md +++ /dev/null @@ -1,49 +0,0 @@ -# `android_bench_suite` - -This is a Android Toolchain benchmark suite. - -Where to find this suite: - -This suite locates at google3, please create a google3 branch first, then run: - -``` -$ cd experimental/users/zhizhouy/benchtoolchain -``` - -Copy this directory to the place you want to put it. - -To use this suite: -1. Configure the basic envrionment in `env_setting` file. - -2. Run `./apply_patches.py`, which will: - - 1. Patch all the android benchmarks in the android tree. - Benchmark Panorama does not exist in android tree, so perftests/ - gets copied into the top-level of android tree. - - 2. Apply patch autotest.diff to `android_root/external/autotest`, which - includes all the test scripts for benchmarks. Copy testcases to - related autotest directory. - - If you have applied the patch partially and hope to discard the - patch, just run `discard_patches.py` - -3. Build and run benchmark on the device using ./run.py. You can either - use test configuration file (-t `test_config`), or set all the variables - manually. - -4. The raw results locate at `bench_result_*` in bench suite home - directory. - -5. The JSON format result will be generated for crosperf report. - -Utility tools: - -1. Autotest is a test framework located in android exteranl/autotest - Before first time running it, please run - `utils/build_externals.py` first to ensure all the environments - and tools needed are installed. - -2. Crosperf is a report generating tool in ChromeOS toolchain utilities. - Please look for it in chromium source: - `src/third_party/toolchain-utils/crosperf`. diff --git a/android_bench_suite/README.txt b/android_bench_suite/README.txt new file mode 100644 index 00000000..3d0cceb5 --- /dev/null +++ b/android_bench_suite/README.txt @@ -0,0 +1,41 @@ +This is a Android Toolchain benchmark suite. +=========================================== +Where to find this suite: + This suite locates at google3, please create a google3 branch first, + then run: + $cd experimental/users/zhizhouy/benchtoolchain + Copy this directory to the place you want to put it. + +To use this suite: + 1. Configure the basic envrionment in env_setting file. + + 2. Run ./apply_patches.py, which will: + 1) Patch all the android benchmarks in the android tree. + Benchmark Panorama does not exist in android tree, so perftests/ + gets copied into the top-level of android tree. + + 2) Apply patch autotest.diff to android_root/external/autotest, which + includes all the test scripts for benchmarks. Copy testcases to + related autotest directory. + + If you have applied the patch partially and hope to discard the + patch, just run discard_patches.py + + 3. Build and run benchmark on the device using ./run.py. You can either + use test configuration file (-t test_config), or set all the variables + manually. + + 4. The raw results locate at bench_result_* in bench suite home + directory. + + 5. The JSON format result will be generated for crosperf report. + +Utility tools: + 1. Autotest is a test framework located in android exteranl/autotest + Before first time running it, please run + utils/build_externals.py first to ensure all the environments + and tools needed are installed. + + 2. Crosperf is a report generating tool in ChromeOS toolchain utilities. + Please look for it in chromium source: + src/third_party/toolchain-utils/crosperf. diff --git a/android_bench_suite/autotest.diff b/android_bench_suite/autotest.diff index c2fed83b..ef0029ae 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 range(4): ++ for i in xrange(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 range(2): ++ for i in xrange(2): + f.write('Test %d:\n' % i) + total_time = 0 + # Run benchmark for several times for accurancy -+ for j in range(3): ++ for j in xrange(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 range(4): ++ for i in xrange(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 8c919d35..6eec6ccf 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 range(len(samples) - len(results))) + } for _ in xrange(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 e1252933..ad617ff4 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 range(iteration): + for i in xrange(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 19d9b36f..55acb663 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 range(iterations): + for i in xrange(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 range(setting_count): + for setting_no in xrange(setting_count): build_bench(setting_no, bench, compiler, llvm_version, build_os, cflags, ldflags) |