diff options
| author | Richard Linden <none@none> | 2013-10-03 19:05:52 -0700 |
|---|---|---|
| committer | Richard Linden <none@none> | 2013-10-03 19:05:52 -0700 |
| commit | bee38adb347213bc1824dad8a762dc399c3065ec (patch) | |
| tree | b1db05808d35d0dcc168a799f8a2a47b6d1160e0 /indra/llcommon/lltracerecording.cpp | |
| parent | 9ae025f8ee8688b25678a243ba19f1398de08060 (diff) | |
| parent | f8a85003ddd4bee1ae00fc329c1c1d66d6100cbd (diff) | |
Automated merge with http://bitbucket.org/lindenlab/viewer-interesting
Diffstat (limited to 'indra/llcommon/lltracerecording.cpp')
| -rw-r--r-- | indra/llcommon/lltracerecording.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index ce4a433cca..06b4351339 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -25,15 +25,18 @@ #include "linden_common.h" +#include "lltracerecording.h" + #include "lltrace.h" #include "llfasttimer.h" -#include "lltracerecording.h" #include "lltracethreadrecorder.h" #include "llthread.h" namespace LLTrace { - + +extern MemStatHandle gTraceMemStat; + /////////////////////////////////////////////////////////////////////// // Recording /////////////////////////////////////////////////////////////////////// @@ -42,12 +45,15 @@ Recording::Recording(EPlayState state) : mElapsedSeconds(0), mInHandOff(false) { + claim_alloc(gTraceMemStat, this); mBuffers = new AccumulatorBufferGroup(); + claim_alloc(gTraceMemStat, mBuffers); setPlayState(state); } Recording::Recording( const Recording& other ) { + claim_alloc(gTraceMemStat, this); *this = other; } @@ -73,6 +79,9 @@ Recording& Recording::operator = (const Recording& other) Recording::~Recording() { + disclaim_alloc(gTraceMemStat, this); + disclaim_alloc(gTraceMemStat, mBuffers); + if (isStarted() && LLTrace::get_thread_recorder().notNull()) { LLTrace::get_thread_recorder()->deactivate(mBuffers.write()); @@ -200,32 +209,32 @@ F64Kilobytes Recording::getLastValue(const TraceType<MemStatAccumulator>& stat) F64Kilobytes Recording::getSum(const TraceType<MemStatAccumulator::AllocationFacet>& stat) { - return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mFootprintAllocations.getSum()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mAllocations.getSum()); } F64Kilobytes Recording::getPerSec(const TraceType<MemStatAccumulator::AllocationFacet>& stat) { - return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mFootprintAllocations.getSum() / mElapsedSeconds.value()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mAllocations.getSum() / mElapsedSeconds.value()); } S32 Recording::getSampleCount(const TraceType<MemStatAccumulator::AllocationFacet>& stat) { - return mBuffers->mMemStats[stat.getIndex()].mFootprintAllocations.getSampleCount(); + return mBuffers->mMemStats[stat.getIndex()].mAllocations.getSampleCount(); } F64Kilobytes Recording::getSum(const TraceType<MemStatAccumulator::DeallocationFacet>& stat) { - return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mFootprintDeallocations.getSum()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mDeallocations.getSum()); } F64Kilobytes Recording::getPerSec(const TraceType<MemStatAccumulator::DeallocationFacet>& stat) { - return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mFootprintDeallocations.getSum() / mElapsedSeconds.value()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mDeallocations.getSum() / mElapsedSeconds.value()); } S32 Recording::getSampleCount(const TraceType<MemStatAccumulator::DeallocationFacet>& stat) { - return mBuffers->mMemStats[stat.getIndex()].mFootprintDeallocations.getSampleCount(); + return mBuffers->mMemStats[stat.getIndex()].mDeallocations.getSampleCount(); } F64 Recording::getSum( const TraceType<CountAccumulator>& stat ) @@ -330,6 +339,12 @@ PeriodicRecording::PeriodicRecording( S32 num_periods, EPlayState state) mRecordingPeriods(num_periods ? num_periods : 1) { setPlayState(state); + claim_alloc(gTraceMemStat, this); +} + +PeriodicRecording::~PeriodicRecording() +{ + disclaim_alloc(gTraceMemStat, this); } void PeriodicRecording::nextPeriod() |
