-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Power management stat : add verbosity level for MBED_SLEEP_TRACING_ENABLED #14610
Conversation
@jeromecoutant, thank you for your changes. |
@@ -90,7 +90,7 @@ extern "C" { | |||
* | |||
*/ | |||
|
|||
#ifdef MBED_SLEEP_TRACING_ENABLED | |||
#if defined(MBED_SLEEP_TRACING_ENABLED) || defined(MBED_SLEEP_STAT_ENABLED) |
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.
I need to read the discussion but still this one commit does not explain one why there would be a need for additional macro (there is || between so one of them needs t obe truth at least,why ? ).
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.
Because ST LPTICKER API calls the deepsleep lock function very very often:
https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_STM/lp_ticker.c#L471
So I let the current macro as it is and as it is described in mbed-os doc,
and created a new one, a bit less verbose.
targets/TARGET_STM/README.md
Outdated
- deepsleep can also be disabled by application or drivers using sleep_manager_lock_deep_sleep() | ||
|
||
To enable the tracing, it is recommended to **not** define MBED_SLEEP_TRACING_ENABLED macro, | ||
but **MBED_SLEEP_STAT_ENABLED** macro. |
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.
To my question above, why is not recommended/ Shoudn't the one be fixed rather than create two (it might confuse people) ?
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.
Add here some details why stats only.
@jeromecoutant, thank you for your changes. |
#11497 (comment) - if this is required to be so, locking so often, then printing is correct. The problem is how to filter these as there are too many locks? #14580 - how is this related to the issue? We will need to review this in detail. I don't believe adding a new macro is an answer. I find it confusing which one I should define and why. |
Not directly related to this issue. This issue confirms that we need something to be able to trace sleep lock with STM32 use case.
The default macro is not usable for STM32. |
This pull request has automatically been marked as stale because it has had no recent activity. @ARMmbed/mbed-os-maintainers, please complete review of the changes to move the PR forward. Thank you for your contributions. |
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.
MBED_SLEEP_STATS_ENABLED
could it be named similarly as the functions in the power mgmt
Not against introducing the stats only. My understanding is tracing in this case for stm32 is way to verbose (happens very frequently) and thus can't be used. Stats however are useful information and can be printed. What a user should do if they need tracing (are there any options for them) ?
Please review @ARMmbed/mbed-os-core review
platform/source/mbed_power_mgmt.c
Outdated
@@ -239,6 +243,9 @@ void sleep_manager_sleep_auto(void) | |||
#endif | |||
hal_deepsleep(); | |||
} else { | |||
#if defined(MBED_SLEEP_STAT_ENABLED) |
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.
you get stats at the top of this function, do we need to print this again when only sleeping?
targets/TARGET_STM/README.md
Outdated
- deepsleep can also be disabled by application or drivers using sleep_manager_lock_deep_sleep() | ||
|
||
To enable the tracing, it is recommended to **not** define MBED_SLEEP_TRACING_ENABLED macro, | ||
but **MBED_SLEEP_STAT_ENABLED** macro. |
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.
Add here some details why stats only.
This pull request has automatically been marked as stale because it has had no recent activity. , please complete review of the changes to move the PR forward. Thank you for your contributions. |
This pull request has automatically been marked as stale because it has had no recent activity. @jeromecoutant, please carry out any necessary work to get the changes merged. Thank you for your contributions. |
ping :-) |
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.
The printf there with allo does not provide sufficient meaning to a reader. What should be printed?
platform/source/mbed_power_mgmt.c
Outdated
} | ||
|
||
if (sleep_stats[i].identifier[0] == '\0') { | ||
mbed_error_printf("allo"); |
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.
Why is it allo
? Should this be something more meaningful ?
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.
I reviewed this but kept the review pending (not certain why it was not posted).
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.
oups...
…ABLED Full verbosity is adding a console line for each lock/unlock API call - stats can be enabled with json config - default configuration is full verbosity and add a console line for each lock/unlock command - for STM32 targets, verbosity is reduced by default
426c57c
to
8e26a05
Compare
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
@LDong-Arm Can you please review? |
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.
LGTM as per previous discussion regarding the documentation of the new config.
Summary of changes
Using MBED_SLEEP_TRACING_ENABLED is not reliable with STM32 targets.
See discussions in #11497 #14580 ...
[edit]
This new MBED_SLEEP_STAT_ENABLED macro is the same oneremoving prints at each sleep_manager_lock/unlock_deep_sleepImpact of changes
Migration actions required
Documentation
STM32 readme file is updated
Pull request type
Test results
Reviewers
@ARMmbed/team-st-mcd