diff options
Diffstat (limited to 'indra/llcommon/lltracerecording.cpp')
-rw-r--r-- | indra/llcommon/lltracerecording.cpp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 913c4cbdad..2af9041863 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -109,9 +109,17 @@ void Recording::handleSplitTo(Recording& other) { stop(); other.restart(); + syncTo(other); +} + +void Recording::syncTo(Recording& other) +{ + other.mCountsFloat.write()->reset(mCountsFloat); other.mMeasurementsFloat.write()->reset(mMeasurementsFloat); + other.mCounts.write()->reset(mCounts); other.mMeasurements.write()->reset(mMeasurements); - //TODO: figure out how to get seamless handoff of timing stats + other.mStackTimers.write()->reset(mStackTimers); + other.mMemStats.write()->reset(mMemStats); } void Recording::makePrimary() @@ -174,12 +182,15 @@ void Recording::mergeRecording( const Recording& other) LLUnit<LLUnits::Seconds, F64> Recording::getSum(const TraceType<TimeBlockAccumulator>& stat) const { - return (F64)(*mStackTimers)[stat.getIndex()].mTotalTimeCounter / (F64)LLTrace::TimeBlock::countsPerSecond(); + const TimeBlockAccumulator& accumulator = (*mStackTimers)[stat.getIndex()]; + return (F64)(accumulator.mSelfTimeCounter - accumulator.mStartSelfTimeCounter + accumulator.mChildTimeCounter - accumulator.mStartChildTimeCounter) + / (F64)LLTrace::TimeBlock::countsPerSecond(); } LLUnit<LLUnits::Seconds, F64> Recording::getSum(const TraceType<TimeBlockAccumulator::SelfTimeAspect>& stat) const { - return ((F64)(*mStackTimers)[stat.getIndex()].mTotalTimeCounter - (F64)(*mStackTimers)[stat.getIndex()].mChildTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond(); + const TimeBlockAccumulator& accumulator = (*mStackTimers)[stat.getIndex()]; + return (F64)(accumulator.mSelfTimeCounter - accumulator.mStartSelfTimeCounter) / (F64)LLTrace::TimeBlock::countsPerSecond(); } @@ -190,12 +201,18 @@ U32 Recording::getSum(const TraceType<TimeBlockAccumulator::CallCountAspect>& st LLUnit<LLUnits::Seconds, F64> Recording::getPerSec(const TraceType<TimeBlockAccumulator>& stat) const { - return (F64)(*mStackTimers)[stat.getIndex()].mTotalTimeCounter / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds); + const TimeBlockAccumulator& accumulator = (*mStackTimers)[stat.getIndex()]; + + return (F64)(accumulator.mSelfTimeCounter - accumulator.mStartSelfTimeCounter + accumulator.mChildTimeCounter - accumulator.mStartChildTimeCounter) + / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds); } LLUnit<LLUnits::Seconds, F64> Recording::getPerSec(const TraceType<TimeBlockAccumulator::SelfTimeAspect>& stat) const { - return ((F64)(*mStackTimers)[stat.getIndex()].mTotalTimeCounter - (F64)(*mStackTimers)[stat.getIndex()].mChildTimeCounter) / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds); + const TimeBlockAccumulator& accumulator = (*mStackTimers)[stat.getIndex()]; + + return (F64)(accumulator.mSelfTimeCounter - accumulator.mStartSelfTimeCounter) + / ((F64)LLTrace::TimeBlock::countsPerSecond() * mElapsedSeconds); } F32 Recording::getPerSec(const TraceType<TimeBlockAccumulator::CallCountAspect>& stat) const @@ -520,7 +537,7 @@ void ExtendableRecording::splitFrom(ExtendableRecording& other) PeriodicRecording& get_frame_recording() { - static LLThreadLocalPointer<PeriodicRecording> sRecording(new PeriodicRecording(64, PeriodicRecording::STARTED)); + static LLThreadLocalPointer<PeriodicRecording> sRecording(new PeriodicRecording(200, PeriodicRecording::STARTED)); return *sRecording; } |