diff options
| author | 2025-01-16 03:40:18 -0800 | |
|---|---|---|
| committer | 2025-01-17 10:02:58 -0800 | |
| commit | e2ec442bdfacf11519825aad51604e753c81ae30 (patch) | |
| tree | ea9465bafa7fb20f7c7f3b352748572681c287f5 /compiler/optimizing/graph_test.cc | |
| parent | 564ffff5b472f3a2dc38c2ab51a78f2d0e3f7ea8 (diff) | |
Flush profiles upon `pm dump-profiles`.
Before this change, `pm dump-profiles` only dumps the profiles that are
already on disk. Users can force the app to flush the profiles from the
memory to the disk by sending `SIGUSR1` to app processes, but this is
not ideal:
1. The shell user cannot send `SIGUSR1`, meaning it doesn't work on user
builds.
2. The user doesn't know when the profile save is done, so they need to
conservatively wait a long time after sending `SIGUSR1`, typically 1
second or more.
After this change, `pm dump-profiles` forces the app to flush the
profiles from the memory to the disk before dumping the profiles.
The profile flush is implemented in the following flow:
For each app process:
1. `artd` uses inotify(7) to listen to changes in
`/data/misc/profiles/cur/<user_id>/<package_name>/`
2. `system_server` sends `SIGUSR1` to the app process.
3. The app process always flushes profiles upon the signal and the
profile for the primary APK is always the last one to write.
4. `artd` waits for the profile for the primary APK to be written.
Bug: 254102312
Test: atest ArtServiceTests
Test: adb shell pm dump-profiles com.google.android.gms
Change-Id: I7ea2403f2ba6aa1fcbefa0f42a9ca51487aa7ef5
Diffstat (limited to 'compiler/optimizing/graph_test.cc')
0 files changed, 0 insertions, 0 deletions