Skip to content
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

Need a way to enable sleep tracing, but without printing stats every time #10058

Closed
janjongboom opened this issue Mar 12, 2019 · 4 comments
Closed

Comments

@janjongboom
Copy link
Contributor

Description

I really want sleep tracing on as it tells me which locks are active / non-active. However, this also prints the active sleep locks every time the device goes into sleep, which clutters my serial output significantly and I suspect the crash in #10051 is also because of this. Can we add an extra setting that does log sleep locks that are activated / dis-activated, but does not log the stats every time we go to sleep?

Issue request type

[ ] Question
[X] Enhancement
[ ] Bug
@ciarmcom
Copy link
Member

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

@janjongboom
Copy link
Contributor Author

@cmonr @bulislaw Why is this closed?

@gpsimenos
Copy link
Contributor

Hi Jan, thanks for engaging with Mbed OS 😃

I've had a look at this and I definitely agree that sleep tracing can be too verbose by default in some cases. It would be great to have an additional macro to control the printing of stats every time the device goes to sleep, but introducing a new macro to Mbed OS incurs considerable maintainance and documentation effort. Unfortunately, in this case and at this time, we have decided not to make any changes.

Although I'm sure you will have implemented your own workaround by now, below is a solution you and other people who come across this issue can implement locally.

In plaftorm/mbed_sleep_manager.c, at the top of the sleep_manager_sleep_auto function, wrap the call to sleep_tracker_print_stats() in an additional compiler condition, like this:

#ifdef MBED_SLEEP_TRACING_ENABLED
#ifndef MBED_SLEEP_TRACING_LIGHT
    sleep_tracker_print_stats();
#endif
#endif

Now you will be able to simply define the MBED_SLEEP_TRACING_LIGHT macro alongside MBED_SLEEP_TRACING_ENABLED to limit the amount of traces.

Either add the macro to the mbed_app.json in your application,

{
    "macros": [
         "MBED_SLEEP_TRACING_ENABLED",
         "MBED_SLEEP_TRACING_LIGHT"
    ],
    "target_overrides": {
        
    }
}

or append -DMBED_SLEEP_TRACING_ENABLED -DMBED_SLEEP_TRACING_LIGHT to mbed compile.

If this solves your issue, let me know so we can close this.

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants