-
Notifications
You must be signed in to change notification settings - Fork 3k
Implement zoomable html-flamegraph memap output #6582
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Would be great if there were percentages attached to each level of zoom. For instance: |
@sg- Yeah, I don't know how to do that. |
Would also be nice if it used the linker script to map to the target's address space. |
@sg- I added a bit of text that does the percent thing at the bottom. I updated the example. |
@loverdeg-ep I'm not entirely sure how that would work. If you mean that you want symbols sorted by where they're located in ROM/RAM, I think that has the potential to break up the bars into multiple parts. This is meant as a visualization of relative allocation sizes, so that you could compare the size of the rtos to printf, for example. This allows you to make decisions about where to spend your time optimizing. Removing the location information is an important step to easily visualize the relative size of the allocations. |
@theotherjimmy is looking good - thanks! Can you please elaborate on the meaning of "Non-zero initialized data (ROM + RAM)" in this context? I understand (data) is first stored in ROM, and during run/init time it's copied/de-compressed to RAM. Therefore this is how I'd expect the data to be split: ROM: text (code+const) + data (compressed) Does it make sense? Please share your thoughts. Thanks! |
That's data. If it were zero, it would be in the bss. From my research:
There is a difference between not programatically initialized, and guaranteed to be zero. https://en.wikipedia.org/wiki/.bss
I'm not sure what this statement is referring to. If you're talking about the way that it's split, I go into detail about that below.
I tried that data split first, and found that representation to be lacking. When I had the memory split this way my first question was: "what parts are data?" If the intent of this graphic is to help find the source of space in ROM/RAM, then having the data section separate from the text section could help identify where moving the initial state of a structure to be all 0's would help with ROM savings for example. Tangent: We don't have either the compressed or the de-compressed numbers. Memap seems to assume that the data section is the same size in RAM and ROM. |
Thanks for the clarifications @theotherjimmy I see at the bottom of each graph, there is an indication of bss, data and text, which is great. But I still feel we should improve the wording on the "Non-zero initialized data (ROM + RAM)", as it's a bit ambiguous; maybe use (ROM = RAM) to indicate this data goes to two memories. Btw in case you haven't seen this, could be useful to get some ideas: https://armmbed.github.io/mbed-os-linker-report |
@MarceloSalazar I could move them back to |
@MarceloSalazar I used English titles in http://mbed-os.s3-eu-west-1.amazonaws.com/builds/fat-fs_map-english.html. And using the section titles http://mbed-os.s3-eu-west-1.amazonaws.com/builds/fat-fs_map-jargon.html. And no titles: http://mbed-os.s3-eu-west-1.amazonaws.com/builds/fat-fs_map-notitle.html |
tools/memap.py
Outdated
tree_data = {"name": ".data"} | ||
for name, dct in self.modules.items(): | ||
if ".text" not in dct: | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is straight up wrong. I need to remove this.
Well, if that's really the intent, then the current graph provides no benefit: you cannot visually compare the two (the entire point of having a graph). I'm pushing another change that uses a combined graph, but makes ".text" and ".data" children of "ROM" and ".bss" and ".data" children on "RAM". This should allow you to compare these allocations visually. |
Thanks, let me know once that's done and we have a link to a demo. |
@MarceloSalazar It was done when I commented that. You should be able to see it in the demo. Edit: I updated the demo in the link in the top post. |
Thanks - I quite like the combined image with corresponding sections for each RAM and ROM. |
Personally I find that redundant: there must be a bottom bar, and it's already labeled ROM or RAM. |
@theotherjimmy what is the current state of this PR now? |
Approval from @sg- @thegecko and @screamerbg is next. |
Ping. |
I'm not sure what I'm signing off on here.
|
We already have the data as CSV and JSON for every compile. the JSON format is not particularly usefull for D3. I could instead add a D3 JSON output. That could be an alternative approach. |
Since no one has brought up any major reasons why this shouldn't make it in, I'm progressing the PR. /morph build |
Build : SUCCESSBuild number : 2204 Triggering tests/morph test |
Test : SUCCESSBuild number : 1996 |
Exporter Build : SUCCESSBuild number : 1830 |
Description
Sample: http://mbed-os.s3-eu-west-1.amazonaws.com/builds/fat-fs_map.html
Pull request type
[ ] Fix
[X] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change