Skip to content

Commit

Permalink
linux-cachyos: Some cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: Vasiliy Stelmachenok <[email protected]>
  • Loading branch information
ventureoo committed Dec 2, 2024
1 parent 089f29c commit dd5c677
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions linux-cachyos/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,9 @@ _build_nvidia_open=${_build_nvidia_open-}
_build_debug=${_build_debug-}

# Enable AUTOFDO_CLANG for the first compilation to create a kernel, which can be used for profiling
# This only works for Clang compiled kernels, therefore thin or full lto needs to be set in _use_llvm_lto
# Workflow:
# https://cachyos.org/blog/2411-kernel-autofdo/
# 1. Compile Kernel with _autofdo=y and _build_debug
# 1. Compile Kernel with _autofdo=y and _build_debug=y
# 2. Boot the kernel in QEMU or on your system, see Workload
# 3. Profile the kernel and convert the profile, see Generating the Profile for AutoFDO
# 4. Put the profile into the sourcedir
Expand All @@ -158,7 +157,7 @@ _autofdo_profile_name=${_autofdo_profile_name-}

# ATTENTION: Do not modify after this line
_is_clang_kernel() {
[[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ] || [ -n "$_autofdo" ] || [ -n "$_autofdo_use" ]
[[ "$_use_llvm_lto" = "thin" || "$_use_llvm_lto" = "full" ]] || [ -n "$_use_kcfi" ] || [ -n "$_autofdo" ]
return $?
}

Expand Down Expand Up @@ -257,7 +256,7 @@ if [ -n "$_autofdo" ] && [ -n "$_autofdo_profile_name" ]; then
if [ -e "$_autofdo_profile_name" ]; then
source+=("$_autofdo_profile_name")
else
_die "You have specified _autofdo_profile_name, but file it refers to doesn't exist."
_die "Failed to find file ${_autofdo_profile_name}"
fi
fi

Expand Down Expand Up @@ -482,7 +481,7 @@ prepare() {
scripts/config -e AUTOFDO_CLANG
fi

if [ -n "$_autofdo" ] && [ -e "$_autofdo_profile_name" ] && [ -n "$_autofdo_profile_name" ]; then
if [ -n "$_autofdo" ] && [ -n "$_autofdo_profile_name" ]; then
echo "AutoFDO profile has been found..."
BUILD_FLAGS+=(CLANG_AUTOFDO_PROFILE="${srcdir}/${_autofdo_profile_name}")
fi
Expand Down

0 comments on commit dd5c677

Please sign in to comment.