summaryrefslogtreecommitdiff
path: root/compiler/optimizing/optimizing_compiler_stats.h
diff options
context:
space:
mode:
author Jiakai Zhang <jiakaiz@google.com> 2025-01-16 03:40:18 -0800
committer Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2025-01-17 10:02:58 -0800
commite2ec442bdfacf11519825aad51604e753c81ae30 (patch)
treeea9465bafa7fb20f7c7f3b352748572681c287f5 /compiler/optimizing/optimizing_compiler_stats.h
parent564ffff5b472f3a2dc38c2ab51a78f2d0e3f7ea8 (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/optimizing_compiler_stats.h')
0 files changed, 0 insertions, 0 deletions