diff options
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/lltracerecording.cpp | 6 | ||||
-rw-r--r-- | indra/llcommon/lltracerecording.h | 1 | ||||
-rw-r--r-- | indra/llcommon/lltracethreadrecorder.cpp | 19 | ||||
-rw-r--r-- | indra/llcommon/lltracethreadrecorder.h | 3 |
4 files changed, 23 insertions, 6 deletions
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index e4cff551f9..c44cc8a8a7 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -63,6 +63,12 @@ void Recording::reset() mSamplingTimer.reset(); } +void Recording::update() +{ + mElapsedSeconds = 0.0; + mSamplingTimer.reset(); +} + void Recording::resume() { if (!mIsStarted) diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index f9bc6b61b2..4d53cd9600 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -61,6 +61,7 @@ namespace LLTrace void mergeDeltas(const Recording& baseline, const Recording& target); void reset(); + void update(); bool isStarted() { return mIsStarted; } diff --git a/indra/llcommon/lltracethreadrecorder.cpp b/indra/llcommon/lltracethreadrecorder.cpp index 9115a52fd1..b2c6fe3b80 100644 --- a/indra/llcommon/lltracethreadrecorder.cpp +++ b/indra/llcommon/lltracethreadrecorder.cpp @@ -68,10 +68,7 @@ void ThreadRecorder::activate( Recording* recording ) mPrimaryRecording = &mActiveRecordings.front().mBaseline; } -//TODO: consider merging results down the list to one past the buffered item. -// this would require 2 buffers per sampler, to separate current total from running total - -void ThreadRecorder::deactivate( Recording* recording ) +std::list<ThreadRecorder::ActiveRecording>::iterator ThreadRecorder::update( Recording* recording ) { for (std::list<ActiveRecording>::iterator it = mActiveRecordings.begin(), end_it = mActiveRecordings.end(); it != end_it; @@ -92,10 +89,20 @@ void ThreadRecorder::deactivate( Recording* recording ) next_it->mBaseline.makePrimary(); mPrimaryRecording = &next_it->mBaseline; } - mActiveRecordings.erase(it); - break; + return it; } } + + return mActiveRecordings.end(); +} + +void ThreadRecorder::deactivate( Recording* recording ) +{ + std::list<ActiveRecording>::iterator it = update(recording); + if (it != mActiveRecordings.end()) + { + mActiveRecordings.erase(it); + } } ThreadRecorder::ActiveRecording::ActiveRecording( Recording* source, Recording* target ) diff --git a/indra/llcommon/lltracethreadrecorder.h b/indra/llcommon/lltracethreadrecorder.h index 40441d0447..42230087c0 100644 --- a/indra/llcommon/lltracethreadrecorder.h +++ b/indra/llcommon/lltracethreadrecorder.h @@ -37,6 +37,8 @@ namespace LLTrace { class LL_COMMON_API ThreadRecorder { + protected: + struct ActiveRecording; public: ThreadRecorder(); ThreadRecorder(const ThreadRecorder& other); @@ -44,6 +46,7 @@ namespace LLTrace virtual ~ThreadRecorder(); void activate(Recording* recording); + std::list<struct ActiveRecording>::iterator update(Recording* recording); void deactivate(Recording* recording); virtual void pushToMaster() = 0; |