diff options
author | Richard Linden <none@none> | 2013-07-18 15:08:46 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-07-18 15:08:46 -0700 |
commit | 862cdf3061d66dfe4ae482f24436960b136a3ce4 (patch) | |
tree | 50c25e42e7d08fd4ba7ecd5d5b04837eb26104ef /indra | |
parent | bd078122e3a87e958fb6b0ea9caeef885298d527 (diff) |
SH-4297 WIP interesting: viewer-interesting starts loading cached scene late
fixed ostream precision munging in llsys
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llcommon/llfasttimer.cpp | 67 | ||||
-rwxr-xr-x | indra/llcommon/llsys.cpp | 7 | ||||
-rwxr-xr-x | indra/llcommon/llthread.cpp | 8 |
3 files changed, 43 insertions, 39 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; } } diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index 95bbcbc816..5d805ba841 100755 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -1395,9 +1395,14 @@ public: LL_CONT << "slowest framerate for last " << int(prevSize * MEM_INFO_THROTTLE) << " seconds "; } + + S32 precision = LL_CONT.precision(); + LL_CONT << std::fixed << std::setprecision(1) << framerate << '\n' - << LLMemoryInfo() << LL_ENDL; + << LLMemoryInfo(); + LL_CONT.precision(precision); + LL_CONT << LL_ENDL; return false; } diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index e0f53fb9c4..db7ddbbfd3 100755 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -47,13 +47,13 @@ const DWORD MS_VC_EXCEPTION=0x406D1388; typedef struct tagTHREADNAME_INFO { DWORD dwType; // Must be 0x1000. - const char* szName; // Pointer to name (in user addr space). + LPCSTR szName; // Pointer to name (in user addr space). DWORD dwThreadID; // Thread ID (-1=caller thread). DWORD dwFlags; // Reserved for future use, must be zero. } THREADNAME_INFO; #pragma pack(pop) -void SetThreadName( DWORD dwThreadID, const char* threadName) +void set_thread_name( DWORD dwThreadID, const char* threadName) { THREADNAME_INFO info; info.dwType = 0x1000; @@ -63,7 +63,7 @@ void SetThreadName( DWORD dwThreadID, const char* threadName) __try { - RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (DWORD*)&info ); + ::RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (DWORD*)&info ); } __except(EXCEPTION_CONTINUE_EXECUTION) { @@ -127,7 +127,7 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap LLThread *threadp = (LLThread *)datap; #ifdef LL_WINDOWS - SetThreadName(-1, threadp->mName.c_str()); + set_thread_name(-1, threadp->mName.c_str()); #endif |