SH-4297 WIP interesting: viewer-interesting starts loading cached scene late

fixed ostream precision munging in llsys
master
Richard Linden 2013-07-18 15:08:46 -07:00
parent bd078122e3
commit 862cdf3061
3 changed files with 43 additions and 39 deletions

View File

@ -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;
{
// 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();
// 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;
}
}

View File

@ -1395,9 +1395,14 @@ public:
LL_CONT << "slowest framerate for last " << int(prevSize * MEM_INFO_THROTTLE)
<< " seconds ";
}
LL_CONT << std::fixed << std::setprecision(1) << framerate << '\n'
<< LLMemoryInfo() << LL_ENDL;
S32 precision = LL_CONT.precision();
LL_CONT << std::fixed << std::setprecision(1) << framerate << '\n'
<< LLMemoryInfo();
LL_CONT.precision(precision);
LL_CONT << LL_ENDL;
return false;
}

View File

@ -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