History log of /art/runtime/jit/offline_profiling_info.h
Revision Date Author Comments
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
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
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
35c4e0b2ad573e820d6e9d461a571af300611d36 05-Feb-2016 Calin Juravle <calin@google.com> Fix compiler driver gtest.

Change-Id: I7c9204f5d791f667613ce3df8e9f74342444f685
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
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
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