diff options
author | Julien Duraj <julien@duraj.fr> | 2016-11-23 17:58:43 +0000 |
---|---|---|
committer | Julien Duraj <julien.duraj@linaro.org> | 2016-12-21 14:00:49 +0000 |
commit | 7563d9af7e93ca83af1b2403425fa3311c233788 (patch) | |
tree | ecbdedbde284c82d6d6c14c25e88ba993e94356b /tools | |
parent | cb667be083ef0eb4615baab568ac9a463a4fe9e6 (diff) | |
download | art-testing-7563d9af7e93ca83af1b2403425fa3311c233788.tar.gz |
Compilation stats: Support linux targets
Since on Linux dex2oat writes to stdout, parse the output from stdout
instead of logcat.
Test: export ART_TARGET_LINUX=true && \
scripts/benchmarks/benchmarks_run_target.sh
Change-Id: If32d41d3642f57c6f09b1d5604d3e0c7b8487c0d
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/compilation_statistics/run.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/tools/compilation_statistics/run.py b/tools/compilation_statistics/run.py index b032717..b8672ed 100755 --- a/tools/compilation_statistics/run.py +++ b/tools/compilation_statistics/run.py @@ -142,14 +142,23 @@ def GetStats(apk, ' --dex-file=' + apk_path + ' --oat-file=' + oat command += ' --instruction-set=' + isa + ') | head -n1' + linux_target = os.getenv('ART_TARGET_LINUX', 'false') == 'true' + dex2oat_time_regex = '.*?took (?P<value>.*?)(?P<unit>[mnu]{,1})s.*?\)' compilation_times = [] for i in range(iterations): rc, out = utils_adb.shell(command, target) - # To simplify parsing, assume that PID values are rarely recycled by the system. - stats_command = 'logcat -dsv process dex2oat | grep "^I([[:space:]]*' + \ - out.rstrip() + ').*took" | tail -n1' - rc, out = utils_adb.shell(stats_command, target) - compile_time = re.match('.*?took (?P<value>.*?)(?P<unit>[mnu]{,1})s.*?\)', out) + if linux_target: + # On Linux, dex2oat writes to stdout, and output of compilation time is likely last + for line in reversed(out.splitlines()): + compile_time = re.match(dex2oat_time_regex, line) + if compile_time: + break + else: + # To simplify parsing, assume that PID values are rarely recycled by the system. + stats_command = 'logcat -dsv process dex2oat | grep "^I([[:space:]]*' + \ + out.rstrip() + ').*took" | tail -n1' + rc, out = utils_adb.shell(stats_command, target) + compile_time = re.match(dex2oat_time_regex, out) if not compile_time: utils.Error('dex2oat failed; check adb logcat.') |