Accurate, representative profiles are required. Google reports gains of around 10% in microbenchmarks and 5% in larger real-world workloads.
- Kernel 6.13 or newer
- Clang/LLVM 19 or newer (
llvm-profgenandllvm-profdata) llvm-propellerinstalled for Propellerllvm-boltandperf2boltinstalled for BOLT- BOLT currently supports x86-64 kernels 7.1 and 7.2 in linux-tkg
perfinstalled and working with the running kernel; AMD profiling requiresperfbuilt withlibpfmsupport
- Run the documented commands from the root of the linux-tkg source tree.
- The helper
generate-profile.shautomatically records the appropriate perf event and saves the profile in~/.config/frogminer, creating the directory if needed. - Keep all build inputs unchanged across kernel builds, including
_compileroptlevel,_processor_opt,_lto_mode,_cpusched, the remaining configuration, sources, patches, and compiler version. - Each profile option points to its profile;
_llvm_propeller_profileis the prefix of the two files created in step 4, not a separate file.
References:
- Linux kernel AutoFDO documentation
- Linux kernel Propeller documentation
- LLVM BOLT guide for the Linux kernel
Set in customization.cfg:
_compiler="llvm"
_lto_mode="thin"
_llvm_autofdo="pass1"Automatic: _llvm_propeller="false", _debugdisable="false", _STRIP="false"; ignores
_llvm_autofdo_profile and _llvm_propeller_profile
Build with the normal command for your distribution:
# Arch
makepkg -si
# Other supported distributions
./install.sh installBoot the new kernel.
Run the helper as your normal user:
./optimization/generate-profile.sh autofdoThe default recording lasts 600 seconds. Pass a different duration in seconds:
./optimization/generate-profile.sh autofdo 1800Keep the system under representative load for the complete recording.
For example, spend about 600 seconds each:
- Playing games
- Compiling or running benchmarks
- Using normal desktop, network, and file workloads
The sleep command only sets the duration; perf records system-wide activity.
Output:
~/.config/frogminer/tkg.afdo
For AutoFDO-only, set _llvm_propeller="false" and use this as the final build.
To build AutoFDO + Propeller, set in customization.cfg:
_llvm_autofdo="pass2"
_llvm_autofdo_profile="~/.config/frogminer/tkg.afdo"
_llvm_propeller="pass1"Automatic: _debugdisable="false", _STRIP="false"; ignores
_llvm_propeller_profile
Build with the normal command for your distribution:
# Arch
makepkg -si
# Other supported distributions
./install.sh installBoot the new kernel.
After booting the kernel built in step 3, run:
./optimization/generate-profile.sh propellerThe default recording lasts 600 seconds. To record for 1800 seconds:
./optimization/generate-profile.sh propeller 1800Use the same representative workloads during the complete Propeller recording.
Output:
~/.config/frogminer/tkg-propeller_cc_profile.txt
~/.config/frogminer/tkg-propeller_ld_profile.txt
The helper creates both files using the default prefix
~/.config/frogminer/tkg-propeller.
Set:
_llvm_autofdo="pass2"
_llvm_autofdo_profile="~/.config/frogminer/tkg.afdo"
_llvm_propeller="pass2"
_llvm_propeller_profile="~/.config/frogminer/tkg-propeller"
# optional; allowed again
_STRIP="true"pass2 means that the configured profiles must be used:
- If the AutoFDO profile is missing, both AutoFDO and Propeller are disabled.
- If only a Propeller profile is missing, AutoFDO remains enabled and Propeller is disabled.
Build and install the kernel once more. The final build must report both the AutoFDO and Propeller profiles.
Build with the normal command for your distribution:
# Arch
makepkg -si
# Other supported distributions
./install.sh installBoot the new AutoFDO + Propeller build kernel! 🚀
BOLT optimizes the linked vmlinux after AutoFDO and Propeller. It needs
one profiling build and one final build.
Keep the final compiler profile settings from step 5 and add:
_llvm_bolt="pass1"_debugdisable="false" and _STRIP="false" are forced automatically. Build,
install, and boot this kernel.
Do not rebuild or change its configuration before creating the BOLT profile.
The helper needs the exact unstripped vmlinux from this running kernel. The
default path is:
/lib/modules/$(uname -r)/build/vmlinux
./optimization/generate-profile.sh boltThe default recording lasts 600 seconds. For 1800 seconds at a lower sampling frequency:
BOLT_FREQUENCY=1000 ./optimization/generate-profile.sh bolt 1800Output:
~/.config/frogminer/tkg.fdata
If the matching vmlinux is stored elsewhere, specify it explicitly:
VMLINUX=/path/to/pass1/vmlinux ./optimization/generate-profile.sh boltKeep every other build setting unchanged and change only:
_llvm_bolt="pass2"
_llvm_bolt_profile="~/.config/frogminer/tkg.fdata"Build and install once more. The build must report the BOLT profile and
BOLT vmlinux. Boot the final kernel.