File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python3
2+ # Run this from within an unzipped directory of build logs from github
3+ # to get a CSV file full of firmware sizes. Super useful to compare sizes
4+ # from various builds.
5+ # Taken from https://github.com/adafruit/circuitpython/pull/4564#issuecomment-816655101
6+ import os , re
7+
8+ for fn in os .listdir ():
9+ if os .path .isfile (fn ) and ("build-arm " in fn or "build-riscv " in fn ):
10+ board = re .split ("[()]" , fn )[1 ]
11+ if board in (
12+ "spresense" ,
13+ "teensy40" ,
14+ "teensy41" ,
15+ "feather_m7_1011" ,
16+ "feather_mimxrt1011" ,
17+ "feather_mimxrt1062" ,
18+ "imxrt1010_evk" ,
19+ "imxrt1020_evk" ,
20+ "imxrt1060_evk" ,
21+ "metro_m7_1011" ,
22+ ):
23+ continue
24+ with open (fn , "r" ) as f :
25+ head = "Build " + board + " for "
26+ lines = iter (f )
27+ for line in lines :
28+ if head in line :
29+ tr = line .split (head )[1 ].split ()[0 ]
30+ assert "make: Entering directory" in next (lines )
31+ assert "Use make V=1, make V=2" in next (lines )
32+ while re .search (
33+ r"\{\}|QSTR updated|FREEZE|\{'sku':|hex\tfilename|boot2.elf|Including User C Module from|Font missing|section `.bss' type changed to PROGBITS" ,
34+ next (lines ),
35+ ):
36+ pass
37+ free = next (lines ).split ("bytes used, " )[1 ].split ()[0 ]
38+ print (board + "," + tr + "," + free )
You can’t perform that action at this time.
0 commit comments