-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Measure duration #29824
Measure duration #29824
Conversation
adding network commissioning
Tested esp32 and nRF boards
Using SystemPlatformConfig.h to determine board/clock type
Measure duration 1015
|
duration return type change
Measure duration 1019 sytemclock
PR #29824: Size comparison from 19d03a0 to 01ddb37 Increases above 0.2%:
Increases (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
@@ -117,6 +117,7 @@ | |||
|
|||
# Only uses <chrono> for zero-cost types. | |||
'src/system/SystemClock.h': {'chrono'}, | |||
'src/system/DurationTimer.h': {'string'}, |
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.
This one is used in things that are used in embedded ... so you cannot use STL that uses HEAP. this is not allowed.
Overall this duration timer seems not something we want in the SDK since we have MATTER_TRACE_SCOPE that is for scoped tracing. You can create a "trace to log" and include some filters if you want to only trace specific things.
@@ -123,6 +124,9 @@ CHIP_ERROR CASEServer::OnMessageReceived(Messaging::ExchangeContext * ec, const | |||
|
|||
void CASEServer::PrepareForSessionEstablishment(const ScopedNodeId & previouslyEstablishedPeer) | |||
{ | |||
chip::timing::DurationTimer timer = chip::timing::GetDefaultTimingInstance( "Inet: CASE Session establishment" ); | |||
timer.start(); |
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.
generally you want RAII rather than start/stop.
Although since this happens across messages you probably need something else. BEGIN/END exist in tracing too, however you must make sure they are properly nested by contract (not sure if that can be done here) or you could use instant tracing and then post-process for getting durations.
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.
Actually looking at code these are always local variables, so TRACE_SCOPE works fine here. and is RAII (which this code is not and should be)
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.
Thanks @andy31415 and @bzbarsky-apple for the review. Your comments are much appreciated. I will look at extending TRACE_SCOPE.
PR #29824: Size comparison from 916ba56 to 8568185 Increases above 0.2%:
Increases (64 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, k32w, linux, mbed, nrfconnect, qpg, telink)
Decreases (1 build for linux)
Full report (65 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, k32w, linux, mbed, nrfconnect, qpg, telink)
|
merge from master
PR #29824: Size comparison from ddc961d to 8db23f5 Increases above 0.2%:
Increases (71 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
Decreases (1 build for linux)
Full report (72 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Old PR with changes requested and merge conflicts. Assuming stale and closing. |
DurationTimer class is intended to capture device performance such as the commissioning sub-processes. DurationTimer is meant to be device agnostic and can also be adopted to capture long running processes.