diff options
Diffstat (limited to 'indra/llcommon/llfasttimer.cpp')
-rwxr-xr-x | indra/llcommon/llfasttimer.cpp | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index a72f16d385..79aa0c8722 100755 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -117,22 +117,22 @@ struct SortTimerByName }; TimeBlock& TimeBlock::getRootTimeBlock() - { +{ static TimeBlock root_timer("root", NULL); return root_timer; - } +} void TimeBlock::pushLog(LLSD log) - { +{ LLMutexLock lock(sLogLock); sLogQueue.push(log); - } +} void TimeBlock::setLogLock(LLMutex* lock) - { +{ sLogLock = lock; - } +} //static @@ -166,8 +166,7 @@ U64 TimeBlock::countsPerSecond() TimeBlock::TimeBlock(const char* name, TimeBlock* parent) : TraceType<TimeBlockAccumulator>(name) -{ -} +{} TimeBlockTreeNode& TimeBlock::getTreeNode() const { @@ -182,7 +181,7 @@ void TimeBlock::bootstrapTimerTree() for (LLInstanceTracker<TimeBlock>::instance_iter begin_it = LLInstanceTracker<TimeBlock>::beginInstances(), end_it = LLInstanceTracker<TimeBlock>::endInstances(), it = begin_it; it != end_it; ++it) - { + { TimeBlock& timer = *it; if (&timer == &TimeBlock::getRootTimeBlock()) continue; @@ -193,13 +192,13 @@ void TimeBlock::bootstrapTimerTree() TimeBlockAccumulator* accumulator = timer.getPrimaryAccumulator(); if (accumulator->mLastCaller) - { + { timer.setParent(accumulator->mLastCaller); accumulator->mParent = accumulator->mLastCaller; - } + } // no need to push up tree on first use, flag can be set spuriously accumulator->mMoveUpTree = false; -} + } } } @@ -217,32 +216,32 @@ void TimeBlock::incrementalUpdateTimerTree() // sort timers by time last called, so call graph makes sense TimeBlockTreeNode& tree_node = timerp->getTreeNode(); if (tree_node.mNeedsSorting) - { + { std::sort(tree_node.mChildren.begin(), tree_node.mChildren.end(), SortTimerByName()); - } + } // skip root timer if (timerp != &TimeBlock::getRootTimeBlock()) - { + { TimeBlockAccumulator* accumulator = timerp->getPrimaryAccumulator(); if (accumulator->mMoveUpTree) - { - // since ancestors have already been visited, re-parenting won't affect tree traversal - //step up tree, bringing our descendants with us - LL_DEBUGS("FastTimers") << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() << - " to child of " << timerp->getParent()->getParent()->getName() << LL_ENDL; - timerp->setParent(timerp->getParent()->getParent()); - accumulator->mParent = timerp->getParent(); - accumulator->mMoveUpTree = false; - - // don't bubble up any ancestors until descendants are done bubbling up - // as ancestors may call this timer only on certain paths, so we want to resolve - // child-most block locations before their parents - it.skipAncestors(); + { + // since ancestors have already been visited, re-parenting won't affect tree traversal + //step up tree, bringing our descendants with us + LL_DEBUGS("FastTimers") << "Moving " << timerp->getName() << " from child of " << timerp->getParent()->getName() << + " to child of " << timerp->getParent()->getParent()->getName() << LL_ENDL; + timerp->setParent(timerp->getParent()->getParent()); + accumulator->mParent = timerp->getParent(); + accumulator->mMoveUpTree = false; + + // don't bubble up any ancestors until descendants are done bubbling up + // as ancestors may call this timer only on certain paths, so we want to resolve + // child-most block locations before their parents + it.skipAncestors(); + } } } - } } @@ -308,12 +307,12 @@ void TimeBlock::processTimes() } std::vector<TimeBlock*>::iterator TimeBlock::beginChildren() - { +{ return getTreeNode().mChildren.begin(); - } +} std::vector<TimeBlock*>::iterator TimeBlock::endChildren() - { +{ return getTreeNode().mChildren.end(); } @@ -373,7 +372,7 @@ void TimeBlock::logStats() //static void TimeBlock::dumpCurTimes() - { +{ LLTrace::PeriodicRecording& frame_recording = LLTrace::get_frame_recording(); LLTrace::Recording& last_frame_recording = frame_recording.getLastRecording(); @@ -462,7 +461,7 @@ void TimeBlockAccumulator::reset( const TimeBlockAccumulator* other ) mParent = other->mParent; } else -{ + { mStartTotalTimeCounter = mTotalTimeCounter; } } |