summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.autofdo
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2024-11-02 18:51:12 +0100
committerMasahiro Yamada <masahiroy@kernel.org>2024-11-27 01:38:27 +0100
commit0847420f5e499a7ab518942fff71482179290163 (patch)
tree7791975ce8a55628bc44679348372420ced62f12 /scripts/Makefile.autofdo
parentvmlinux.lds.h: Add markers for text_unlikely and text_hot sections (diff)
downloadlinux-0847420f5e499a7ab518942fff71482179290163.tar.xz
linux-0847420f5e499a7ab518942fff71482179290163.zip
AutoFDO: Enable -ffunction-sections for the AutoFDO build
Enable -ffunction-sections by default for the AutoFDO build. With -ffunction-sections, the compiler places each function in its own section named .text.function_name instead of placing all functions in the .text section. In the AutoFDO build, this allows the linker to utilize profile information to reorganize functions for improved utilization of iCache and iTLB. Co-developed-by: Han Shen <shenhan@google.com> Signed-off-by: Han Shen <shenhan@google.com> Signed-off-by: Rong Xu <xur@google.com> Suggested-by: Sriraman Tallam <tmsriram@google.com> Tested-by: Yonghong Song <yonghong.song@linux.dev> Tested-by: Yabin Cui <yabinc@google.com> Tested-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Kees Cook <kees@kernel.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/Makefile.autofdo')
-rw-r--r--scripts/Makefile.autofdo2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/Makefile.autofdo b/scripts/Makefile.autofdo
index ff96a63fea7c..6155d6fc4ca7 100644
--- a/scripts/Makefile.autofdo
+++ b/scripts/Makefile.autofdo
@@ -9,7 +9,7 @@ ifndef CONFIG_DEBUG_INFO
endif
ifdef CLANG_AUTOFDO_PROFILE
- CFLAGS_AUTOFDO_CLANG += -fprofile-sample-use=$(CLANG_AUTOFDO_PROFILE)
+ CFLAGS_AUTOFDO_CLANG += -fprofile-sample-use=$(CLANG_AUTOFDO_PROFILE) -ffunction-sections
endif
ifdef CONFIG_LTO_CLANG_THIN