summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2019-04-05 09:22:15 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-13 01:31:50 -0700
commit34cc1f91c9ba462b4b461cfc70c28ecc688a8915 (patch)
tree375726c6dd6d887ce4bc96b88d55ff6ee6400356
parent596aa967d6adfffb054a176d1891478cbbd26483 (diff)
downloadchrome-ec-34cc1f91c9ba462b4b461cfc70c28ecc688a8915.tar.gz
Makefile: Print free spaces in RO flash
Currently, buildall prints only free spaces in RW flash. This patch makes it print smallest free spaces in RO flash as well. If the board doesn't have RO (i.e. #undef CONFIG_FW_INCLUDE_RO), it'll be ignored. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/129746223 BRANCH=none TEST=buildall Change-Id: I953cb6fd998c3868e54be2ea3c2ce0ab51275b64 Reviewed-on: https://chromium-review.googlesource.com/1554841 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--Makefile.rules31
1 files changed, 21 insertions, 10 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 4a6cca7542..84c0178641 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -170,12 +170,8 @@ buildall: build_boards
$(MAKE) runtests
@touch .tests-passed
@echo "$@ completed successfully!"
- @echo "Tightest boards' RW flash images, bytes free:"
- @grep . build/*/RW/space_free_flash.txt | \
- sed 's,build/\([^/]*\)/RW/space_free_flash.txt:\(.*\)$$,\2 \1,' | \
- sort -n | head -3 | while read size board; do \
- printf "%-10s: %6d\n" $$board $$size; \
- done
+ $(call cmd_stats,RO)
+ $(call cmd_stats,RW)
@echo "Tightest boards' RW RAM images, bytes free:"
@grep . build/*/RW/space_free_ram.txt | \
sed 's,build/\([^/]*\)/RW/space_free_ram.txt:\(.*\)$$,\2 \1,' | \
@@ -340,6 +336,7 @@ cmd_report_cov=genhtml -q -o build/host/coverage_rpt -t \
# Unless V is set to 0 we always want the 'size:' target to report its output,
# there is no point in generating a short form command trace when calculating
# size.
+# $1: 'RO' or 'RW'
ifeq ($(V),0)
cmd_size=
else
@@ -348,16 +345,27 @@ cmd_size=$(Q)awk '\
/^FLASH/ {flash_size = strtonum($$3)} \
/__ram_free =/ {ram_free = strtonum($$1)} \
END {room_free = flash_size - image_size; \
- print ram_free > "$(out)/RW/space_free_ram.txt"; \
+ print ram_free > "$(out)/$(1)/space_free_ram.txt"; \
printf " *** "; \
if (flash_size > 0) { \
- print room_free > "$(out)/RW/space_free_flash.txt"; \
+ print room_free > "$(out)/$(1)/space_free_flash.txt"; \
printf ("%s bytes in flash and ", room_free);\
} \
printf ("%s bytes in RAM still available on $(BOARD) ****\n", ram_free) \
- }' $(out)/RW/$(PROJECT).RW.map
+ }' $(out)/$(1)/$(PROJECT).$(1).map
endif
+# List the smallest free flash spaces
+# $1: 'RO' or 'RW'
+cmd_stats= \
+ $(Q)echo "Smallest free spaces in $(1) flash (bytes):"; \
+ grep . build/*/$(1)/space_free_flash.txt | \
+ sed 's,build/\([^/]*\)/$(1)/space_free_flash.txt:\(.*\)$$,\2 \1,' | \
+ sort -n | head -3 | \
+ while read size board; do \
+ printf "%-10s: %6d\n" $$board $$size; \
+ done
+
build/host/%.info: run-%
$(call quiet,lcov,COV )
@@ -740,7 +748,10 @@ analyzestack: $(out)/util/export_taskinfo.so
# Calculate size of remaining room in flash, using variables generated by
# linker.
size: $(out)/$(PROJECT).bin
- $(call cmd_size)
+ifneq ($(CONFIG_FW_INCLUDE_RO),)
+ $(call cmd_size,RO)
+endif
+ $(call cmd_size,RW)
.SECONDARY: