summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRong Xu <xur@google.com>2024-11-02 10:51:12 -0700
committerMasahiro Yamada <masahiroy@kernel.org>2024-11-27 09:38:27 +0900
commit0847420f5e499a7ab518942fff71482179290163 (patch)
tree7791975ce8a55628bc44679348372420ced62f12 /scripts
parentdb0b2991ae1aac5ca985ec6fd8ff9bd9b2126c9b (diff)
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')
-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