Skip to content

Commit

Permalink
Renamed mTimeTrackers to mLatestTimeTrackers for the sake of clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
lpbeliveau-silabs committed Nov 16, 2024
1 parent dc8cb19 commit 889037a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/platform/silabs/tracing/SilabsTracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ CHIP_ERROR SilabsTracer::Init()
TraceBufferClear();

// Initialize the time trackers
memset(mTimeTrackers, 0, sizeof(mTimeTrackers));
memset(mLatestTimeTrackers, 0, sizeof(mLatestTimeTrackers));
memset(mWatermarks, 0, sizeof(mWatermarks));

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

void SilabsTracer::TimeTraceEnd(TimeTraceOperation aOperation, CHIP_ERROR error)
{
auto & tracker = mTimeTrackers[static_cast<size_t>(aOperation)];
auto & tracker = mLatestTimeTrackers[static_cast<size_t>(aOperation)];
tracker.mEndTime = System::SystemClock().GetMonotonicTimestamp();
tracker.mType = OperationType::kEnd;
tracker.mError = error;
Expand Down Expand Up @@ -116,7 +116,7 @@ void SilabsTracer::TimeTraceEnd(TimeTraceOperation aOperation, CHIP_ERROR error)

void SilabsTracer::TimeTraceInstant(TimeTraceOperation aOperation, CHIP_ERROR error)
{
auto & tracker = mTimeTrackers[static_cast<size_t>(aOperation)];
TimeTracker tracker;
tracker.mStartTime = System::SystemClock().GetMonotonicTimestamp();
tracker.mEndTime = tracker.mStartTime;
tracker.mOperation = aOperation;
Expand Down
4 changes: 2 additions & 2 deletions src/platform/silabs/tracing/SilabsTracing.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class SilabsTracer
SilabsTracer & operator=(SilabsTracer const &) = delete;

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

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

// Time trackers to store time stamps for ongoing operations
TimeTracker mTimeTrackers[kNumTraces];
TimeTracker mLatestTimeTrackers[kNumTraces];

// Watermarks for each operation
Watermark mWatermarks[kNumTraces];
Expand Down

0 comments on commit 889037a

Please sign in to comment.