diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2022-12-14 17:26:35 +0200 |
---|---|---|
committer | Felix Singer <service+coreboot-gerrit@felixsinger.de> | 2023-06-11 20:07:57 +0000 |
commit | cad92ecca8841450939e22e0da265507fec1bb9a (patch) | |
tree | 7d92cbd721400d33730788b95fc150625f48a5f1 | |
parent | 0e93a6f184539c0ed3b436ce674aa45984402ed6 (diff) |
Append per-board ccache statistics in log
Starting with ccache 4.4 it is possible to collect statistics about
cache miss/hit rates in a separate file.
Add the info of the build at end of created make.log file or on stdout.
Change-Id: I1bab712712f4d6379ec6733fdc55b234e3845da7
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75087
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | Makefile.inc | 7 | ||||
-rw-r--r-- | toolchain.inc | 1 |
3 files changed, 10 insertions, 2 deletions
@@ -197,6 +197,10 @@ endif strip_quotes = $(strip $(subst ",,$(subst \",,$(1)))) # fix makefile syntax highlighting after strip macro \" ")) +ifneq ($(NOCOMPILE),1) +$(shell rm -f $(CCACHE_STATSLOG)) +endif + # The primary target needs to be here before we include the # other files diff --git a/Makefile.inc b/Makefile.inc index abf47d4fae..b35ec86a11 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -66,8 +66,11 @@ coreboot: $(obj)/coreboot.rom $(obj)/cbfstool $(obj)/rmodtool $(obj)/ifwitool $( # targets after the build completes by creating a Makefile.inc in the # site-local directory with a target named 'build_complete::' build_complete:: coreboot - printf "\nBuilt %s (%s)\n" $(MAINBOARDDIR) \ - $(CONFIG_MAINBOARD_PART_NUMBER) + printf "\nBuilt %s (%s)\n" $(MAINBOARDDIR) $(CONFIG_MAINBOARD_PART_NUMBER) + if [ -f "$(CCACHE_STATSLOG)" ]; then \ + printf "\nccache statistics\n"; \ + $(CCACHE) --show-log-stats -v; \ + fi # This target can be used to run rules after all files were added to CBFS, # for example to process FMAP regions or the entire image. diff --git a/toolchain.inc b/toolchain.inc index 47c5fe9b85..3165586d78 100644 --- a/toolchain.inc +++ b/toolchain.inc @@ -10,6 +10,7 @@ endif export CCACHE_COMPILERCHECK=content export CCACHE_BASEDIR=$(top) +export CCACHE_STATSLOG=$(obj)/ccache.stats $(foreach arch,$(ARCH_SUPPORTED), \ $(eval CC_$(arch):=$(CCACHE) $(CC_$(arch)))) |