From d122318bef2ff0eced7641dc24f411f792bd2935 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 8 Jul 2013 00:55:17 -0700 Subject: SH-4299 WIP: Interesting: High fps shown temporarily off scale in statistics console added percentage/ratio units added auto-range and auto tick calculation to stat bar to automate display stats --- indra/llcommon/llmemory.cpp | 137 -------------------------------------------- indra/llcommon/llmemory.h | 45 --------------- indra/llcommon/lltrace.h | 3 +- indra/llcommon/llunit.h | 5 ++ 4 files changed, 7 insertions(+), 183 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index c6b02df939..3fe7470d06 100755 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -27,9 +27,7 @@ #include "linden_common.h" -//#if MEM_TRACK_MEM #include "llthread.h" -//#endif #if defined(LL_WINDOWS) # include @@ -421,141 +419,6 @@ U32 LLMemory::getWorkingSetSize() #endif -//-------------------------------------------------------------------------------------------------- -#if MEM_TRACK_MEM -#include "llframetimer.h" - -//static -LLMemTracker* LLMemTracker::sInstance = NULL ; - -LLMemTracker::LLMemTracker() -{ - mLastAllocatedMem = LLMemory::getWorkingSetSize() ; - mCapacity = 128 ; - mCurIndex = 0 ; - mCounter = 0 ; - mDrawnIndex = 0 ; - mPaused = FALSE ; - - mMutexp = new LLMutex() ; - mStringBuffer = new char*[128] ; - mStringBuffer[0] = new char[mCapacity * 128] ; - for(S32 i = 1 ; i < mCapacity ; i++) - { - mStringBuffer[i] = mStringBuffer[i-1] + 128 ; - } -} - -LLMemTracker::~LLMemTracker() -{ - delete[] mStringBuffer[0] ; - delete[] mStringBuffer; - delete mMutexp ; -} - -//static -LLMemTracker* LLMemTracker::getInstance() -{ - if(!sInstance) - { - sInstance = new LLMemTracker() ; - } - return sInstance ; -} - -//static -void LLMemTracker::release() -{ - if(sInstance) - { - delete sInstance ; - sInstance = NULL ; - } -} - -//static -void LLMemTracker::track(const char* function, const int line) -{ - static const S32 MIN_ALLOCATION = 0 ; //1KB - - if(mPaused) - { - return ; - } - - U32 allocated_mem = LLMemory::getWorkingSetSize() ; - - LLMutexLock lock(mMutexp) ; - - S32 delta_mem = allocated_mem - mLastAllocatedMem ; - mLastAllocatedMem = allocated_mem ; - - if(delta_mem <= 0) - { - return ; //occupied memory does not grow - } - - if(delta_mem < MIN_ALLOCATION) - { - return ; - } - - char* buffer = mStringBuffer[mCurIndex++] ; - F32 time = (F32)LLFrameTimer::getElapsedSeconds() ; - S32 hours = (S32)(time / (60*60)); - S32 mins = (S32)((time - hours*(60*60)) / 60); - S32 secs = (S32)((time - hours*(60*60) - mins*60)); - strcpy(buffer, function) ; - sprintf(buffer + strlen(function), " line: %d DeltaMem: %d (bytes) Time: %d:%02d:%02d", line, delta_mem, hours,mins,secs) ; - - if(mCounter < mCapacity) - { - mCounter++ ; - } - if(mCurIndex >= mCapacity) - { - mCurIndex = 0 ; - } -} - - -//static -void LLMemTracker::preDraw(BOOL pause) -{ - mMutexp->lock() ; - - mPaused = pause ; - mDrawnIndex = mCurIndex - 1; - mNumOfDrawn = 0 ; -} - -//static -void LLMemTracker::postDraw() -{ - mMutexp->unlock() ; -} - -//static -const char* LLMemTracker::getNextLine() -{ - if(mNumOfDrawn >= mCounter) - { - return NULL ; - } - mNumOfDrawn++; - - if(mDrawnIndex < 0) - { - mDrawnIndex = mCapacity - 1 ; - } - - return mStringBuffer[mDrawnIndex--] ; -} - -#endif //MEM_TRACK_MEM -//-------------------------------------------------------------------------------------------------- - - //-------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------- //minimum slot size and minimal slot size interval diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 95500753e4..a24d97576f 100755 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -184,51 +184,6 @@ private: static BOOL sEnableMemoryFailurePrevention; }; -//---------------------------------------------------------------------------- -#if MEM_TRACK_MEM -class LLMutex ; -class LL_COMMON_API LLMemTracker -{ -private: - LLMemTracker() ; - ~LLMemTracker() ; - -public: - static void release() ; - static LLMemTracker* getInstance() ; - - void track(const char* function, const int line) ; - void preDraw(BOOL pause) ; - void postDraw() ; - const char* getNextLine() ; - -private: - static LLMemTracker* sInstance ; - - char** mStringBuffer ; - S32 mCapacity ; - U32 mLastAllocatedMem ; - S32 mCurIndex ; - S32 mCounter; - S32 mDrawnIndex; - S32 mNumOfDrawn; - BOOL mPaused; - LLMutex* mMutexp ; -}; - -#define MEM_TRACK_RELEASE LLMemTracker::release() ; -#define MEM_TRACK LLMemTracker::getInstance()->track(__FUNCTION__, __LINE__) ; - -#else // MEM_TRACK_MEM - -#define MEM_TRACK_RELEASE -#define MEM_TRACK - -#endif // MEM_TRACK_MEM - -//---------------------------------------------------------------------------- - - // //class LLPrivateMemoryPool defines a private memory pool for an application to use, so the application does not //need to access the heap directly fro each memory allocation. Throught this, the allocation speed is faster, diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index 2c45923aac..2c84b1596a 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -61,6 +61,7 @@ public: virtual const char* getUnitLabel(); const std::string& getName() const { return mName; } + const std::string& getDescription() const { return mDescription; } protected: const std::string mName; @@ -169,7 +170,7 @@ public: typedef TraceType trace_t; CountStatHandle(const char* name, const char* description = NULL) - : trace_t(name) + : trace_t(name, description) {} /*virtual*/ const char* getUnitLabel() { return LLGetUnitLabel::getUnitLabel(); } diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index c9bbed5574..79465715cf 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -571,6 +571,11 @@ LL_DECLARE_DERIVED_UNIT(Gigahertz, "GHz", Megahertz, * 1000); LL_DECLARE_BASE_UNIT(Radians, "rad"); LL_DECLARE_DERIVED_UNIT(Degrees, "deg", Radians, * 0.01745329251994); +LL_DECLARE_BASE_UNIT(Percent, "%"); +LL_DECLARE_DERIVED_UNIT(Ratio, "x", Percent, / 100); + +LL_DECLARE_BASE_UNIT(Triangles, "tris"); +LL_DECLARE_DERIVED_UNIT(Kilotriangles, "ktris", Triangles, * 1000); } // namespace LLUnits -- cgit v1.2.3 From 11e14cd3b0f58225a96b9b7a9839a7f030fe4045 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 15 Jul 2013 11:05:57 -0700 Subject: SH-4299Interesting: High fps shown temporarily off scale in statistics console various fixes to lltrace start() on started recording no longer resets fixed various instances of unit forgetfullness in lltrace recording split now has gapless timing scene monitor now guarantees min sample time renamed a bunch of stats added names to debug thread view on windows --- indra/llcommon/llthread.cpp | 39 +++++++++ indra/llcommon/lltraceaccumulators.h | 1 - indra/llcommon/lltracerecording.cpp | 15 +++- indra/llcommon/lltracerecording.h | 143 +++++++++++++++++++++++-------- indra/llcommon/lltracethreadrecorder.cpp | 7 +- indra/llcommon/lltracethreadrecorder.h | 2 +- 6 files changed, 163 insertions(+), 44 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 166a4eb26d..e0f53fb9c4 100755 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -39,6 +39,39 @@ #include #endif + +#ifdef LL_WINDOWS +const DWORD MS_VC_EXCEPTION=0x406D1388; + +#pragma pack(push,8) +typedef struct tagTHREADNAME_INFO +{ + DWORD dwType; // Must be 0x1000. + const char* 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) +{ + THREADNAME_INFO info; + info.dwType = 0x1000; + info.szName = threadName; + info.dwThreadID = dwThreadID; + info.dwFlags = 0; + + __try + { + RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (DWORD*)&info ); + } + __except(EXCEPTION_CONTINUE_EXECUTION) + { + } +} +#endif + + //---------------------------------------------------------------------------- // Usage: // void run_func(LLThread* thread) @@ -93,6 +126,11 @@ 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()); +#endif + + LLTrace::ThreadRecorder thread_recorder(*LLTrace::get_master_thread_recorder()); #if !LL_DARWIN @@ -224,6 +262,7 @@ void LLThread::start() llwarns << "failed to start thread " << mName << llendl; ll_apr_warn_status(status); } + } //============================================================================ diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h index fac6347ff9..a2f9f4c090 100644 --- a/indra/llcommon/lltraceaccumulators.h +++ b/indra/llcommon/lltraceaccumulators.h @@ -37,7 +37,6 @@ namespace LLTrace { - template class AccumulatorBuffer : public LLRefCount { diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index f1388e7935..875c371068 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -38,10 +38,13 @@ namespace LLTrace // Recording /////////////////////////////////////////////////////////////////////// -Recording::Recording() -: mElapsedSeconds(0) +Recording::Recording(EPlayState state) +: mElapsedSeconds(0), + mInHandOff(false) + { mBuffers = new AccumulatorBufferGroup(); + setPlayState(state); } Recording::Recording( const Recording& other ) @@ -101,7 +104,8 @@ void Recording::handleStart() { mSamplingTimer.reset(); mBuffers.setStayUnique(true); - LLTrace::get_thread_recorder()->activate(mBuffers.write()); + LLTrace::get_thread_recorder()->activate(mBuffers.write(), mInHandOff); + mInHandOff = false; } void Recording::handleStop() @@ -113,6 +117,7 @@ void Recording::handleStop() void Recording::handleSplitTo(Recording& other) { + other.mInHandOff = true; mBuffers.write()->handOffTo(*other.mBuffers.write()); } @@ -485,6 +490,8 @@ void PeriodicRecording::handleStop() void PeriodicRecording::handleReset() { + getCurRecording().stop(); + if (mAutoResize) { mRecordingPeriods.clear(); @@ -500,6 +507,7 @@ void PeriodicRecording::handleReset() } } mCurPeriod = 0; + mNumPeriods = 0; getCurRecording().setPlayState(getPlayState()); } @@ -719,7 +727,6 @@ void LLStopWatchControlsMixinCommon::start() handleStart(); break; case STARTED: - handleReset(); break; default: llassert(false); diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index 7b0970ffdf..31616a52cc 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -124,11 +124,32 @@ namespace LLTrace template class EventStatHandle; + template + struct RelatedTypes + { + typedef F64 fractional_t; + typedef T sum_t; + }; + + template + struct RelatedTypes > + { + typedef LLUnit::fractional_t, UNIT_T> fractional_t; + typedef LLUnit::sum_t, UNIT_T> sum_t; + }; + + template<> + struct RelatedTypes + { + typedef F64 fractional_t; + typedef U32 sum_t; + }; + class Recording : public LLStopWatchControlsMixin { public: - Recording(); + Recording(EPlayState state = LLStopWatchControlsMixinCommon::STOPPED); Recording(const Recording& other); ~Recording(); @@ -172,16 +193,16 @@ namespace LLTrace // CountStatHandle accessors F64 getSum(const TraceType& stat); template - T getSum(const CountStatHandle& stat) + typename RelatedTypes::sum_t getSum(const CountStatHandle& stat) { - return (T)getSum(static_cast&> (stat)); + return (typename RelatedTypes::sum_t)getSum(static_cast&> (stat)); } F64 getPerSec(const TraceType& stat); template - T getPerSec(const CountStatHandle& stat) + typename RelatedTypes::fractional_t getPerSec(const CountStatHandle& stat) { - return (T)getPerSec(static_cast&> (stat)); + return (typename RelatedTypes::fractional_t)getPerSec(static_cast&> (stat)); } U32 getSampleCount(const TraceType& stat); @@ -197,9 +218,9 @@ namespace LLTrace F64 getMean(const TraceType& stat); template - T getMean(SampleStatHandle& stat) + typename RelatedTypes::fractional_t getMean(SampleStatHandle& stat) { - return (T)getMean(static_cast&> (stat)); + return (typename RelatedTypes::fractional_t)getMean(static_cast&> (stat)); } F64 getMax(const TraceType& stat); @@ -211,9 +232,9 @@ namespace LLTrace F64 getStandardDeviation(const TraceType& stat); template - T getStandardDeviation(const SampleStatHandle& stat) + typename RelatedTypes::fractional_t getStandardDeviation(const SampleStatHandle& stat) { - return (T)getStandardDeviation(static_cast&> (stat)); + return (typename RelatedTypes::fractional_t)getStandardDeviation(static_cast&> (stat)); } F64 getLastValue(const TraceType& stat); @@ -228,9 +249,9 @@ namespace LLTrace // EventStatHandle accessors F64 getSum(const TraceType& stat); template - T getSum(const EventStatHandle& stat) + typename RelatedTypes::sum_t getSum(const EventStatHandle& stat) { - return (T)getSum(static_cast&> (stat)); + return (typename RelatedTypes::sum_t)getSum(static_cast&> (stat)); } F64 getMin(const TraceType& stat); @@ -249,16 +270,16 @@ namespace LLTrace F64 getMean(const TraceType& stat); template - T getMean(EventStatHandle& stat) + typename RelatedTypes::fractional_t getMean(EventStatHandle& stat) { - return (T)getMean(static_cast&> (stat)); + return (typename RelatedTypes::fractional_t)getMean(static_cast&> (stat)); } F64 getStandardDeviation(const TraceType& stat); template - T getStandardDeviation(const EventStatHandle& stat) + typename RelatedTypes::fractional_t getStandardDeviation(const EventStatHandle& stat) { - return (T)getStandardDeviation(static_cast&> (stat)); + return (typename RelatedTypes::fractional_t)getStandardDeviation(static_cast&> (stat)); } F64 getLastValue(const TraceType& stat); @@ -284,9 +305,11 @@ namespace LLTrace // returns data for current thread class ThreadRecorder* getThreadRecorder(); - LLTimer mSamplingTimer; - LLUnit mElapsedSeconds; + LLTimer mSamplingTimer; + LLUnit mElapsedSeconds; LLCopyOnWritePointer mBuffers; + bool mInHandOff; + }; class LL_COMMON_API PeriodicRecording @@ -310,11 +333,15 @@ namespace LLTrace const Recording& getPrevRecording(U32 offset) const; Recording snapshotCurRecording() const; + // + // PERIODIC MIN + // + // catch all for stats that have a defined sum template typename T::value_t getPeriodMin(const TraceType& stat, size_t num_periods = U32_MAX) { - size_t total_periods = mRecordingPeriods.size(); + size_t total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); typename T::value_t min_val = std::numeric_limits::max(); @@ -326,6 +353,12 @@ namespace LLTrace return min_val; } + template + T getPeriodMin(const CountStatHandle& stat, size_t num_periods = U32_MAX) + { + return T(getPeriodMin(static_cast&>(stat), num_periods)); + } + F64 getPeriodMin(const TraceType& stat, size_t num_periods = U32_MAX); template T getPeriodMin(const SampleStatHandle& stat, size_t num_periods = U32_MAX) @@ -341,9 +374,9 @@ namespace LLTrace } template - F64 getPeriodMinPerSec(const TraceType& stat, size_t num_periods = U32_MAX) + typename RelatedTypes::fractional_t getPeriodMinPerSec(const TraceType& stat, size_t num_periods = U32_MAX) { - size_t total_periods = mRecordingPeriods.size(); + size_t total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); F64 min_val = std::numeric_limits::max(); @@ -352,14 +385,24 @@ namespace LLTrace S32 index = (mCurPeriod + total_periods - i) % total_periods; min_val = llmin(min_val, mRecordingPeriods[index].getPerSec(stat)); } - return min_val; + return (typename RelatedTypes::fractional_t) min_val; + } + + template + typename RelatedTypes::fractional_t getPeriodMinPerSec(const CountStatHandle& stat, size_t num_periods = U32_MAX) + { + return typename RelatedTypes::fractional_t(getPeriodMinPerSec(static_cast&>(stat), num_periods)); } + // + // PERIODIC MAX + // + // catch all for stats that have a defined sum template typename T::value_t getPeriodMax(const TraceType& stat, size_t num_periods = U32_MAX) { - size_t total_periods = mRecordingPeriods.size(); + size_t total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); typename T::value_t max_val = std::numeric_limits::min(); @@ -371,6 +414,12 @@ namespace LLTrace return max_val; } + template + T getPeriodMax(const CountStatHandle& stat, size_t num_periods = U32_MAX) + { + return T(getPeriodMax(static_cast&>(stat), num_periods)); + } + F64 getPeriodMax(const TraceType& stat, size_t num_periods = U32_MAX); template T getPeriodMax(const SampleStatHandle& stat, size_t num_periods = U32_MAX) @@ -386,9 +435,9 @@ namespace LLTrace } template - F64 getPeriodMaxPerSec(const TraceType& stat, size_t num_periods = U32_MAX) + typename RelatedTypes::fractional_t getPeriodMaxPerSec(const TraceType& stat, size_t num_periods = U32_MAX) { - size_t total_periods = mRecordingPeriods.size(); + size_t total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); F64 max_val = std::numeric_limits::min(); @@ -397,14 +446,24 @@ namespace LLTrace S32 index = (mCurPeriod + total_periods - i) % total_periods; max_val = llmax(max_val, mRecordingPeriods[index].getPerSec(stat)); } - return max_val; + return (typename RelatedTypes::fractional_t)max_val; + } + + template + typename RelatedTypes::fractional_t getPeriodMaxPerSec(const CountStatHandle& stat, size_t num_periods = U32_MAX) + { + return typename RelatedTypes::fractional_t(getPeriodMaxPerSec(static_cast&>(stat), num_periods)); } + // + // PERIODIC MEAN + // + // catch all for stats that have a defined sum template typename T::mean_t getPeriodMean(const TraceType& stat, size_t num_periods = U32_MAX) { - size_t total_periods = mRecordingPeriods.size(); + size_t total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); typename T::mean_t mean = 0; @@ -422,24 +481,29 @@ namespace LLTrace return mean; } + template + typename RelatedTypes::fractional_t getPeriodMean(const CountStatHandle& stat, size_t num_periods = U32_MAX) + { + return typename RelatedTypes::fractional_t(getPeriodMean(static_cast&>(stat), num_periods)); + } F64 getPeriodMean(const TraceType& stat, size_t num_periods = U32_MAX); template - T getPeriodMean(const SampleStatHandle& stat, size_t num_periods = U32_MAX) + typename RelatedTypes::fractional_t getPeriodMean(const SampleStatHandle& stat, size_t num_periods = U32_MAX) { - return T(getPeriodMean(static_cast&>(stat), num_periods)); + return typename RelatedTypes::fractional_t(getPeriodMean(static_cast&>(stat), num_periods)); } F64 getPeriodMean(const TraceType& stat, size_t num_periods = U32_MAX); template - T getPeriodMean(const EventStatHandle& stat, size_t num_periods = U32_MAX) + typename RelatedTypes::fractional_t getPeriodMean(const EventStatHandle& stat, size_t num_periods = U32_MAX) { - return T(getPeriodMean(static_cast&>(stat), num_periods)); + return typename RelatedTypes::fractional_t(getPeriodMean(static_cast&>(stat), num_periods)); } template - typename T::mean_t getPeriodMeanPerSec(const TraceType& stat, size_t num_periods = U32_MAX) + typename RelatedTypes::fractional_t getPeriodMeanPerSec(const TraceType& stat, size_t num_periods = U32_MAX) { - size_t total_periods = mRecordingPeriods.size(); + size_t total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); typename T::mean_t mean = 0; @@ -454,7 +518,13 @@ namespace LLTrace } } mean = mean / num_periods; - return mean; + return (typename RelatedTypes::fractional_t)mean; + } + + template + typename RelatedTypes::fractional_t getPeriodMeanPerSec(const CountStatHandle& stat, size_t num_periods = U32_MAX) + { + return typename RelatedTypes::fractional_t(getPeriodMeanPerSec(static_cast&>(stat), num_periods)); } private: @@ -504,11 +574,10 @@ namespace LLTrace ExtendablePeriodicRecording(); void extend(); - PeriodicRecording& getAcceptedRecording() { return mAcceptedRecording; } - const PeriodicRecording& getAcceptedRecording() const {return mAcceptedRecording;} + PeriodicRecording& getResults() { return mAcceptedRecording; } + const PeriodicRecording& getResults() const {return mAcceptedRecording;} - PeriodicRecording& getPotentialRecording() { return mPotentialRecording; } - const PeriodicRecording& getPotentialRecording() const {return mPotentialRecording;} + void nextPeriod() { mPotentialRecording.nextPeriod(); } private: // implementation for LLStopWatchControlsMixin diff --git a/indra/llcommon/lltracethreadrecorder.cpp b/indra/llcommon/lltracethreadrecorder.cpp index 7ac0e75154..e20d8b63de 100644 --- a/indra/llcommon/lltracethreadrecorder.cpp +++ b/indra/llcommon/lltracethreadrecorder.cpp @@ -120,13 +120,17 @@ TimeBlockTreeNode* ThreadRecorder::getTimeBlockTreeNode( S32 index ) } -void ThreadRecorder::activate( AccumulatorBufferGroup* recording ) +void ThreadRecorder::activate( AccumulatorBufferGroup* recording, bool from_handoff ) { ActiveRecording* active_recording = new ActiveRecording(recording); if (!mActiveRecordings.empty()) { AccumulatorBufferGroup& prev_active_recording = mActiveRecordings.back()->mPartialRecording; prev_active_recording.sync(); + if (!from_handoff) + { + TimeBlock::updateTimes(); + } prev_active_recording.handOffTo(active_recording->mPartialRecording); } mActiveRecordings.push_back(active_recording); @@ -240,6 +244,7 @@ void ThreadRecorder::pushToParent() { LLMutexLock lock(&mSharedRecordingMutex); LLTrace::get_thread_recorder()->bringUpToDate(&mThreadRecordingBuffers); mSharedRecordingBuffers.append(mThreadRecordingBuffers); + mThreadRecordingBuffers.reset(); } } diff --git a/indra/llcommon/lltracethreadrecorder.h b/indra/llcommon/lltracethreadrecorder.h index 535f855200..c40228785e 100644 --- a/indra/llcommon/lltracethreadrecorder.h +++ b/indra/llcommon/lltracethreadrecorder.h @@ -47,7 +47,7 @@ namespace LLTrace ~ThreadRecorder(); - void activate(AccumulatorBufferGroup* recording); + void activate(AccumulatorBufferGroup* recording, bool from_handoff = false); void deactivate(AccumulatorBufferGroup* recording); active_recording_list_t::reverse_iterator bringUpToDate(AccumulatorBufferGroup* recording); -- cgit v1.2.3