diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/llfasttimer.cpp | 32 | ||||
-rw-r--r-- | indra/llcommon/llfasttimer.h | 11 | ||||
-rw-r--r-- | indra/llcommon/lltrace.h | 5 | ||||
-rw-r--r-- | indra/llcommon/lltracerecording.cpp | 8 | ||||
-rw-r--r-- | indra/llcommon/llunit.h | 5 | ||||
-rw-r--r-- | indra/newview/llfasttimerview.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewertexturelist.cpp | 2 |
7 files changed, 28 insertions, 37 deletions
diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index 0ea91d7e51..5baf049c03 100644 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -256,16 +256,12 @@ void TimeBlock::processTimes() while(cur_timer && cur_timer->mParentTimerData.mActiveTimer != cur_timer) { U64 cumulative_time_delta = cur_time - cur_timer->mStartTime; - U64 child_time = stack_record->mChildTime - - (accumulator->mSelfTimeCounter - cur_timer->mStartSelfTimeCounter) - - (accumulator->mChildTimeCounter - cur_timer->mStartChildTimeCounter); - accumulator->mChildTimeCounter += child_time; - accumulator->mSelfTimeCounter += cumulative_time_delta - child_time; + accumulator->mTotalTimeCounter += cumulative_time_delta - (accumulator->mTotalTimeCounter - cur_timer->mBlockStartTotalTimeCounter); + accumulator->mSelfTimeCounter += cumulative_time_delta - stack_record->mChildTime; stack_record->mChildTime = 0; cur_timer->mStartTime = cur_time; - cur_timer->mStartSelfTimeCounter = accumulator->mSelfTimeCounter; - cur_timer->mStartChildTimeCounter = accumulator->mChildTimeCounter; + cur_timer->mBlockStartTotalTimeCounter = accumulator->mTotalTimeCounter; stack_record = &cur_timer->mParentTimerData; accumulator = stack_record->mTimeBlock->getPrimaryAccumulator(); @@ -380,7 +376,7 @@ void TimeBlock::dumpCurTimes() } 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"; llinfos << out_str.str() << llendl; @@ -404,10 +400,9 @@ void TimeBlock::writeLog(std::ostream& os) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// TimeBlockAccumulator::TimeBlockAccumulator() -: mChildTimeCounter(0), +: mTotalTimeCounter(0), mSelfTimeCounter(0), - mStartChildTimeCounter(0), - mStartSelfTimeCounter(0), + mStartTotalTimeCounter(0), mCalls(0), mLastCaller(NULL), mActiveCount(0), @@ -417,8 +412,8 @@ TimeBlockAccumulator::TimeBlockAccumulator() void TimeBlockAccumulator::addSamples( const TimeBlockAccumulator& other ) { - mChildTimeCounter += other.mChildTimeCounter - other.mStartChildTimeCounter; - mSelfTimeCounter += other.mSelfTimeCounter - other.mStartSelfTimeCounter; + mTotalTimeCounter += other.mTotalTimeCounter - other.mStartTotalTimeCounter; + mSelfTimeCounter += other.mSelfTimeCounter; mCalls += other.mCalls; mLastCaller = other.mLastCaller; mActiveCount = other.mActiveCount; @@ -429,12 +424,12 @@ void TimeBlockAccumulator::addSamples( const TimeBlockAccumulator& other ) void TimeBlockAccumulator::reset( const TimeBlockAccumulator* other ) { mCalls = 0; + mSelfTimeCounter = 0; + if (other) { - mStartSelfTimeCounter = other->mSelfTimeCounter; - mSelfTimeCounter = mStartSelfTimeCounter; - mStartChildTimeCounter = other->mChildTimeCounter; - mChildTimeCounter = mStartChildTimeCounter; + mStartTotalTimeCounter = other->mTotalTimeCounter; + mTotalTimeCounter = mStartTotalTimeCounter; mLastCaller = other->mLastCaller; mActiveCount = other->mActiveCount; @@ -443,8 +438,7 @@ void TimeBlockAccumulator::reset( const TimeBlockAccumulator* other ) } else { - mStartSelfTimeCounter = mSelfTimeCounter; - mStartChildTimeCounter = mChildTimeCounter; + mStartTotalTimeCounter = mTotalTimeCounter; } } diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 28e54a37de..32a0629a87 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -76,8 +76,7 @@ public: private: U64 mStartTime; - U64 mStartSelfTimeCounter; - U64 mStartChildTimeCounter; + U64 mBlockStartTotalTimeCounter; BlockTimerStackRecord mParentTimerData; }; @@ -283,8 +282,7 @@ LL_FORCE_INLINE BlockTimer::BlockTimer(TimeBlock& timer) BlockTimerStackRecord* cur_timer_data = ThreadTimerStack::getIfExists(); TimeBlockAccumulator* accumulator = timer.getPrimaryAccumulator(); accumulator->mActiveCount++; - mStartSelfTimeCounter = accumulator->mSelfTimeCounter; - mStartChildTimeCounter = accumulator->mChildTimeCounter; + mBlockStartTotalTimeCounter = accumulator->mTotalTimeCounter; // keep current parent as long as it is active when we are accumulator->mMoveUpTree |= (accumulator->mParent->getPrimaryAccumulator()->mActiveCount == 0); @@ -304,11 +302,8 @@ LL_FORCE_INLINE BlockTimer::~BlockTimer() BlockTimerStackRecord* cur_timer_data = ThreadTimerStack::getIfExists(); TimeBlockAccumulator* accumulator = cur_timer_data->mTimeBlock->getPrimaryAccumulator(); - U64 child_time = cur_timer_data->mChildTime - - (accumulator->mSelfTimeCounter - mStartSelfTimeCounter) - - (accumulator->mChildTimeCounter - mStartChildTimeCounter); accumulator->mCalls++; - accumulator->mChildTimeCounter += child_time; + accumulator->mTotalTimeCounter += total_time - (accumulator->mTotalTimeCounter - mBlockStartTotalTimeCounter); accumulator->mSelfTimeCounter += total_time - cur_timer_data->mChildTime; accumulator->mActiveCount--; diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index 8c3259eea9..5d57327a14 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -444,9 +444,8 @@ namespace LLTrace // // members // - U64 mStartChildTimeCounter, - mStartSelfTimeCounter, - mChildTimeCounter, + U64 mStartTotalTimeCounter, + mTotalTimeCounter, mSelfTimeCounter; U32 mCalls; class TimeBlock* mParent; // last acknowledged parent of this time block diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 2af9041863..ab8dbce2ce 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -183,14 +183,14 @@ void Recording::mergeRecording( const Recording& other) LLUnit<LLUnits::Seconds, F64> Recording::getSum(const TraceType<TimeBlockAccumulator>& stat) const { const TimeBlockAccumulator& accumulator = (*mStackTimers)[stat.getIndex()]; - return (F64)(accumulator.mSelfTimeCounter - accumulator.mStartSelfTimeCounter + accumulator.mChildTimeCounter - accumulator.mStartChildTimeCounter) + return (F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond(); } LLUnit<LLUnits::Seconds, F64> Recording::getSum(const TraceType<TimeBlockAccumulator::SelfTimeAspect>& stat) const { const TimeBlockAccumulator& accumulator = (*mStackTimers)[stat.getIndex()]; - return (F64)(accumulator.mSelfTimeCounter - accumulator.mStartSelfTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond(); + return (F64)(accumulator.mSelfTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond(); } @@ -203,7 +203,7 @@ LLUnit<LLUnits::Seconds, F64> Recording::getPerSec(const TraceType<TimeBlockAccu { const TimeBlockAccumulator& accumulator = (*mStackTimers)[stat.getIndex()]; - return (F64)(accumulator.mSelfTimeCounter - accumulator.mStartSelfTimeCounter + accumulator.mChildTimeCounter - accumulator.mStartChildTimeCounter) + return (F64)(accumulator.mTotalTimeCounter - accumulator.mStartTotalTimeCounter) / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds); } @@ -211,7 +211,7 @@ LLUnit<LLUnits::Seconds, F64> Recording::getPerSec(const TraceType<TimeBlockAccu { const TimeBlockAccumulator& accumulator = (*mStackTimers)[stat.getIndex()]; - return (F64)(accumulator.mSelfTimeCounter - accumulator.mStartSelfTimeCounter) + return (F64)(accumulator.mSelfTimeCounter) / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds); } diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index c2a31b7604..823550db5d 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -106,11 +106,12 @@ struct LLUnit 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) { mValue += value; diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 1a1a4a8b44..3893b0e772 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -1403,7 +1403,7 @@ void LLFastTimerView::updateTotalTime() 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() diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 3106a351e0..6f8b439049 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -599,9 +599,11 @@ static LLFastTimer::DeclareTimer FTM_IMAGE_FETCH("Fetch"); static LLFastTimer::DeclareTimer FTM_FAST_CACHE_IMAGE_FETCH("Fast Cache Fetch"); static LLFastTimer::DeclareTimer FTM_IMAGE_CREATE("Create"); static LLFastTimer::DeclareTimer FTM_IMAGE_STATS("Stats"); +static LLFastTimer::DeclareTimer FTM_UPDATE_IMAGES("Update Images"); void LLViewerTextureList::updateImages(F32 max_time) { + LLFastTimer _(FTM_UPDATE_IMAGES); static BOOL cleared = FALSE; if(gTeleportDisplay) { |