History log of /art/runtime/jit/offline_profiling_info.cc
Revision Date Author Comments
6b9c54c8ae70d5a75e26bef20a26316ff7c9ab18 27-Jul-2016 Jeff Hao <jeffhao@google.com> Fix profiling output to properly display class info.

The profiler stores class def indexes, not type ids.

Bug: 30436198

(cherry-picked from commit 58d40f3a7245e65d57a5daf6bf27c3b209260044)

Change-Id: I63524957547c5e0dbaf1d752220de8d05473638f
9275af6ec0d71d1a13a97a1d292806b73f755717 29-Apr-2016 Mathieu Chartier <mathieuc@google.com> Fix profile saver to use base dex location

Previously we were using the dex location. This only matches the
base location for the main dex file, and resulted in only the
main dex file to have classes recorded.

Bug: 28463739

Change-Id: I0117352150c7244dd048338dbb677abdd4554eb0
e2d066d0337b7c81d47e4806e6025b70d83fcd56 19-Apr-2016 Calin Juravle <calin@google.com> ProfileSaver: query profiling_infos instead of the code_map

This is the first step in being able to record profiles without jit
being active.

Bug: 27916886
Change-Id: I2fcbd03560e109e6866ad6d82c79b902a889e620
fe297a96bc6d3da11579709add9b4568730d2b4f 24-Mar-2016 Calin Juravle <calin@google.com> Discard corrupted or out of date profiles

Until now we bailed out if the previous profile contained invalid data.
This CLs forces the save and clears any data in a profile that has the
wrong version or contains bad data.

Bug: 27081617
Change-Id: I0424025e37c7b4b817da791996436dd4a932c2cd
54196728c25421e72d0009cac4c3145a0da18a58 24-Mar-2016 Calin Juravle <calin@google.com> Extend profman to be able to dump profile content.

With the move to binary format it gets harder to debug profiles. This
adds a simple dumping mechanism to make profiles human readable.

Bug: 27600652
Change-Id: Idc968601cdf6e371822aa98e316605e30749e2e8
b8697b15145834c9861bebfb03daa745ecbe53e8 21-Mar-2016 Calin Juravle <calin@google.com> Update and improve profiles format

- add profile version in the header
- change the profile format to a binary format (saves more than 50% of
space)
- improve error handling during parsing
- improve corner cases handling (all methods/classes in the
file)
- improve error reporting

Bug: 27600652
Bug: 27081617

Change-Id: I54dfbf73fbc943ff6fc3d67f389c658d833cded9
85f7bf3bbfa17d65ff77e3e826b5f7aff45838a9 18-Mar-2016 Calin Juravle <calin@google.com> Improve ProfileSaver to cache data and do minimal I/O

This CLs introducing caching to further optimize the I/O performed by
the ProfileSaver. The cache stats are also recorded.

Resolved classes are captured and cached after 2 seconds but written
later during application lifetime.

Methods are also cached and the write got smarter to avoid
reading/writing them if it's not needed.

On non scientific experiments the size of the cache reaches just a few
hundreds uint16_t values kept in set, so its impact is minimal.

In terms of how much data we write. In the same non scientific
experiments this reduces the total bytes written by at least 2-3x. In
the first few minutes of after the boot gmscore writes ~3KB (down from
9kb) and quicksearchlauncher writes ~20KB (down from 40KB).

Bug: 27600652

Change-Id: I3a4e7051ccf04ac8fbd5896d328692db773e979d
a807780b1d8ee01dfb03923c673621b4c81ac858 17-Mar-2016 Mathieu Chartier <mathieuc@google.com> Add verify-profile compiler filter

Only verifies and dex2dex compiles classes in the profile. Goal
is to reduce application launch time.

~2x faster than interpret-only for Facebook.

Bug: 27688727

(cherry picked from commit a079e3aa62cceb76c1c1811e6e09bcaf75e20289)

Change-Id: Iad5aa1adee3aa6c2408820e8cbbab2d4412021b8
a079e3aa62cceb76c1c1811e6e09bcaf75e20289 17-Mar-2016 Mathieu Chartier <mathieuc@google.com> Add verify-profile compiler filter

Only verifies and dex2dex compiles classes in the profile. Goal
is to reduce application launch time.

~2x faster than interpret-only for Facebook.

Bug: 27688727
Change-Id: Ic9979c4f7ba4930298d0983c4e3c70c63500213f
c19c1c2e1def1f4f5ab5fd9e71b1a6f76d42988f 09-Mar-2016 Calin Juravle <calin@google.com> Add ProfileSaver stats and dump them during SigQuit

Bug: 27516906
Change-Id: I7d2b1091c3523805ef0f87df42feed1098678aad
32ce2adefb8a3d0eda59a29f5e87c1eb43eef796 04-Mar-2016 Mathieu Chartier <mathieuc@google.com> Add more systracing everywhere

Added to:
JIT
DexFile functions
Oat file manager

Added helper ScopedTrace to prevent errors and reduce excess code.

Bug: 27502458

(cherry picked from commit dabdc0fe183d4684f3cf4d70cb09d318cff81b42)

Change-Id: Ifaeff8913d79eefc797380987d13cc00456266f8
dabdc0fe183d4684f3cf4d70cb09d318cff81b42 04-Mar-2016 Mathieu Chartier <mathieuc@google.com> Add more systracing everywhere

Added to:
JIT
DexFile functions
Oat file manager

Added helper ScopedTrace to prevent errors and reduce excess code.

Bug: 27502458

Change-Id: Ifaeff8913d79eefc797380987d13cc00456266f8
c5dd319c574f67d11a71f1b60ac6c34bfe93b750 10-Dec-2015 Mathieu Chartier <mathieuc@google.com> Add and use loaded class profiling

Class profiling is a way to keep track of which classes are resolved.
From here the compiler can use this information to generate a smaller
app image.

TODO: Add tests for profile stuff.

Bug: 22858531

(cherry picked from commit 8913fc1a27df8cf3b37fd99e94d87f290591328e)

Change-Id: Ifcd09230cbdc266305bc1247e0d31e7920eb353e
8913fc1a27df8cf3b37fd99e94d87f290591328e 10-Dec-2015 Mathieu Chartier <mathieuc@google.com> Add and use loaded class profiling

Class profiling is a way to keep track of which classes are resolved.
From here the compiler can use this information to generate a smaller
app image.

TODO: Add tests for profile stuff.

Bug: 22858531

Change-Id: I91ccd686394cc2517512f66abb0e277f3d26d4da
024160850fbbf28368eae951beb4c72e2ce8fce6 23-Feb-2016 Calin Juravle <calin@google.com> Revert "Revert "Add profman tool: responsible to process profiles""

This reverts commit 3da74687e42de7d33a8e75df9bd64374e650f75e.

(cherry picked from commit 2e2db786b8fbaa4dceb37603a4296b0b2aea4e9e)

Change-Id: I38086cc9de939bad33bcd13b1677e1626af61c29
2e2db786b8fbaa4dceb37603a4296b0b2aea4e9e 23-Feb-2016 Calin Juravle <calin@google.com> Revert "Revert "Add profman tool: responsible to process profiles""

This reverts commit 3da74687e42de7d33a8e75df9bd64374e650f75e.

Change-Id: Id005096bd8063c6c602744d4476d5eb7e0d34e90
3da74687e42de7d33a8e75df9bd64374e650f75e 22-Feb-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Add profman tool: responsible to process profiles"

Needs a profile_assistant_test fix.

Bug: 26719109
Bug: 26563023

This reverts commit 6caefd983a800a063b219f1d3ed71b1416cecd70.

Change-Id: Ibdeb7385737dd7846ed861e0a95f083abb9aa974
6caefd983a800a063b219f1d3ed71b1416cecd70 01-Feb-2016 Calin Juravle <calin@google.com> Add profman tool: responsible to process profiles

This pulls out profile parsing from dex2oat into a separate tool.
Some additional refactoring:
- better return codes
- dex2oat now accepts only one profile file

This is the first step towards support secondary dex files and
extracting profiles out of the code_cache directory.

Bug: 26719109
Bug: 26563023

(cherry picked from commit d81c289e58f4ced8ec7674fd377c356669f97227)

Change-Id: I34d408faa318e866e1a23d4d04c369131ee5012b
d81c289e58f4ced8ec7674fd377c356669f97227 01-Feb-2016 Calin Juravle <calin@google.com> Add profman tool: responsible to process profiles

This pulls out profile parsing from dex2oat into a separate tool.
Some additional refactoring:
- better return codes
- dex2oat now accepts only one profile file

This is the first step towards support secondary dex files and
extracting profiles out of the code_cache directory.

Bug: 26719109
Bug: 26563023
Change-Id: I364dad7e3beb22ef71c372739d5bcc490ae23270
31708b736a2d75a9eb21f51038a7703f84f95f31 05-Feb-2016 Calin Juravle <calin@google.com> Fix compiler driver gtest.

(cherry picked from commit 35c4e0b2ad573e820d6e9d461a571af300611d36)

Change-Id: Ia59f4463a6158f7a949debd7a93f35fa633cd36a
34900cc6d9a14fb29a51daca02fe4b3e47e1b64c 05-Feb-2016 Calin Juravle <calin@google.com> Store relative paths in the profile file

Bug: 26409579
Bug: 26080105

(cherry picked from commit f06d6bc0d083d383371aeb1f0d97249f3e20fc25)

Change-Id: I7eeea06e7df49a7f8af4c4cb71da58c21f1c185b
35c4e0b2ad573e820d6e9d461a571af300611d36 05-Feb-2016 Calin Juravle <calin@google.com> Fix compiler driver gtest.

Change-Id: I7c9204f5d791f667613ce3df8e9f74342444f685
f06d6bc0d083d383371aeb1f0d97249f3e20fc25 05-Feb-2016 Calin Juravle <calin@google.com> Store relative paths in the profile file

Bug: 26409579
Bug: 26080105
Change-Id: I45e6e382946a45129ed43d92768c7e870cf41aff
877fd963548a3175665bfef25b0d24bc0e5a0135 05-Jan-2016 Calin Juravle <calin@google.com> Improve profile processing

- allow file descriptors in addition to file names for profiles
- fix some minor issues (wrong comparison signs, unhandled errors)
- added gtests for profile_compilation_info, profile_assistant
and compiler_driver

Bug: 26080105
Change-Id: I136039fa1f25858399000049e48b01eafae54eb1
998c21661b5074c293cae818d0ab7c44dcda3a66 21-Dec-2015 Calin Juravle <calin@google.com> Perform profile file analysis in dex2oat

Dex2oat can accept now multiple profile files to drive a profile based
compilation. --profile-file and --reference-profile-file speficy a pair
of profile files which will be evaluated for significant differences
before starting the compilation. If the difference is insignificant
(according to some internal metric) the compilation is skipped and a
message is logged.

Multiple pairs of --profile-file and --reference-profile-file can be
specified. This effectively enables multi user support since profiles
for different users will be kept separately.

--reference-profile-file can be left out, case in which the decision is
solely based on --profile-file. If both flags are present, then their
repetition should form unique pairs.

If the compilation is performed and --reference-profile-file is given
then its data is merged with the data from the corresponding --profile-
file and saved back to the file.

If no profile flags are given, dex2oat proceeds as before and compiles
the dex files unconditionally.

As part of this change
- merge ProfileCompilationInfo and OfflineProfilingInfo under the same
object. There was no use to keep them separate anymore.
- SaveProfilingInfo now merges the data with what was in
the file before instead of overwriting it.

Bug: 26080105

Change-Id: Ia8c8b55587d468bca5179f78941854285426234d
5e2b971e468ca73a8e10a120730b3b6f17fad408 18-Dec-2015 Calin Juravle <calin@google.com> Assume the profile file was created before saving.

bug: 26080105
Change-Id: I9969a4abd8533614922076551fcbae2cdf695525
4d77b6a511659f26fdc711e23825ffa6e7feed7a 01-Dec-2015 Calin Juravle <calin@google.com> Save profile information in a separate thread.

Previously we would save the profiling information only when the app
was sent to background. This missed on an important number of updates
on the jit code cache and it didn't work for background processes.

Bug: 26080105

Change-Id: I84075629870e69b3ed372f00f4806af1e9391e0f
66f55237679db90cb0a0a265043a787932b466f8 08-Dec-2015 Calin Juravle <calin@google.com> Pass down to the runtime the application code paths.

When registering the app with the runtime the framework needs to pass
down the list of application code paths. This will be used by JIT to
know what profile info to persist.

This fixes the reliance on OatFileManager::GetPrimaryOatFile which may
produce inconsistent results based on external factors (i.e. class path
order or failing to compile the first dex file from the class path)

Bug: 26080105
Change-Id: Iadcebd2684fcd48569e8f76ef21bd4d117fedc05
226501b317e148aa8a8983355e85acb59c1eee83 11-Dec-2015 Calin Juravle <calin@google.com> Revert "Revert "Enable profiled guided compilation in dex2oat""

This reverts commit 2306ae0d412cc53cbf64877e4a8c37292dd907d8.

Change-Id: I50640009c2fac88ea703812b76549a0e8a6d7584
2306ae0d412cc53cbf64877e4a8c37292dd907d8 11-Dec-2015 Calin Juravle <calin@google.com> Revert "Enable profiled guided compilation in dex2oat"

The test still have some flakiness in it which didn't reproduce locally.

This reverts commit 500c9be1f261a8a95ae7a25f4f8084f43207f313.

Change-Id: I132aff62bf03c2f926aafde6869707573bae9b36
500c9be1f261a8a95ae7a25f4f8084f43207f313 25-Nov-2015 Calin Juravle <calin@google.com> Enable profiled guided compilation in dex2oat

- add parsing of the profile info saved during JIT.
- don't compile methods which are not part of the profile info.
- delete old profile hooks.
- add test for reading/writing profile. The test is disable in:
* interpreter modes: the test needs JIT.
* no-dex2oat/no-prebuild: we only save profiling info for the primary
oat file. In these modes we don't create oat files and thus nothing
is saved.

Bug:26080105

Change-Id: Ifdc63dc9d4b537fc79e54c3edc3ae3a462bc30fb
9fdb129b90c9a985f606f9d95627b4852171dc11 02-Dec-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Enable profiled guided compilation in dex2oat"

Test has flakes:

+art F 30865 30865 art/runtime/java_vm_ext.cc:466] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0x80
+art F 30865 30865 art/runtime/java_vm_ext.cc:466] string: '��gy�'
+art F 30865 30865 art/runtime/java_vm_ext.cc:466] input: '<0x80> 0xd8 0x67 0x79 0x8e 0x7f'
+art F 30865 30865 art/runtime/java_vm_ext.cc:466] in call to NewStringUTF
+art F 30865 30865 art/runtime/java_vm_ext.cc:466] from java.lang.String Main.getProfileInfoDump(java.lang.String, java.lang.Class, java.lang.Class)

This reverts commit 27e17fd81cc30e16e86c9c15498cae7f920c9dfe.

Change-Id: Id224b5970c3620c4c71fc0d39ed4a2e4755e5f29
07f78c828940743376676e8c0c5e84321ce88ee2 02-Dec-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Disable 554-jit-profile-file for unsupported test modes"

Test has flakes:

+art F 30865 30865 art/runtime/java_vm_ext.cc:466] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0x80
+art F 30865 30865 art/runtime/java_vm_ext.cc:466] string: '��gy�'
+art F 30865 30865 art/runtime/java_vm_ext.cc:466] input: '<0x80> 0xd8 0x67 0x79 0x8e 0x7f'
+art F 30865 30865 art/runtime/java_vm_ext.cc:466] in call to NewStringUTF
+art F 30865 30865 art/runtime/java_vm_ext.cc:466] from java.lang.String Main.getProfileInfoDump(java.lang.String, java.lang.Class, java.lang.Class)

This reverts commit 33bcb0734db9ccfdd0e8bb8fba77c1e0a1904090.

Change-Id: I3fe236acb196e847b7845802e436b0ee893144e6
32501800e2e72902ddcf6f93bf7f71a843dc8fac 02-Dec-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Fix the order in which profiled methods are dumped."

Test has flakes:
+art F 30865 30865 art/runtime/java_vm_ext.cc:466] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal start byte 0x80
+art F 30865 30865 art/runtime/java_vm_ext.cc:466] string: '��gy�'
+art F 30865 30865 art/runtime/java_vm_ext.cc:466] input: '<0x80> 0xd8 0x67 0x79 0x8e 0x7f'
+art F 30865 30865 art/runtime/java_vm_ext.cc:466] in call to NewStringUTF
+art F 30865 30865 art/runtime/java_vm_ext.cc:466] from java.lang.String Main.getProfileInfoDump(java.lang.String, java.lang.Class, java.lang.Class)

This reverts commit 1d2760bb6128f1bd623824ebcef5784d81b2ab85.

Change-Id: I84e478d715c1496892fa800778fc454d15e5d2c5
33bcb0734db9ccfdd0e8bb8fba77c1e0a1904090 02-Dec-2015 Calin Juravle <calin@google.com> Disable 554-jit-profile-file for unsupported test modes

Reasons:
- interpreter modes: the test needs JIT.
- no-dex2oat/no-prebuild: we only save profiling info for the primary
oat file. In these modes we don't create oat files and thus nothing is
saved.

Change-Id: I3b0574c0f39ee0db20803c021a6e827d96acd7c0
1d2760bb6128f1bd623824ebcef5784d81b2ab85 02-Dec-2015 Calin Juravle <calin@google.com> Fix the order in which profiled methods are dumped.

This fixes flacky behaviour in tests.

Change-Id: I1b79111ad739ca9f3936110bce6719335b5ea112
27e17fd81cc30e16e86c9c15498cae7f920c9dfe 25-Nov-2015 Calin Juravle <calin@google.com> Enable profiled guided compilation in dex2oat

- add parsing of the profile info saved during JIT
- don't compile methods which are not part of the profile info.
- delete old profile hooks

Change-Id: I45a13c3aeb36265d335e57cd160b9ea0fab3cbb5
31f2c155975c5794d481df03eb0947cb48d2c6b5 23-Oct-2015 Calin Juravle <calin@google.com> Save jit profiling info to file.

Currently saves only the hot method references and omits the inline
cache.

Change-Id: I79e91f855f6b52dc19a9a86662604f2eee16613c