Skip to content
Snippets Groups Projects
Commit a6bb68b6 authored by Richard Linden's avatar Richard Linden
Browse files

SH-3275 FIX interesting Update viewer metrics system to be more flexible

fix for inaccurate optimization of full block time calculations
parent 67ac6e7a
No related branches found
No related tags found
No related merge requests found
...@@ -256,12 +256,12 @@ void TimeBlock::processTimes() ...@@ -256,12 +256,12 @@ void TimeBlock::processTimes()
while(cur_timer && cur_timer->mParentTimerData.mActiveTimer != cur_timer) while(cur_timer && cur_timer->mParentTimerData.mActiveTimer != cur_timer)
{ {
U64 cumulative_time_delta = cur_time - cur_timer->mStartTime; U64 cumulative_time_delta = cur_time - cur_timer->mStartTime;
accumulator->mTotalTimeCounter += cumulative_time_delta - (accumulator->mTotalTimeCounter - accumulator->mStartTotalTimeCounter); accumulator->mTotalTimeCounter += cumulative_time_delta - (accumulator->mTotalTimeCounter - cur_timer->mBlockStartTotalTimeCounter);
accumulator->mSelfTimeCounter += cumulative_time_delta - stack_record->mChildTime; accumulator->mSelfTimeCounter += cumulative_time_delta - stack_record->mChildTime;
stack_record->mChildTime = 0; stack_record->mChildTime = 0;
cur_timer->mStartTime = cur_time; cur_timer->mStartTime = cur_time;
cur_timer->mStartTotalTimeCounter = accumulator->mTotalTimeCounter; cur_timer->mBlockStartTotalTimeCounter = accumulator->mTotalTimeCounter;
stack_record = &cur_timer->mParentTimerData; stack_record = &cur_timer->mParentTimerData;
accumulator = stack_record->mTimeBlock->getPrimaryAccumulator(); accumulator = stack_record->mTimeBlock->getPrimaryAccumulator();
...@@ -376,7 +376,7 @@ void TimeBlock::dumpCurTimes() ...@@ -376,7 +376,7 @@ void TimeBlock::dumpCurTimes()
} }
out_str << timerp->getName() << " " out_str << timerp->getName() << " "
<< std::setprecision(3) << total_time_ms.as<LLUnits::Milliseconds, F32>().value() << " ms, " << std::setprecision(3) << total_time_ms.as<LLUnits::Milliseconds>().value() << " ms, "
<< num_calls << " calls"; << num_calls << " calls";
llinfos << out_str.str() << llendl; llinfos << out_str.str() << llendl;
......
...@@ -76,7 +76,7 @@ class BlockTimer ...@@ -76,7 +76,7 @@ class BlockTimer
private: private:
U64 mStartTime; U64 mStartTime;
U64 mStartTotalTimeCounter; U64 mBlockStartTotalTimeCounter;
BlockTimerStackRecord mParentTimerData; BlockTimerStackRecord mParentTimerData;
}; };
...@@ -282,7 +282,7 @@ LL_FORCE_INLINE BlockTimer::BlockTimer(TimeBlock& timer) ...@@ -282,7 +282,7 @@ LL_FORCE_INLINE BlockTimer::BlockTimer(TimeBlock& timer)
BlockTimerStackRecord* cur_timer_data = ThreadTimerStack::getIfExists(); BlockTimerStackRecord* cur_timer_data = ThreadTimerStack::getIfExists();
TimeBlockAccumulator* accumulator = timer.getPrimaryAccumulator(); TimeBlockAccumulator* accumulator = timer.getPrimaryAccumulator();
accumulator->mActiveCount++; accumulator->mActiveCount++;
mStartTotalTimeCounter = accumulator->mTotalTimeCounter; mBlockStartTotalTimeCounter = accumulator->mTotalTimeCounter;
// keep current parent as long as it is active when we are // keep current parent as long as it is active when we are
accumulator->mMoveUpTree |= (accumulator->mParent->getPrimaryAccumulator()->mActiveCount == 0); accumulator->mMoveUpTree |= (accumulator->mParent->getPrimaryAccumulator()->mActiveCount == 0);
...@@ -303,7 +303,7 @@ LL_FORCE_INLINE BlockTimer::~BlockTimer() ...@@ -303,7 +303,7 @@ LL_FORCE_INLINE BlockTimer::~BlockTimer()
TimeBlockAccumulator* accumulator = cur_timer_data->mTimeBlock->getPrimaryAccumulator(); TimeBlockAccumulator* accumulator = cur_timer_data->mTimeBlock->getPrimaryAccumulator();
accumulator->mCalls++; accumulator->mCalls++;
accumulator->mTotalTimeCounter += total_time - (accumulator->mTotalTimeCounter - mStartTotalTimeCounter); accumulator->mTotalTimeCounter += total_time - (accumulator->mTotalTimeCounter - mBlockStartTotalTimeCounter);
accumulator->mSelfTimeCounter += total_time - cur_timer_data->mChildTime; accumulator->mSelfTimeCounter += total_time - cur_timer_data->mChildTime;
accumulator->mActiveCount--; accumulator->mActiveCount--;
......
...@@ -106,11 +106,12 @@ struct LLUnit ...@@ -106,11 +106,12 @@ struct LLUnit
return mValue; return mValue;
} }
template<typename NEW_UNIT_TYPE, typename NEW_STORAGE_TYPE> LLUnit<NEW_UNIT_TYPE, NEW_STORAGE_TYPE> as() template<typename NEW_UNIT_TYPE> LLUnit<NEW_UNIT_TYPE, STORAGE_TYPE> as()
{ {
return LLUnit<NEW_UNIT_TYPE, NEW_STORAGE_TYPE>(*this); return LLUnit<NEW_UNIT_TYPE, STORAGE_TYPE>(*this);
} }
void operator += (storage_t value) void operator += (storage_t value)
{ {
mValue += value; mValue += value;
......
...@@ -1403,7 +1403,7 @@ void LLFastTimerView::updateTotalTime() ...@@ -1403,7 +1403,7 @@ void LLFastTimerView::updateTotalTime()
break; break;
} }
mTotalTimeDisplay = LLUnit<LLUnits::Milliseconds, F32>(llceil(mTotalTimeDisplay.as<LLUnits::Milliseconds, F32>().value() / (20.f)) * 20.f); mTotalTimeDisplay = LLUnit<LLUnits::Milliseconds, F32>(llceil(mTotalTimeDisplay.as<LLUnits::Milliseconds>().value() / 20.f) * 20.f);
} }
void LLFastTimerView::drawBars() void LLFastTimerView::drawBars()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment