mirror of
https://github.com/travisgoodspeed/goodwatch
synced 2024-11-21 15:48:02 +00:00
Fixes printsizes.py to show .rodata usage.
This commit is contained in:
parent
24cb908cb5
commit
2ad4832858
@ -23,10 +23,12 @@ def printsizes(stream):
|
||||
|
||||
text=elffile.get_section_by_name('.text');
|
||||
textlen=len(text.data());
|
||||
codeperc=textlen*100.0/32768;
|
||||
print("\t%d bytes of .text (%d %%)" % (textlen,codeperc));
|
||||
if codeperc>80:
|
||||
print("WARNING: %d percent of code is used!"%codeperc);
|
||||
rodata=elffile.get_section_by_name('.rodata');
|
||||
rodatalen=len(rodata.data());
|
||||
codeperc=(textlen+rodatalen)*100.0/32768;
|
||||
print("\t%d bytes of .text, %d bytes of .rodata (%d%% Flash)" % (textlen,rodatalen,codeperc));
|
||||
if codeperc>90:
|
||||
print("WARNING: %d percent of Flash is used!"%codeperc);
|
||||
|
||||
datalen=0;
|
||||
bsslen=0;
|
||||
@ -42,7 +44,7 @@ def printsizes(stream):
|
||||
dataperc=(datalen+bsslen+noinitlen)*100.0/4096;
|
||||
|
||||
if datalen+bsslen+noinitlen>0:
|
||||
print("\t%d bytes of .data, %d bytes of .bss, %d bytes of .noinit (%d %%)"
|
||||
print("\t%d bytes of .data, %d bytes of .bss, %d bytes of .noinit (%d%% RAM)"
|
||||
%(datalen,bsslen,noinitlen,dataperc));
|
||||
if dataperc>80:
|
||||
print("WARNING: %d percent of data is used!"%dataperc);
|
||||
|
Loading…
Reference in New Issue
Block a user