diff options
| author | Richard Linden <none@none> | 2012-12-21 00:13:21 -0800 |
|---|---|---|
| committer | Richard Linden <none@none> | 2012-12-21 00:13:21 -0800 |
| commit | 013f04cabec8e110ee659d9b3f75a4d25f114b7b (patch) | |
| tree | 2ce361819f7e5031a9b079c8d13c8d6895e50a3d /indra/llcommon/lltracerecording.cpp | |
| parent | c219282f5de753a044cecb53bd806145f68add9a (diff) | |
SH-3468 WIP add memory tracking base class
improvements on lifetime of lltrace core data structures
tweaks to thread local pointer handling so that static constructors/destructors
can safely call functions that use lltrace
Diffstat (limited to 'indra/llcommon/lltracerecording.cpp')
| -rw-r--r-- | indra/llcommon/lltracerecording.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 40079f40f1..9dbafc4e82 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -122,6 +122,18 @@ void Recording::makePrimary() mMeasurements.write()->makePrimary(); mStackTimers.write()->makePrimary(); mMemStats.write()->makePrimary(); + + ThreadRecorder* thread_recorder = get_thread_recorder().get(); + AccumulatorBuffer<TimeBlockAccumulator>& timer_accumulator_buffer = *mStackTimers.write(); + // update stacktimer parent pointers + for (S32 i = 0, end_i = mStackTimers->size(); i < end_i; i++) + { + TimeBlockTreeNode* tree_node = thread_recorder->getTimeBlockTreeNode(i); + if (tree_node) + { + timer_accumulator_buffer[i].mParent = tree_node->mParent; + } + } } bool Recording::isPrimary() const @@ -145,11 +157,21 @@ void Recording::appendRecording( const Recording& other ) mMeasurementsFloat.write()->addSamples(*other.mMeasurementsFloat); mCounts.write()->addSamples(*other.mCounts); mMeasurements.write()->addSamples(*other.mMeasurements); - mStackTimers.write()->addSamples(*other.mStackTimers); mMemStats.write()->addSamples(*other.mMemStats); + + mStackTimers.write()->addSamples(*other.mStackTimers); mElapsedSeconds += other.mElapsedSeconds; } +void Recording::mergeRecording( const Recording& other) +{ + mCountsFloat.write()->addSamples(*other.mCountsFloat); + mMeasurementsFloat.write()->addSamples(*other.mMeasurementsFloat); + mCounts.write()->addSamples(*other.mCounts); + mMeasurements.write()->addSamples(*other.mMeasurements); + mMemStats.write()->addSamples(*other.mMemStats); +} + LLUnit<LLUnits::Seconds, F64> Recording::getSum(const TraceType<TimeBlockAccumulator>& stat) const { return (F64)(*mStackTimers)[stat.getIndex()].mTotalTimeCounter / (F64)LLTrace::TimeBlock::countsPerSecond(); |
