@@ -148,11 +148,12 @@ _build_debug=${_build_debug-}
148
148
# 1. Compile Kernel with _autofdo=y and _build_debug
149
149
# 2. Boot the kernel in QEMU or on your system, see Workload
150
150
# 3. Profile the kernel and convert the profile, see Generating the Profile for AutoFDO
151
- # 4. Put the profile into the sourcedir and name the profile "perf.afdo" (You can also change the name in _autofdo_profile_name)
151
+ # 4. Put the profile into the sourcedir
152
+ # 5. Run kernel build again with the _autofdo_profile_name path to profile specified
152
153
_autofdo=${_autofdo-}
153
154
154
155
# Name for the AutoFDO profile
155
- _autofdo_profile_name=${_autofdo_profile_name-" perf.afdo " }
156
+ _autofdo_profile_name=${_autofdo_profile_name-}
156
157
157
158
158
159
# ATTENTION: Do not modify after this line
@@ -252,8 +253,14 @@ if [ -n "$_build_nvidia_open" ]; then
252
253
fi
253
254
254
255
# Use generated AutoFDO Profile
255
- if [ -n " $_autofdo " ] && [ -e " $_autofdo_profile_name " ]; then
256
- source+=(" $_autofdo_profile_name " )
256
+ if [ -n " $_autofdo " ]; then
257
+ if [ -n " $_autofdo_profile_name " ]; then
258
+ if [ -e " $_autofdo_profile_name " ]; then
259
+ source+=(" $_autofdo_profile_name " )
260
+ else
261
+ _die " You have specified _autofdo_profile_name, but file it refers to doesn't exist."
262
+ fi
263
+ fi
257
264
fi
258
265
259
266
# # List of CachyOS schedulers
@@ -477,7 +484,7 @@ prepare() {
477
484
scripts/config -e AUTOFDO_CLANG
478
485
fi
479
486
480
- if [ -n " $_autofdo " ] && [ -e " $_autofdo_profile_name " ]; then
487
+ if [ -n " $_autofdo " ] && [ -e " $_autofdo_profile_name " ] && [ -n " $_autofdo_profile_name " ] ; then
481
488
echo " AutoFDO profile has been found..."
482
489
BUILD_FLAGS+=(CLANG_AUTOFDO_PROFILE=" ${srcdir} /${_autofdo_profile_name} " )
483
490
fi
0 commit comments