mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 00:32:38 +01:00 
			
		
		
		
	Added scripts/code_size.py, for more in-depth code-size reporting
Inspired by Linux's Bloat-O-Meter, code_size.py wraps nm to provide function-level code size, and supports detailed comparison between different builds. One difference is that code_size.py invokes littlefs's build system similarly to test.py, creating a duplicate build in the "sizes" directory. This makes it easy to monitor a cross-compiled build size while simultaneously testing on the host machine.
This commit is contained in:
		
							
								
								
									
										6
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								Makefile
									
									
									
									
									
								
							| @@ -6,6 +6,7 @@ endif | ||||
| CC ?= gcc | ||||
| AR ?= ar | ||||
| SIZE ?= size | ||||
| NM ?= nm | ||||
|  | ||||
| SRC += $(wildcard *.c bd/*.c) | ||||
| OBJ := $(SRC:.c=.o) | ||||
| @@ -29,6 +30,7 @@ override CFLAGS += -Wextra -Wshadow -Wjump-misses-init -Wundef | ||||
|  | ||||
| ifdef VERBOSE | ||||
| override TFLAGS += -v | ||||
| override SFLAGS += -v | ||||
| endif | ||||
|  | ||||
|  | ||||
| @@ -39,6 +41,9 @@ asm: $(ASM) | ||||
| size: $(OBJ) | ||||
| 	$(SIZE) -t $^ | ||||
|  | ||||
| code_size: | ||||
| 	./scripts/code_size.py $(SFLAGS) | ||||
|  | ||||
| test: | ||||
| 	./scripts/test.py $(TFLAGS) | ||||
| .SECONDEXPANSION: | ||||
| @@ -65,3 +70,4 @@ clean: | ||||
| 	rm -f $(DEP) | ||||
| 	rm -f $(ASM) | ||||
| 	rm -f tests/*.toml.* | ||||
| 	rm -f sizes/* | ||||
|   | ||||
		Reference in New Issue
	
	Block a user