Skip to content

Commit 889037a

Browse files
Renamed mTimeTrackers to mLatestTimeTrackers for the sake of clarity
1 parent dc8cb19 commit 889037a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/platform/silabs/tracing/SilabsTracing.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ CHIP_ERROR SilabsTracer::Init()
4949
TraceBufferClear();
5050

5151
// Initialize the time trackers
52-
memset(mTimeTrackers, 0, sizeof(mTimeTrackers));
52+
memset(mLatestTimeTrackers, 0, sizeof(mLatestTimeTrackers));
5353
memset(mWatermarks, 0, sizeof(mWatermarks));
5454

5555
return CHIP_NO_ERROR;
@@ -65,7 +65,7 @@ CHIP_ERROR SilabsTracer::StartWatermarksStorage(PersistentStorageDelegate * stor
6565
void SilabsTracer::TimeTraceBegin(TimeTraceOperation aOperation)
6666
{
6767
// Log the start time of the operation
68-
auto & tracker = mTimeTrackers[static_cast<size_t>(aOperation)];
68+
auto & tracker = mLatestTimeTrackers[static_cast<size_t>(aOperation)];
6969
tracker.mStartTime = System::SystemClock().GetMonotonicTimestamp();
7070
tracker.mOperation = aOperation;
7171
tracker.mType = OperationType::kBegin;
@@ -79,7 +79,7 @@ void SilabsTracer::TimeTraceBegin(TimeTraceOperation aOperation)
7979

8080
void SilabsTracer::TimeTraceEnd(TimeTraceOperation aOperation, CHIP_ERROR error)
8181
{
82-
auto & tracker = mTimeTrackers[static_cast<size_t>(aOperation)];
82+
auto & tracker = mLatestTimeTrackers[static_cast<size_t>(aOperation)];
8383
tracker.mEndTime = System::SystemClock().GetMonotonicTimestamp();
8484
tracker.mType = OperationType::kEnd;
8585
tracker.mError = error;
@@ -116,7 +116,7 @@ void SilabsTracer::TimeTraceEnd(TimeTraceOperation aOperation, CHIP_ERROR error)
116116

117117
void SilabsTracer::TimeTraceInstant(TimeTraceOperation aOperation, CHIP_ERROR error)
118118
{
119-
auto & tracker = mTimeTrackers[static_cast<size_t>(aOperation)];
119+
TimeTracker tracker;
120120
tracker.mStartTime = System::SystemClock().GetMonotonicTimestamp();
121121
tracker.mEndTime = tracker.mStartTime;
122122
tracker.mOperation = aOperation;

src/platform/silabs/tracing/SilabsTracing.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class SilabsTracer
121121
SilabsTracer & operator=(SilabsTracer const &) = delete;
122122

123123
// Methods to get the time trackers metrics values
124-
TimeTracker GetTimeTracker(TimeTraceOperation aOperation) { return mTimeTrackers[to_underlying(aOperation)]; }
124+
TimeTracker GetTimeTracker(TimeTraceOperation aOperation) { return mLatestTimeTrackers[to_underlying(aOperation)]; }
125125
Watermark GetWatermark(TimeTraceOperation aOperation) { return mWatermarks[to_underlying(aOperation)]; }
126126

127127
// Method to save the time trackers in the NVM, this will likely be time consuming and should not be called frequently
@@ -187,7 +187,7 @@ class SilabsTracer
187187
TimeTrackerList mTimeTrackerList;
188188

189189
// Time trackers to store time stamps for ongoing operations
190-
TimeTracker mTimeTrackers[kNumTraces];
190+
TimeTracker mLatestTimeTrackers[kNumTraces];
191191

192192
// Watermarks for each operation
193193
Watermark mWatermarks[kNumTraces];

0 commit comments

Comments
 (0)