Skip to content

Commit a10e02e

Browse files
authored
segment size printout cosmetics (#6534)
* segment size printout cosmetics * improve readability
1 parent 5d609fd commit a10e02e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tools/sizes.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
2323
import subprocess
2424
import sys
2525

26+
def get_segment_hints():
27+
hints = {}
28+
hints['IROM'] = ' - code in flash (default or ICACHE_FLASH_ATTR)'
29+
hints['IRAM'] = ' / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)'
30+
hints['DATA'] = ') - initialized variables (global, static) in RAM/HEAP'
31+
hints['RODATA'] = ') / 81920 - constants (global, static) in RAM/HEAP'
32+
hints['BSS'] = ') - zeroed variables (global, static) in RAM/HEAP'
33+
return hints
34+
2635
def get_segment_sizes(elf, path):
2736
sizes = {}
2837
sizes['IROM'] = 0
@@ -53,10 +62,11 @@ def main():
5362

5463
args = parser.parse_args()
5564
sizes = get_segment_sizes(args.elf, args.path)
65+
hints = get_segment_hints()
5666

5767
sys.stderr.write("Executable segment sizes:" + os.linesep)
5868
for k in sizes.keys():
59-
sys.stderr.write("%-7s: %d%s" % (k, sizes[k], os.linesep))
69+
sys.stderr.write("%-7s: %-5d %s %s" % (k, sizes[k], hints[k], os.linesep))
6070

6171
return 0
6272

0 commit comments

Comments
 (0)