diff options
author | Julien Duraj <julien.duraj@linaro.org> | 2017-01-27 17:29:28 +0000 |
---|---|---|
committer | Julien Duraj <julien.duraj@linaro.org> | 2017-01-31 10:48:09 +0000 |
commit | 6225f82f9deb28218ee09a1347f7e52001395a80 (patch) | |
tree | 43d0d67a67e1356a9e96c6acf2d6637da85de6bc /tools | |
parent | 35405ee4eefc3b1c99e9aefb91b7b6defc9ddbdf (diff) | |
download | art-testing-6225f82f9deb28218ee09a1347f7e52001395a80.tar.gz |
Fix memory statistics parsing
This fixes 2 things:
1. The output of dex2oat statistics now contains additional information
that we were not accounting for: number of threads. Since it messes up
the parsing of memory statistics, we remove it if it is there.
2. For linux platforms, we were not using the correct string to parse
the memory statistics from. This would result in wrong benchmark keys
and values being added.
Change-Id: Idaa2776b9a0e9eb52523245ec325465bd83c8dee
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/compilation_statistics/run.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/compilation_statistics/run.py b/tools/compilation_statistics/run.py index b8672ed..467f2b1 100755 --- a/tools/compilation_statistics/run.py +++ b/tools/compilation_statistics/run.py @@ -146,17 +146,17 @@ def GetStats(apk, 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) + rc, stdout = utils_adb.shell(command, target) 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) + for out in reversed(stdout.splitlines()): + compile_time = re.match(dex2oat_time_regex, out) 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' + stdout.rstrip() + ').*took" | tail -n1' rc, out = utils_adb.shell(stats_command, target) compile_time = re.match(dex2oat_time_regex, out) @@ -170,6 +170,8 @@ def GetStats(apk, # The rest of the statistics are deterministic, so there is no need to run several # iterations; just get the values from the last run. out = out[compile_time.end():] + # Newer versions of dex2oat also have number of threads output, that we need to get rid of + out = re.sub('\(threads:\s+[0-9]+\) ', '', out) memory_stats = OrderedDict() byte_size = True |