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

BenchmarkImprovement
Boot time2.6%
Cold App launch time3.7%
Binder-rpc9.4%
Binder-addints31.9%
Hwbinder16.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 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.
  1. 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 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.
  1. Record ETM data while running app crawling and app launching.