blob: e77bd6e42bca80b60af41321fa6a2a78fcc61a53 [file] [view]
# AutoFDO profiles for Android common kernels
This directory contains AutoFDO profiles for Android common kernels. These profiles can be used to
optimize kernel builds for specific architectures and kernel versions.
## kernel.afdo
kernel.afdo is an AArch64 kernel profile collected on kernel version 6.12.18 (
SHA fbd1fef4d7283d210845f8609599efd53c0905a4, build server ID 13287522) using Pixel 6.
### Performance improvements
| Benchmark | Improvement |
| --------------------- | ----------- |
| Boot time | 2.6% |
| Cold App launch time | 3.7% |
| Binder-rpc | 9.4% |
| Binder-addints | 31.9% |
| Hwbinder | 16.5% |
| Bionic (syscall_mmap) | 7.1% |
| Bionic (pthread) | 3.3% |
| Bionic (stdio) | 3.7% |
| Bionic (all) | 3.4% |
Benchmark results were tested on Pixel 6.
To test a kernel prebuilt with the AutoFDO profile, navigate to [Android build server](
https://ci.android.com/builds/branches/aosp_kernel-common-android16-6.12/grid) and download
the kernel prebuilts under the `kernel_aarch64_autofdo` target.
## Steps to reproduce the profile
A kernel profile is generated by running app crawling and app launching for top 100 apps from Google
Play Store. While running, we collect ETM data for the kernel, which records executed instruction
stream. Finally, we merge and convert ETM data to one AutoFDO profile.
1. Build a kernel image and flash it on an Android device
* The source code and test device used to generate each profile are described above.
* We use a Pixel device. But using other real devices should get a similar profile.
2. Run app crawling and app launching for top 100 apps
* Add a gmail account on the test device. Because app crawler can use the account to automatically
login some of the apps.
* We run [App Crawler](https://developer.android.com/studio/test/other-testing-tools/app-crawler)
for one app for 3 minutes, and run it twice.
* We run app launching for one app for 3 seconds, and run it 15 times. After each running, the
app is killed and cache is cleared. So we get profile for cold app startups.
3. Record ETM data while running app crawling and app launching.
* We use cmdline `simpleperf record -e cs-etm:k -a` to [record ETM data for the kernel](https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/collect_etm_data_for_autofdo.md).