-
Notifications
You must be signed in to change notification settings - Fork 7k
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
[Heap Trace Standalone] Support storing records in SPI RAM (IDFGH-8683) #10127
[Heap Trace Standalone] Support storing records in SPI RAM (IDFGH-8683) #10127
Conversation
45edcb9
to
b159e90
Compare
d6795ca
to
3c48f48
Compare
6f0271d
to
60abd2e
Compare
Gonna merge the 2 standalone implementations into one. Give me a a little bit. |
49a4266
to
cea5159
Compare
fa6b9e2
to
9ac13dd
Compare
Okay, changes are done. I re-tested This should be good to merge. |
395a270
to
2c198da
Compare
Thanks for your contribution. |
d613145
to
0cddfed
Compare
Question, why can't we simply allocate the trace buffer in external RAM? I.e. place If the user application doesn't call heap-related functions when cache is disabled, then there shouldn't be a problem accessing external RAM from the heap tracing functions. |
0cddfed
to
b8221aa
Compare
From
I'd think avoiding the "cache disabled" issue is important. |
In ESP-IDF internal components we don't perform heap allocations from interrupt handlers, so there should be no cases of accessing heap functions while cache is disabled. This might only be the case in user code, if a heap related function is called from an ISR. However I don't think there is a need to support these two things simultaneously:
since 1) is a bad practice and is not recommended anyway. Adding an assert somewhere in heap tracing code that |
Ok. Can you give more details on how to do this? |
I'll close this PR and open a new one without the dual Internal / SPI ram buffers. |
Sorry, I should have mentioned that. Probably something along the lines of: |
❌ EDIT: WONT MERGE, due to new PR with simpler approch: #10141 ❌
Add support for storing records in SPI RAM. Internal RAM is just used as a temporary buffer.
With this change, amazingly a small internal ram record buffer size of 13 was enough to handle all records! And this is for a very complex app with bluetooth, wifi, console. etc.
With this change, I am able to store all allocations since boot. During development one can leave this enabled, & If they unexpectedly hit a Low Ram condition, they can immediately print all allocations and analyze the problem without needing to reproduce with host mode enabled.
This makes standalone mode 10x more useful, IMO.
Also adds
heap_trace_dump_internal_ram_only()
, which is often all we care about.And adds
heap_trace_summary()
so that users can access more useful heap tracing information.Code:
In this PR, Internal RAM is just used as a temporary buffer. We stream records to SPI ram whenever we get a chance (i.e. at the next heap_trace_X() invocation from a non-IRAM function).