diff options
author | Yasuhiro Matsuda <mazda@google.com> | 2015-08-06 03:55:04 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-08-06 03:55:04 +0000 |
commit | 50de8224a6ec2e6e0de4197eb545c17ee4303dff (patch) | |
tree | 9d8e0a15025eafcfcf1a4ec66a63dbe760e087bc /init | |
parent | 7f2e05e9a3f44528d9fa624da9386b01ccaa54a6 (diff) | |
parent | c0822e83ad11e42e02f2304e9cf925ea944b8f53 (diff) | |
download | core-50de8224a6ec2e6e0de4197eb545c17ee4303dff.tar.gz core-50de8224a6ec2e6e0de4197eb545c17ee4303dff.tar.bz2 core-50de8224a6ec2e6e0de4197eb545c17ee4303dff.zip |
Merge "Enable perfboot.py to install APKs before measurement."
Diffstat (limited to 'init')
-rwxr-xr-x | init/perfboot.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/init/perfboot.py b/init/perfboot.py index 583d640ef..b0efb1183 100755 --- a/init/perfboot.py +++ b/init/perfboot.py @@ -40,6 +40,7 @@ $ ./perfboot.py --iterations=30 -v --output=data.tsv --tags=eventtags.txt import argparse import atexit import cStringIO +import glob import inspect import logging import math @@ -408,9 +409,17 @@ def parse_args(): 'event tags are read. Every line contains one event ' 'tag and the last event tag is used to detect that ' 'the device has finished booting.') + parser.add_argument('--apk-dir', help='Specify the directory which contains ' + 'APK files to be installed before measuring boot time.') return parser.parse_args() +def install_apks(device, apk_dir): + for apk in glob.glob(os.path.join(apk_dir, '*.apk')): + print 'Installing: ' + apk + device.install(apk, replace=True) + + def main(): args = parse_args() if args.verbose: @@ -425,6 +434,9 @@ def main(): device.get_prop('ro.build.version.incremental')) check_dm_verity_settings(device) + if args.apk_dir: + install_apks(device, args.apk_dir) + record_list = [] event_tags = filter_event_tags(read_event_tags(args.tags), device) init_perf(device, args.output, record_list, event_tags) |