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

Sleep tracer is not finding matching driver when performing an unlock #8205

Closed
TacoGrandeTX opened this Issue Sep 20, 2018 · 4 comments

Comments

Projects
None yet
5 participants
@TacoGrandeTX
Copy link
Contributor

TacoGrandeTX commented Sep 20, 2018

Description

We are not properly performing the driver lookup when we perform an unlock of the deep sleep counter. This only affects the stats counter and not the sleep counter itself, but it leads to confusing results when using the sleep tracer to monitor sleep.

Test Program:

#include "mbed.h"

Timer timmy;

int main() {

    // starting a timer increments sleep lock count
    timmy.start();

     // wait will bump the sleep count and decrement it
    wait (3);

    // stop the timer... this should reduce the sleep lock count
    timmy.stop();


}  // end main()

This results in:

LOCK: Timer.cpp, ln: 54, lock count: 1
LOCK: mbed_wait_api_rtos.cpp, ln: 45, lock count: 2
Sleep locks held:
[id: Timer.cpp, count: 1]
[id: mbed_wait_api_rtos.cpp, count: 1]
UNLOCK: mbed_wait_api_rtos.cpp, ln: 47, lock count: 1
Unlocking sleep for driver that was not previously locked: Timer.cpp, ln: 68
Sleep locks held:
[id: Timer.cpp, count: 1]

It still shows the timer holding a sleep lock when it has actually been released.

If we revert commit 9a0e879 then the problem goes away. We were doing a strcmp instead of a pointer compare in sleep_tracker_find():

9a0e879#diff-4ef16dda46f5130a57b304fed2459ee3L53

Issue request type

[ ] Question
[ ] Enhancement
[X] Bug

@TacoGrandeTX

This comment has been minimized.

Copy link
Contributor Author

TacoGrandeTX commented Sep 20, 2018

@scartmell-arm Could you please comment?

@adbridge

This comment has been minimized.

Copy link
Contributor

adbridge commented Oct 4, 2018

Internal Jira reference: https://jira.arm.com/browse/IOTCORE-489

@cmonr

This comment has been minimized.

Copy link
Contributor

cmonr commented Feb 12, 2019

@TacoGrandeTX

This comment has been minimized.

Copy link
Contributor Author

TacoGrandeTX commented Feb 12, 2019

@cmonr We have a dialogue on the internal JIRA and I'm now testing the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.