]> granicus.if.org Git - esp-idf/commitdiff
Create a make size-symbols target for fine grained footprint
authorKedar Sovani <kedars@gmail.com>
Mon, 19 Feb 2018 11:54:12 +0000 (17:24 +0530)
committerKedar Sovani <kedars@gmail.com>
Tue, 20 Feb 2018 06:16:54 +0000 (11:46 +0530)
make/project.mk

index 31f72bc5fad3ddf6d5dea9b051cf231563dbd04a..4f44dcbf19aa4bfce89d7586ed38e0242c79c2ee 100644 (file)
@@ -10,7 +10,7 @@
 # where this file is located.
 #
 
-.PHONY: build-components menuconfig defconfig all build clean all_binaries check-submodules size size-components size-files list-components
+.PHONY: build-components menuconfig defconfig all build clean all_binaries check-submodules size size-components size-files size-symbols list-components
 
 MAKECMDGOALS ?= all
 all: all_binaries
@@ -32,6 +32,7 @@ help:
        @echo "make clean - Remove all build output"
        @echo "make size - Display the static memory footprint of the app"
        @echo "make size-components, size-files - Finer-grained memory footprints"
+       @echo "make size-symbols - Per symbol memory footprint. Requires COMPONENT=<component>"
        @echo "make erase_flash - Erase entire flash contents"
        @echo "make monitor - Run idf_monitor tool to monitor serial output from app"
        @echo "make simple_monitor - Monitor serial output on terminal console"
@@ -463,6 +464,13 @@ size-files: $(APP_ELF)
 size-components: $(APP_ELF)
        $(PYTHON) $(IDF_PATH)/tools/idf_size.py --archives $(APP_MAP)
 
+size-symbols: $(APP_ELF)
+ifndef COMPONENT
+       $(error "ERROR: Please enter the component to look symbols for, e.g. COMPONENT=heap")
+else
+       $(PYTHON) $(IDF_PATH)/tools/idf_size.py --archive_details lib$(COMPONENT).a $(APP_MAP)
+endif
+
 # NB: this ordering is deliberate (app-clean & bootloader-clean before
 # _config-clean), so config remains valid during all component clean
 # targets