Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Table output for segment size script#8551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
d-a-v merged 7 commits intoesp8266:masterfrommcspr:sizes-py-table
May 11, 2022

Conversation

@mcspr
Copy link
Collaborator

Re-format the file, hints and clean-up the resulting data dict

Also include maximum aka total for every segment key, so now we could also display it every time

(penv) ~\D\A\s\test> C:\\Users\\maxim\\Documents\\Arduino\\hardware\\esp8266com\\esp8266/tools/python3/python3 \  -I "C:\\Users\\maxim\\Documents\\Arduino\\hardware\\esp8266com\\esp8266/tools/sizes.py" \  --elf "C:\\Users\\maxim\\AppData\\Local\\Temp\\arduino-sketch-47C53BFFA994BDA8380BC89E427DA2CA/test.ino.elf" \  --path "C:\\Users\\maxim\\Documents\\Arduino\\hardware\\esp8266com\\esp8266/tools/xtensa-lx106-elf/bin" \  --mmu "-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000"
SEGMENT  USED     TOTAL    PERCENT  DESCRIPTION----------------------------------------------------ICACHE   32768    32768    100%     flash instruction cacheIROM     232088   1048576  22%      code in flash (default, ICACHE_FLASH_ATTR)IRAM     26205    32768    79%      code in IRAM (IRAM_ATTR, ICACHE_RAM_ATTR)DATA     1496     81920    1%       initialized variables (global, static) in RAMRODATA   876      81920    1%       constants (global, static) in RAMBSS      25520    81920    31%      zeroed variables (global, static) in RAM

vs. old

Executable segment sizes:ICACHE : 32768           - flash instruction cacheIROM   : 232088          - code in flash         (default or ICACHE_FLASH_ATTR)IRAM   : 26205   / 32768 - code in IRAM          (IRAM_ATTR, ISRs...)DATA   : 1496  )         - initialized variables (global, static) in RAM/HEAPRODATA : 876   ) / 81920 - constants             (global, static) in RAM/HEAPBSS    : 25520 )         - zeroed variables      (global, static) in RAM/HEAP

idk about the percentage, though... whether it should be for specific segment, or for the memory overall. we could combine data + rodata + bss percentages as "User-data RAM" and IRAM & ICACHE as... "Instruction RAM"?
could just remove it too

Also include maximum aka total for every segment keyRe-format the file and clean-up the resulting data dict
@earlephilhower
Copy link
Collaborator

I'm indifferent on the table vs. the more organic way that@d-a-v was doing it, but I think this line is going to cause concern among people who don't know any better:

ICACHE   32768    32768    100%     flash instruction cache

Reporting 100% use seems like it's going to make people ask questions or be worried. For this special-case, can we do something similar to before where we don't report the usage? Something like

SEGMENT  USED     TOTAL    PERCENT  DESCRIPTION----------------------------------------------------ICACHE            32768             flash instruction cache

@d-a-v, thoughts?

@mhightower83
Copy link
Contributor

In hindsight,configured flash instruction cache size might have been a more accurate description. Or is that getting too long for a brief description?

@d-a-v
Copy link
Collaborator

There could be misunderstanding about RAM content, which I had tried to show with the three parenthesis) in the original representation.
In the new representation above, RAM details are imho hidden or confusing.
If RAM details matter, how are the lines below improvable to fit with this PR's intent ?

SEGMENT  USED     TOTAL    PERCENT  DESCRIPTION----------------------------------------------------ICACHE   32768    32768    100%     configured flash instruction cacheIROM     232088   1048576  22%      code in flash (default, ICACHE_FLASH_ATTR)IRAM     26205    32768    79%      code in IRAM (IRAM_ATTR, ICACHE_RAM_ATTR)RAM      27892    81920    34%      RAM details (global or static):  +DATA     1496              1%     - initialized variables +RODATA   876               1%     - constants +BSS      25520             31%    - zeroed variables

@mcspr
Copy link
CollaboratorAuthor

mcspr commentedApr 30, 2022
edited
Loading

(and yeah, I haven't realized what) was supposed to mean :)

What about something like this

. Variables and constants in RAM (total 80192 bytes)├── DATA 1496 - initialized variables (global, static)├── RODATA 876 - constants (global, static)└── BSS 25520 - zeroed variables (global, static). Instruction cache (total 32768 bytes)└── ICACHE 32768 - configured flash instruction cache. Instruction RAM (total 32768 bytes)└── IRAM 26205 - code in IRAM (IRAM_ATTR, ICACHE_RAM_ATTR). Code in flash (total 1048576 bytes)└── IROM 232088 - code in flash (default, ICACHE_FLASH_ATTR)

Plus, IDE also prints this right after, through the size recipe
(...see#8550, we need to get{board}.upload.maximum_size=... back so it works. it is c/p from there)

Sketch uses 260665 bytes (24%) of program storage space. Maximum is 1044464 bytes.Global variables use 27892 bytes (34%) of dynamic memory, leaving 54028 bytes for local variables. Maximum is 81920 bytes.

And which may actually be disabled in favour of the script

@d-a-v
Copy link
Collaborator

d-a-v commentedMay 2, 2022
edited
Loading

The tree looks nice !
Did you remove percentages on purpose ?

@mcspr
Copy link
CollaboratorAuthor

mcspr commentedMay 2, 2022
edited
Loading

Just missed, will update the script to add it to total line.

Regarding IRAM... what about

. Instruction RAM (total 65536 bytes, used 58973 bytes (90%))├── CACHE 32768  - reserved for flash instruction cache└── CODE 26205   - (IRAM_ATTR, ICACHE_RAM_ATTR)

So there's also a space for HEAP in the tree output, which is otherwise missing
(names are under question, though. perhaps it should stay ICACHE, ICACHE_RAM... and add ICACHE_HEAP)

d-a-v reacted with thumbs up emoji

Copy link
Collaborator

@d-a-vd-a-v left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks !

I get this, all data are there, including percentages.

. Variables and constants in RAM, total 80192 bytes, used 38712 bytes (48%)├── DATA     1760     initialized variables (global, static)├── RODATA   5992     constants (global, static)└── BSS      30960    zeroed variables (global, static). Instruction RAM, total 65536 bytes, used 47905 bytes (73%)├── ICACHE   16384    reserved space for flash instruction cache└── IRAM     31521    code in IRAM (IRAM_ATTR, ICACHE_RAM_ATTR). Code in flash, total 1048576 bytes, used 450264 bytes (42%)└── IROM     450264   code in flash (default, ICACHE_FLASH_ATTR)

previously

Executable segment sizes:ICACHE : 16384           - flash instruction cache IROM   : 450264          - code in flash         (default or ICACHE_FLASH_ATTR) IRAM   : 31521   / 49152 - code in IRAM          (IRAM_ATTR, ISRs...) DATA   : 1760  )         - initialized variables (global, static) in RAM/HEAP RODATA : 5992  ) / 81920 - constants             (global, static) in RAM/HEAP BSS    : 30960 )         - zeroed variables      (global, static) in RAM/HEAP

This is trying to remove redundant text, making it more light.
ymmv

Variables and constants in RAM (global, static)|    48%      38712 / 80192 bytes├── DATA       1760   initialized variables ├── RODATA     5992   constants└── BSS       30960   zeroed variablesInstruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR)|    73%      47905 / 65536 bytes├── ICACHE    16384   reserved space for flash instruction cache└── IRAM      31521   code in IRAMCode in flash (default, ICACHE_FLASH_ATTR)|    42%     450264 / 1048576 bytes└── IROM     450264   code in flash

@mcspr
Copy link
CollaboratorAuthor

With the suggestion above

. Variables and constants in RAM (global, static), used 27892 / 80192 bytes (34%)|   SEGMENT  BYTES    DESCRIPTION├── DATA     1496     initialized variables├── RODATA   876      constants└── BSS      25520    zeroed variables. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 58973 / 65536 bytes (89%)|   SEGMENT  BYTES    DESCRIPTION├── ICACHE   16384    reserved space for flash instruction cache├── IHEAP    16384    secondary heap space└── IRAM     26205    code in IRAM. Code in flash (default, ICACHE_FLASH_ATTR), used 232088 / 1048576 bytes (22%)|   SEGMENT  BYTES    DESCRIPTION└── IROM     232088   code in flash

(less dense, but still as wide as it was. only 81 chars btw)

earlephilhower reacted with thumbs up emoji

@d-a-vd-a-v merged commitda4a19f intoesp8266:masterMay 11, 2022
@mcsprmcspr deleted the sizes-py-table branchMay 11, 2022 22:01
hasenradball pushed a commit to hasenradball/Arduino that referenced this pull requestNov 18, 2024
* Table output for segment size scriptAlso include maximum aka total for every segment keyRe-format the file and clean-up the resulting data dict* revert to line output* used, percentage* unicodes* shorter desc, headers
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@d-a-vd-a-vd-a-v approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@mcspr@earlephilhower@mhightower83@d-a-v

[8]ページ先頭

©2009-2025 Movatter.jp