summaryrefslogtreecommitdiff
path: root/runtime
AgeCommit message (Collapse)Author
2022-05-13art: optimization of gc load, reduce gc in some scenarioszengkaifa
1. NativeAlloc GC: Increase the count of the number of small native memory allocations. 2. CollectTransition GC: App's allocations (since last GC) more than the threshold then do GC when the app was in background. If not then don't do GC. Bug: 200116730 Change-Id: Id2977f05eb249691326955e6f2424d4e5e08b417
2022-05-13Reland "Trigger fewer GCs during startup""Hans Boehm
This reverts commit da90ab4ebb233a0f38f7bb226892244c048ae275. PS1 is identical to aosp/1653767 : Instead of explicitly triggering a GC after two seconds, gradually reduce the GC triggering threshold. In particular, a small process that almost immediately goes into the background should GC only as part of the transition to background. Ensure that the first collection is a full (technically "partial", non-sticky) gc, that tries to collect everything but zygote space. There should be very few allocated objects except in zygote space. Clarify the concurrency rules for accessing concurrent_start_bytes_ in the process. PS2: Adds code to explicitly trigger a GC if none has been triggered in the first 30 seconds or so. For AOSP, this happens in seven processes. No longer condition any of this on the CC collector. I don't see why that should matter. Trigger the low-allocation GC above even in low memory mode. I think we want to especially do it in that case. We were previously not doing that, probably it was tied to increasing the heap size. Test: Build and boot AOSP. Test: Manual log inspection with extra logging. Bug: 181351667 Bug: 197780496 Change-Id: I822224bef3e97c2ab1f803eafe97bcdd21b9cd4e
2021-12-19Merge s-mpr-2021-12-05Eric Arseneau
Change-Id: Ie30e6decc687dd07c62f61760ea1900c619d6ce0
2021-12-06Merge mpr-2021-11-05Eric Arseneau
Change-Id: Icd1f32d5d274239e323872ccd98a69f5b83add9b
2021-10-29Allow PROT_EXEC on the zygote mappings when falling back to ashmemNicolas Geoffray
Because we now protect the mappings before creating the executable one, we need to also allow PROT_EXEC on an ashmem region. Test: manually change code to use ashmem, build, see that JIT is created. Bug: 202999239 Merged-In: I9f2944c45f4ff607c7e341552c82138bfe13cca4 (cherry picked from commit 8c63ce27d4d3e87f535769976e9b9185fa372b9b) Change-Id: I8a5e9655e6c40404389344e78c21b0ebd5a1a4b9 (cherry picked from commit 94e2fc9465e9a2c9d62902b09ed9a18d9250ccd8)
2021-10-05Change order of creation of JIT mappings. am: c95b630423Nicolas Geoffray
Original change: https://googleplex-android-review.googlesource.com/c/platform/art/+/15951443 Change-Id: Ide27dbe61bff2affd67a3cb02fc1bc09dfb2f393
2021-10-05Change order of creation of JIT mappings.Nicolas Geoffray
To ensure we don't create mappings that can later be turned into writable mappings. Ignore-AOSP-First: b/200284993 Test: jit_memory_region_test Test: device booting Bug: 200284993 Change-Id: I5160e61d287207563af57b71d50b08364ca892a0
2021-10-05Merge SP1A.210812.016Haamed Gheibi
Change-Id: Iaf4bb73cf665ece167027bf375605ea70dd16975
2021-09-28Fix android.security.cts.FileDescriptorTest#testCLOEXECHu Wang
When ART is mainline, it will create memFd boot-image-methods.art without MFD_CLOEXEC. Add MFD_CLOEXEC flag when create boot-image-methods.art memFd. Bug: 197498527 Test: run cts CtsSecurityTestCases pass CRs-Fixed: 3034193 Change-Id: If941c036f7adb598d67ec2b2c5bc4cb24994e3a1 (cherry picked from commit 3326fcea1ead5d5d360a053704faad27b6dd8c40)
2021-09-27Better isolate standalone ART gtests on device.Roland Levillain
Standalone ART gtests used to be installed in the same directory on device (`/data/local/tmp/nativetest`), which could be a race condition. In particular, some ART gtests are run as root (e.g. `art_standalone_dexoptanalyzer_tests`) and create the `/data/local/tmp/nativetest` directory with `root` ownership/permissions, preventing any subsequent ART gtest not run as root (e.g. `art_standalone_cmdline_tests`) from installing its artifacts in that directory. To prevent these issues, use a different directory on device (under `/data/local/tmp`) per standalone ART gtest. (cherry picked from commit d8c0ac264f606bf0c69781388ca6048eb0a4b55f) (cherry picked from commit 58a79873e94dbe4a168221fc95b641dbf8cd3e3e) Test: atest art_standalone_dexoptanalyzer_tests \ && atest art_standalone_cmdline_tests Test: atest art_standalone_\*_tests Bug: 194403904 Bug: 162834439 Change-Id: I141c1676382b078c1441e5782b3dc77affafa3fc Merged-In: I141c1676382b078c1441e5782b3dc77affafa3fc
2021-09-24Always check for an exception after a class lookup.Nicolas Geoffray
This means we need to stop the lookup, as an exception is pending. (cherry picked from commit 36d182089a4ced3603c7cdcb61b2d92a5a76a471) Test: 831-unverified-bcp Bug: 195766785 Merged-In: I8aa65f6bbaae83eff0be7ca5d82e0c0a548b5b60 Change-Id: I3e414f75e7081eb93b8cb5af89859d25492edf10
2021-09-22Update .oat version after disabling partial LSE.Nicolas Geoffray
This will ensure we don't take any .oat file that has the bogus generated code. (cherry picked from commit 776a1c1447be1e504c2013c5d170d08ef4907d7f) (cherry picked from commit 8246b0cbfd4c5e19596e2dac0c1377c56f444d5f) Test: test.py Bug: 197981962 Merged-In: Ic14d18d310bdcd408c1f6e2777ef53a041fb2f12 Change-Id: Ic66ee1998f490c15b95279f3b4881f9581772190
2021-09-14Update .oat version after disabling partial LSE.Nicolas Geoffray
This will ensure we don't take any .oat file that has the bogus generated code. (cherry picked from commit 776a1c1447be1e504c2013c5d170d08ef4907d7f) (cherry picked from commit 8246b0cbfd4c5e19596e2dac0c1377c56f444d5f) Test: test.py Bug: 197981962 Merged-In: Ic14d18d310bdcd408c1f6e2777ef53a041fb2f12 Change-Id: Ic66ee1998f490c15b95279f3b4881f9581772190
2021-09-13vdex: add checks in the event of file corruption.Nicolas Geoffray
It's unclear yet why the vdex files are being corrupted. But system server, which is reading these vdex files should be robust to any vdex corruption. Bug: 199309980 Bug: 199395272 Test: test.py (cherry picked from commit a74a7071490e47e1b5590cc19726f1620fd0ee43) (cherry picked from commit a35586522fd398fb2845a9ae8427aa4853f155be) Merged-In: Ia85ab8b23a0be4069cfa058a86fdf561f1ceb432 Change-Id: I558238fd7cc0d7bc2f89f989ad53db8eb7a2eb24
2021-09-07Add a lock contention palette hook.Nicolas Geoffray
Bug: 196334695 Test: m Change-Id: Id87cfc30957baa5e575947fc69d6f307e843dcf8 Merged-In: Id87cfc30957baa5e575947fc69d6f307e843dcf8 (cherry picked from commit e261356db98dc27bcec4048b3eaf9834864169aa) (cherry picked from commit 977054f46299a940e4db186a99f91b14dd735576)
2021-09-04Replace weak-ref access disable checkpoint with STW pauseLokesh Gidra
Disabling weak-ref access in ConcurrentCopying collector can lead to deadlocks. For instance, if mutator M1 acquires W1 mutex and then participates in the checkpoint and then gets blocked in getReferent(), waiting for the gc-thread to finish reference processing. Mutator M2 waits for M1 to release W1 so that it can acquire the mutex before participating in the checkpoint. On the other hand, GC-thread waits for M2 to finish checkpoint. A STW pause avoids the deadlock by ensuring that mutators are not blocked on weak-ref access before the pause, and GC-thread can make progress after the pause in reference processing. Bug: 195336624 Bug: 195261575 Test: art/test/testrunner/testrunner.py Merged-In: I03d6bcd4d53f37ec84064edd8292951d30f48eaf Change-Id: I03d6bcd4d53f37ec84064edd8292951d30f48eaf (cherry picked from commit 555eefef9a27995ef341cdf44ed60c61953e2e3f) (cherry picked from commit 16f1ef2d09e82d419a2a51ac3d7f7fb7e9553dd1)
2021-09-04Do not acquire runtime_shutdown_lock_ in Abort()Hans Boehm
Abort can be called, particularly in OOM situations, when we already hold the lock. Abort() should minimize the locks it acquires. This is intended to be a minimal, low-risk change. Generated code should be essentially unchanged, except in Abort(). This does not address the question of whether IsShuttingDown really needs to lock at all. Test: Build and boot AOSP. Bug: 195884830 Merged-In: I0ee4a7ca7348153436fec0fecc1d1f2ca1f7a30c (cherry picked from commit 70aa29e2d93ba66e71a8ff88c9210719efae1c31) Change-Id: I9d7dca18bc480a37197bca3205834da13321cc58 (cherry picked from commit aefbed79a1e37d6901228b0a7e03ce63c2495703)
2021-09-04Improve suspension timeout diagnostic and fix raceHans Boehm
Fix a data race on state_and_flags. Since the access was volatile and there are system calls in the loop, this is extremely unlikey to have casused the bug here, but ... So, assuming this is still broken, produce more informative output once we time out. Remove unused argument from SuspendThreadByPeer(). It made the logic more complicated and made it harder to reason about correctness. Remove dead code after LOG(FATAL, ...) Bug: 181778559 Test: TreeHugger, temporarily paste log message into hotter path. Merged-In: I6f3455925b3a3f4726a870150aeb54ea60a38d67 (cherry picked from commit 9d27fbc8ced914f4726187920a7794b07eca3e71) Change-Id: Ia3f04153fb0a4f1b899fb0f68a6121728f89cb91 (cherry picked from commit 116203735734738cbfdffc2163b08b1707089f9c)
2021-09-04Fix missing MsToNs in profile saver.Nicolas Geoffray
Test: test.py Bug: 194880260 Ignore-AOSP-First: cherry pick Change-Id: I30b5608ef891805754986a0e00207e017280a97e Merged-In: I30b5608ef891805754986a0e00207e017280a97e (cherry picked from commit 3bc03531d1ae5cbe5b0a7ac34c10d5c51f20f233) (cherry picked from commit e806799b94606c0d108de1f3e9f440e0a908a197)
2021-09-03Fix android.security.cts.FileDescriptorTest#testCLOEXECHu Wang
When ART is mainline, it will create memFd boot-image-methods.art without MFD_CLOEXEC. Add MFD_CLOEXEC flag when create boot-image-methods.art memFd. Bug: 197498527 Test: run cts CtsSecurityTestCases pass Merged-In: If941c036f7adb598d67ec2b2c5bc4cb24994e3a1 (cherry picked from commit 3326fcea1ead5d5d360a053704faad27b6dd8c40) Change-Id: Icfc2420e8e9d3f61f5e3f2eb5bfc53108c2c251b (cherry picked from commit 0857789b5b09bccc977f712a071c7b68bfccae05)
2021-08-20Revert "Make ClassLinker::DumpForSigQuit exclude gc"Hans Boehm
This reverts commit 825e82972fe46fdb0419c42bd7df102df1989ff9. Reason for revert: Not clear it fixed anything. See b/195261575 . Bug: 195261575 Test: TreeHugger Change-Id: I6fd0d10b5134037d2df399abbbaa3302454f0e4f Merged-In: I6fd0d10b5134037d2df399abbbaa3302454f0e4f (cherry picked from commit fb3ad7201bf2d9154862e347e960df376ac04c3c) (cherry picked from commit 883e103f04064957a5e8880890577fe556e38db9)
2021-08-19Revert "Make ClassLinker::DumpForSigQuit exclude gc"Hans Boehm
This reverts commit 825e82972fe46fdb0419c42bd7df102df1989ff9. Reason for revert: Not clear it fixed anything. See b/195261575 . Bug: 195261575 Test: TreeHugger Change-Id: I6fd0d10b5134037d2df399abbbaa3302454f0e4f Merged-In: I6fd0d10b5134037d2df399abbbaa3302454f0e4f (cherry picked from commit fb3ad7201bf2d9154862e347e960df376ac04c3c) (cherry picked from commit 883e103f04064957a5e8880890577fe556e38db9)
2021-08-18Revert "Make ClassLinker::DumpForSigQuit exclude gc"Hans Boehm
This reverts commit 825e82972fe46fdb0419c42bd7df102df1989ff9. Reason for revert: Not clear it fixed anything. See b/195261575 . Bug: 195261575 Test: TreeHugger Change-Id: I6fd0d10b5134037d2df399abbbaa3302454f0e4f Merged-In: I6fd0d10b5134037d2df399abbbaa3302454f0e4f (cherry picked from commit fb3ad7201bf2d9154862e347e960df376ac04c3c)
2021-08-13Add `Sdk31ModuleController` support to ART run-tests and gtests.Roland Levillain
This in order to run these tests only if the device under test is SDK version 31 (Android 12) or above. Test: m mts && mts-tradefed run commandAndExit mts-art Bug: 195178963 Bug: 184696655 Bug: 181724969 Ignore-AOSP-First: API level 31 not in AOSP yet Change-Id: I4bb6405281809863562e5bbbfc1189f227f2508d
2021-08-11Merge SP1A.210811.001Brian Orr
Change-Id: If9365356e1769b9cf35e6c0d93324a254b04a53f
2021-08-06Make ClassLinker::DumpForSigQuit exclude gcHans Boehm
Otherwise we can get into a deadlock because we hold a critical lock while waiting for weak reference access, thus potentially preventing other threads from suspending properly to reenable weak reference access. Bug: 195261575 Test: TreeHugger Change-Id: Ideb6199f597c4e06741c79bb2812661d88a42669 Merged-In: Ideb6199f597c4e06741c79bb2812661d88a42669 (cherry picked from commit 825e82972fe46fdb0419c42bd7df102df1989ff9)
2021-08-04Merge SP1A.210803.001Scott Lobdell
Change-Id: Idc04ece0ad150689c171e249f36ca24ca40def84
2021-07-23Merge SP1A.210715.002Scott Lobdell
Change-Id: Ie774efe4ce18903a2aa22c04ff3fabdd31943caa
2021-07-23Delete almost correct CHECKHans Boehm
The bytes_allocated + freed_bytes >= bytes_allocated_before_gc CHECK could fail if we expand space use as a result of copying, and perhaps for other reasons. Delete it, and have the later code deal with the fact that it may not hold. Test: Build and boot AOSP. Bug: 194263989 Merged-In: I9188a7cd13661c16b1b69a90d1f03d60548db217 Change-Id: I9188a7cd13661c16b1b69a90d1f03d60548db217 (cherry picked from commit c9acd230431acf786b5597cbbc2da57e88eb0435)
2021-07-22Merge "art: add kryo785 architecture variant" into s-keystone-qcom-devTreehugger Robot
2021-07-13Add support for standalone ART gtests to MTS.Roland Levillain
This change: - adds standalone ART gtests to test suite `mts-art`; - adds `MainlineTestModuleController` support to standalone ART gtests. This in order to have these tests run in a Mainline context only when the ART Module (either `com.google.android.art` or `com.android.art`) is installed on the test device. (cherry picked from commit 6a2e6893290eac83f59dac4ec5bc10abf985ae10) Test: m mts && mts-tradefed run commandAndExit mts-art Test: m mts && mts-tradefed run commandAndExit mts-art-shard-00 Bug: 193218514 Bug: 167385698 Change-Id: I97d9c00b7c10debff8c63e4ae75f90da02be271c Merged-In: I97d9c00b7c10debff8c63e4ae75f90da02be271c
2021-07-12Merge SP1A.210709.002Haamed Gheibi
Change-Id: I1c7af168aaa2da76cf462728130425e8dd8fc992
2021-07-12Fallback to version code in case lastUpdateMillis field is not populatedNikita Ioffe
Test: presubmit Bug: 193374411 Change-Id: I2006a1926c64cf01e12d82c90197b20f5cff9406 Merged-In: I2006a1926c64cf01e12d82c90197b20f5cff9406 (cherry picked from commit 5f2f289b64f163e491b9b53364ce04874f82b4e3)
2021-07-12Uncouple ART gtests from the ART APEX.Roland Levillain
Introduce standalone versions of ART gtests on target, not bundled with the ART APEX. So far ART gtests have always been built as debug artifacts (and linked against ART debug libraries). Make some adjustments in some of these tests so that they can also work as non-debug artifacts and be used with the Release ART APEX (which contains only non-debug artifacts). Newly added tests: * `art_standalone_cmdline_tests` * `art_standalone_compiler_tests` * `art_standalone_dex2oat_tests` * `art_standalone_dexdump_tests` * `art_standalone_dexlist_tests` * `art_standalone_dexoptanalyzer_tests` * Note: Requires root access to the device. * `art_standalone_libartbase_tests` * `art_standalone_libartpalette_tests` * `art_standalone_libdexfile_support_tests` * `art_standalone_libdexfile_tests` * `art_standalone_libprofile_tests` * `art_standalone_oatdump_tests` * `art_standalone_odrefresh_tests` * `art_standalone_profman_tests` * Note: Requires root access to the device. * Note: Some tests (2 out of 37) are failing in multi-ABI contexts and have been temporarily disabled. * `art_standalone_runtime_compiler_tests` * `art_standalone_runtime_tests` * Note: Some tests (16 out of 686) are failing and have been temporarily disabled. * Note: Some tests (4 out of 686) are failing in multi-ABI contexts and have been temporarily disabled. * `art_standalone_sigchain_tests` Tests not added: * `art_standalone_dexanalyze_tests` * Reason: ART binary `dexanalyze` is not part of the Release ART APEX. * `art_standalone_dexdiag_tests` * Reason: ART binary `dexdiag` is not part of the Release ART APEX. * `art_standalone_dexlayout_tests` * Reason: ART binary `dexlayout` is not part of the Release ART APEX. * `art_standalone_imgdiag_tests` * Reason: ART binary `imgdiag` is not part of the Release ART APEX. Tests not added (but present in AOSP): * `art_standalone_libartservice_tests` * Reason: Test `art_libartservice_tests` does not exist in this branch. * `art_standalone_libarttools_tests` * Reason: Test `art_libarttools_tests` does not exist in this branch. (cherry picked from commit f040914a122be86e280efe5e31af1168f2b7c72e) Test: atest -a art_standalone_cmdline_tests Test: atest -a art_standalone_compiler_tests Test: atest -a art_standalone_dex2oat_tests Test: atest -a art_standalone_dexdump_tests Test: atest -a art_standalone_dexlist_tests Test: atest -a art_standalone_dexoptanalyzer_tests Test: atest -a art_standalone_libartbase_tests Test: atest -a art_standalone_libartpalette_tests Test: atest -a art_standalone_libdexfile_support_tests Test: atest -a art_standalone_libdexfile_tests Test: atest -a art_standalone_libprofile_tests Test: atest -a art_standalone_oatdump_tests Test: atest -a art_standalone_odrefresh_tests Test: atest -a art_standalone_profman_tests Test: atest -a art_standalone_runtime_compiler_tests Test: atest -a art_standalone_runtime_tests Test: atest -a art_standalone_sigchain_tests Test: atest -a art_standalone_\*_tests Test: m art_chroot && atest ArtGtestsTargetChroot Bug: 193218514 Bug: 162834439 Bug: 162734417 Change-Id: I8beda9159d48c4ca495698357dc3bd95e3ff84d5 Merged-In: I8beda9159d48c4ca495698357dc3bd95e3ff84d5
2021-07-12Rename some ART gtest related Soong modules.Roland Levillain
ART gtests currently link with the debug ("d") versions of ART libraries. The gtests themselves and their libraries are compiled as debug artifacts. For the sake of consistency, perform the following renaming of ART gtest related Soong modules: * `libart-compiler-gtest` -> `libartd-compiler-gtest` * `libart-dex2oat-gtest` -> `libartd-dex2oat-gtest` * `libart-gtest-defaults` -> `libartd-gtest-defaults` * `libart-gtest` -> `libartd-gtest` * `libart-runtime-gtest` -> `libartd-runtime-gtest` * `libartbase-art-gtest` -> `libartbased-art-gtest` As we plan to introduce non-debug ("non-d"), standalone versions of ART gtests in the context of uncoupling ART (target) gtests from the ART APEX (b/162834439), this renaming will help us, as we'll be able to use the old names of a "d" module for the corresponding "non-d" version. (cherry picked from commit 55ffe7fa9ead8b501a756bb53f2571e3e7602f5e) Test: mmma art Test: Run ART gtests on host and target Test: env OVERRIDE_TARGET_FLATTEN_APEX=false art/build/apex/runtests.sh Test: env OVERRIDE_TARGET_FLATTEN_APEX=true art/build/apex/runtests.sh Bug: b/193218514 Bug: b/162834439 Change-Id: I4ca27a7f445a760398f41a9e60a7008d77294505 Merged-In: I4ca27a7f445a760398f41a9e60a7008d77294505
2021-07-09Use lastUpdateMillis of an apex for ART versioning.Nicolas Geoffray
Test: m Bug: 192647837 Merged-In: Ide7e5a1dbfe85c679313bb6c8e6788137b138f42 (cherry picked from commit ef10f42bf21cddff00972c8b47aaf79528cbe3b5) Change-Id: Id70f75752cb80c6625ab1f8b8cde4c0f00ccd58d
2021-07-07Set compilation reason in vdex-only OatFile.Nicolas Geoffray
Test: test.py Bug: 192408935 Merged-In: Ib87ea546876bfb4c6bf87b60f5a4f8aa306bd186 (cherry picked from commit b17c908047a2df675ecb4bd0aa2b21114376bbae) Change-Id: I81ea447c12250c24fa88205dac9c1289b15faba8
2021-07-05Add -XX:ForceJavaZygoteForkLoop flagHans Boehm
Setting this to true effectively disables the zygote native fork loop, either for testing/measurement purposes, or as a fallback. Bug: 192020504 Test: Check logcat with and without the flag. Change-Id: I83c401d21ae2797442011d9ac6f23c78990920bd Merged-In: I83c401d21ae2797442011d9ac6f23c78990920bd (cherry picked from commit 1792c6ff1c9838dfbe948be124dc1a8501fc6636)
2021-07-02runtime: add -Xdeny-art-apex-data-filesOrion Hodson
This option prevents the runtime from loading AOT artifacts installed in /data/misc/apexdata/com.android.art. (cherry picked from commit 971068dcaf5955634679dbfaf7b562ed52aff772) Bug: 192049377 Test: manually adding option and running odsign_e2e_tests Test: adding option and looking at proc/maps for system_server and zygote Merged-In: I56c7ce55b64de72faf39a06238089fe4b6b84b88 Change-Id: Iacce98009c51b936149435cfb70a3f744a122031
2021-07-02Cache boot classpath checksums at runtime init.Nicolas Geoffray
To speed up oat file checksums check. Test: test.py Bug: 191828947 (cherry picked from commit bbdb1ed109532f42949f84194e7717453f2f37f6) Change-Id: I2e469793fccac543517a936dd764530ac1c1d2c7 Merged-In: I2fe97a5626220470ec3edf457a3a24e7d50ce6d7
2021-07-01Add special control flags for system server reportingCalin Juravle
System server is important enough to have its own config. Test: gtest Bug: 170149255 Merged-In: I33741751717ef3474f3a89e8fda8ad19b9e952ed Change-Id: I33741751717ef3474f3a89e8fda8ad19b9e952ed (cherry picked from commit cf43650ab1529d13b12e808c59ec7c4f91cb35fd)
2021-07-01Replace JIT total time histogram with total time counterCalin Juravle
We don't report histograms, so let's get the total time as a proxy to measure JIT activity. Test: gtest Bug: 170149255 Merged-In: I76911f5e7f93f00dc9f133e7f89a1045b31dedc7 Change-Id: I76911f5e7f93f00dc9f133e7f89a1045b31dedc7 (cherry picked from commit 9b996ce378e58f4699145721a1708732d5399a95)
2021-07-01Fix compiler filter / reason reporting and add the ISA to the metricsCalin Juravle
The compiler filter / reason reporting was not accurate for a variety of reasons. (e.g. reporting was only done at startup, it was relying on imprecise APIs and had errors in the logic). In order to keep track of the precise optimization status, this CL introduces the concept of AppInfo, which encapsulates the data about the application / system server code paths, their optimization status and possible other metadata (e.g. profiles). To populate it, we rely on 2 distinct events: 1) The framework calling VMRuntime#registerAppInfo to inform the runtime about the applications code paths and their types (e.g. primary, split, secondary). 2) Class loading, when we can determine the actual optimization status like filters, reasons, and whether or not we can load the odex files. These events may happen in any order so we could deal with a partial state at some point in time, but in the majority of cases they always happen at Class Loading, followed by RegisterAppInfo. This CL also deletes the OatFileManager#getPrimaryOatFile which was a misleading API as it didn't work in most cases. It also adds more tests to the metrics/reporting infra for previous missing or unimplemented cases. Test: gtest Bug: 170149255 Merged-In: If0a7a25d06ff6fb89fe4861139b7dee61c05814d Change-Id: If0a7a25d06ff6fb89fe4861139b7dee61c05814d (cherry picked from commit c2753e6beec483b5b14161b6bbc8e0a86aef9397)
2021-06-30[metrics] Add total-gc-time and adjust other metricsLokesh Gidra
This change introduces the following: 1) Added total-gc-collection-time in ms as a counter so that, at anytime, we can know how much time is spent in GC. 2) Added MetricsAverage to report average of the given data point. 3) Changed mutator-paue-time to average, which makes more sense. Also it is renamed to world-stop-time. 4) Added averages of gc-throughputs. 5) Removed gc-meta-data-size metric as we don't capture it normally due to the high cost of capturing this data. Test: Observe pitot data Bug: 191404436 Merged-In: I9da7f8c588ac4b42414beedb1b4004e0ac4b5fc2 Change-Id: I9da7f8c588ac4b42414beedb1b4004e0ac4b5fc2 (cherry picked from commit f368641c5bd373749194259409dc467df7a77edb)
2021-06-30Avoid marking proxy class as erroneous twice.Vladimir Marko
This code path was missed in https://android-review.googlesource.com/102184 . (cherry picked from commit a4d28dd66683c1bc27ad936d30aee71e73b084db) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 192246059 Merged-In: Ie41c3d55b76667b186dc47999e024372669764f9 Change-Id: I17b24d9d0b71959e778376fa6ef4fe2dc482b122
2021-06-25[metrics] Add GC-work throughput metricsLokesh Gidra
Track work done (bytes processed) per second by the GC. Some other minor changes: 1) Adjusted ConcurrentCopying class member's order to make access to them more cache-access friendly. Counters accessed by GC-thread should not be in the same cacheline as the one containing counters meant for mutators, if either of the two modify those counters. 2) Increased max to 10'000 for throughput histograms in case the throughput is > GB/s Bug: 191404436 Test: manual Merged-In: Iefaf1106690b6bae670a3a917f61194b3fcacfe0 Change-Id: Iefaf1106690b6bae670a3a917f61194b3fcacfe0 (cherry picked from commit 7f0473851d9a8d5644fde8c483390a985c238433)
2021-06-24Merge SP1A.210624.001Scott Lobdell
Change-Id: I3bf08300e39810c6d0486ad966137ad9d42af7b1
2021-06-24Faster BCP checksum verification.Vladimir Marko
Avoid opening dex files for updatable BCP components. Just collect the checksums from jar files using the `DexFileLoader::GetMultiDexChecksums()` API. (cherry picked from commit e020b7f4afc4d99cddfd52b3587280be9e3afd5d) Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 191828947 Merged-In: Ib737fabc832c56bffef8a98382f689aabe588bd2 Change-Id: I23b6adc30c57182c56c713da94a77fe65c15bb45
2021-06-24Clean up ART APEX manifests.Martin Stjernholm
manifest-art.json: Rely on the build system to populate all required libs. Besides some duplicate entries, this drops libicuuc.so, libicui18n.so, and libneuralnetworks.so from the required list. None of those libraries are dependencies of the ART module itself, and hence don't get loaded from the ART namespace. They used to be necessary before linkerconfig supported creating links for JNI libs and from public.libraries.txt, and when libnativeloader still defaulted to the ART namespace for loading such libs. test_apex_manifest.json: Used by test_com.android.art and should be identical to manifest-art.json except for the version number. Besides the above, this file contained several stale libraries. Also try to configure proper runtime_libs dependencies for libart(d) for the things it dlopen's from the ART namespace, although most libraries cannot be listed there for various reasons. Cherry-picked from https://r.android.com/1742176. Test: m droid deapexer deapexer info \ out/target/product/vsoc_x86_64/system/apex/com.android.art.capex Compare the output before and after this CL. Test: m test_com.android.art deapexer deapexer info \ out/target/product/vsoc_x86_64/obj/ETC/test_com.android.art_intermediates/test_com.android.art.apex Compare the output before and after this CL. Bug: 184148353 Change-Id: I0d9c2a090702a95551208aad4be97ea867004a3c Merged-In: I0d9c2a090702a95551208aad4be97ea867004a3c
2021-06-23Add sampling support in the metrics reporterCalin Juravle
The sample rate percentage can be configured via 2 runtime flags (MetricsReportingMods and MetricsReportingNumMods). A runtime session will report metrics if and only if its session id % MetricsReportingNumMods < MetricsReportingMods. A value of 0 on the mods will effectively disable reporting, while configuring MetricsReportingMods to be equal to the MetricsReportingNumMods will enable reporting in all cases. Test: gtest Bug: 170149255 Merged-In: Ie1353e4fc0ff695fc627696145d95e9ccd3c6a94 Change-Id: Ie1353e4fc0ff695fc627696145d95e9ccd3c6a94 (cherry picked from commit 17e0b652b59b0f7ebc821c3a86036e86079642bb)