Skip to content

Sleep tracing #427

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

Merged
merged 8 commits into from
Mar 14, 2018
Merged

Sleep tracing #427

merged 8 commits into from
Mar 14, 2018

Conversation

bulislaw
Copy link
Member

@bulislaw bulislaw commented Mar 2, 2018

Dependencies

Description

Add explanations how to use the new sleep tracing mechanism.

Content

After merging #423 and rebase, this will look like:

Sleep tracing

Mbed OS can help you to understand the sleep patterns of your device, specifically who is holding a sleep locks preventing your board to enter the deep sleep. To enable the tracing, all you need to do is to define MBED_SLEEP_TRACING_ENABLED macro. You can do it by modifying your mbed_app.json config file or appending -DMBED_SLEEP_TRACING_ENABLED to mbed compile command.

Mbed OS will print sleep traces on the standard output, which by default is UART. Some of the events that we track:

  • Locking deep sleep: LOCK: <file name>, ln: <line in file>, lock count: <number of locks held>
  • Unlocking deep sleep: UNLOCK: <file name>, ln: <line in file>, lock count: <number of locks held>
  • Entering sleep: Mbed OS will print a list of locks preventing the board from entering a deep sleep:
Sleep locks held:
[id: <file name 1>, count: <number of locks>]
[id: <file name 2>, count: <number of locks>]

Example trace can look like:

LOCK: mbed_rtx_idle.cpp, ln: 129, lock count: 2
Sleep locks held:
[id: mbed_wait_api_, count: 1]
[id: mbed_rtx_idle., count: 1]
UNLOCK: mbed_rtx_idle.cpp, ln: 131, lock count: 1
LOCK: mbed_rtx_idle.cpp, ln: 129, lock count: 2
Sleep locks held:
[id: mbed_wait_api_, count: 1]
[id: mbed_rtx_idle., count: 1]
UNLOCK: mbed_rtx_idle.cpp, ln: 131, lock count: 1

Note: Sleep tracing is a debug feature and should only be enabled during development cycle. Its heavy use of UART can affect the device performance.


CC: @scartmell-arm

@adbridge adbridge requested review from AnotherButler and a user March 2, 2018 12:19
Copy link
Contributor

@AnotherButler AnotherButler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow our template of introduction, reference link and example.

bulislaw and others added 8 commits March 14, 2018 13:36
@AnotherButler AnotherButler merged commit 3caef05 into ARMmbed:new_engine Mar 14, 2018
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

Successfully merging this pull request may close these issues.

2 participants