diff --git a/src/platform/silabs/tracing/SilabsTracing.cpp b/src/platform/silabs/tracing/SilabsTracing.cpp index 5a1c5de607..159194c6e3 100644 --- a/src/platform/silabs/tracing/SilabsTracing.cpp +++ b/src/platform/silabs/tracing/SilabsTracing.cpp @@ -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; @@ -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(aOperation)]; + auto & tracker = mLatestTimeTrackers[static_cast(aOperation)]; tracker.mStartTime = System::SystemClock().GetMonotonicTimestamp(); tracker.mOperation = aOperation; tracker.mType = OperationType::kBegin; @@ -79,7 +79,7 @@ void SilabsTracer::TimeTraceBegin(TimeTraceOperation aOperation) void SilabsTracer::TimeTraceEnd(TimeTraceOperation aOperation, CHIP_ERROR error) { - auto & tracker = mTimeTrackers[static_cast(aOperation)]; + auto & tracker = mLatestTimeTrackers[static_cast(aOperation)]; tracker.mEndTime = System::SystemClock().GetMonotonicTimestamp(); tracker.mType = OperationType::kEnd; tracker.mError = error; @@ -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(aOperation)]; + TimeTracker tracker; tracker.mStartTime = System::SystemClock().GetMonotonicTimestamp(); tracker.mEndTime = tracker.mStartTime; tracker.mOperation = aOperation; diff --git a/src/platform/silabs/tracing/SilabsTracing.h b/src/platform/silabs/tracing/SilabsTracing.h index 696696b959..c0930f0906 100644 --- a/src/platform/silabs/tracing/SilabsTracing.h +++ b/src/platform/silabs/tracing/SilabsTracing.h @@ -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 @@ -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];