Skip to content

parser for MBED_MEM_TRACE output #630

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

Closed
thinkberg opened this issue Feb 23, 2018 · 13 comments
Closed

parser for MBED_MEM_TRACE output #630

thinkberg opened this issue Feb 23, 2018 · 13 comments

Comments

@thinkberg
Copy link

Description

  • Type: Enhancement
  • Priority: Minor

Enhancement

The current memtrace is a very nice feature, but rather hard to use. Since my forum post is now in moderation for a week, maybe you'd like to integrate my little script into the cli tooling itself?

https://github.com/thinkberg/mbed-memtrace-logger

It parses the MEM_TRACE output and displays allocated heap and +/- values in a more readable form to aid debugging, while keeping log functionality.

Leo.

@theotherjimmy
Copy link
Contributor

@thinkberg You're welcome to submit a PR. I'm not sure mbed CLI would be the best place for this. @screamerbg Do you have any thoughts on that subject?

@thinkberg
Copy link
Author

I remember something like yotta debug in the old system which could be helpful here too. An mbed client way to start openocd/jlink gdb server and maybe even log serial output in a file/pipe it through the the script I wrote if tracing is enabled.

I didn't know which is the best part to submit something too, so I wanted to get some feedback. It felt more home in mbed-cli than in the mbed-os part.

@screamerbg
Copy link
Contributor

@thinkberg I agree with @theotherjimmy that Mbed CLI might not be the best place for the parsing. Do you think that this could be something like an external tool or python module, something that Mbed CLI could call? Or perhaps be part of Mbed OS tools given that many tools inside the OS have knowledge about the target, ram/flash, regions, even flash algos, device IDs, etc.

@thinkberg
Copy link
Author

Sure, could be an external module that can be called. My reasoning was that its important enough to be easily accessible. Right now, having a memory leak involves quite some searching and guessing. Even the stack/thread debug that I referenced in the repo was a lucky find. You almost always find outdates mbed docs, unfortunately. Even if it would be part of the docs with reference to the external tools would be most helpful.

@screamerbg
Copy link
Contributor

@thinkberg @theotherjimmy Mbed CLI now has a serial terminal feature (#664). Perhaps this is something that could be added to the serial terminal hooks and enable runtime memtrace functionality? Note that Mbed CLI does not have any external python dependencies, so the pygtail dependency should be somehow workarounded.

@thinkberg
Copy link
Author

Actually, pygtail was just a workaround due to buffering issues. If the mbed cli serial can pipe its data into a stream it would be simple to make it work.

@thinkberg
Copy link
Author

If you give me a hint where to integrate (where are the serial terminal hooks?), I can port it to be part of the cli.

@theotherjimmy
Copy link
Contributor

@thinkberg The file you're looking for is: https://github.com/ARMmbed/mbed-cli/blob/master/mbed/mbed_terminal.py

Let us know if you have any questions.

@thinkberg
Copy link
Author

I will take a look, thanks.

@ciarmcom
Copy link
Member

Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-61

@thinkberg
Copy link
Author

Started working on it.

@thinkberg
Copy link
Author

PR in #789

@ciarmcom
Copy link
Member

Thank you for raising this issue. Please note we have updated our policies and
now only defects should be raised directly in GitHub. Going forward questions and
enhancements will be considered in our forums, https://forums.mbed.com/ . If this
issue is still relevant please re-raise it there.
This GitHub issue will now be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants