summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltracerecording.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-09-23 16:07:32 -0700
committerRichard Linden <none@none>2013-09-23 16:07:32 -0700
commite25b5a359faaf4bb51186235567fcb1fea15e440 (patch)
tree8af498e5753aa49a56fe6b88224f89cda89d19ad /indra/llcommon/lltracerecording.cpp
parentb16fb80906b4098b68d8f555998f42a3017ee095 (diff)
refactored lltrace mem tracking to store allocation and deallocation sizes
at the same time and work better with threads
Diffstat (limited to 'indra/llcommon/lltracerecording.cpp')
-rw-r--r--indra/llcommon/lltracerecording.cpp57
1 files changed, 53 insertions, 4 deletions
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp
index 7155cfa40a..5728997676 100644
--- a/indra/llcommon/lltracerecording.cpp
+++ b/indra/llcommon/lltracerecording.cpp
@@ -228,16 +228,65 @@ F64Bytes Recording::getLastValue(const TraceType<MemStatAccumulator::ShadowMemFa
return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mShadowSize.getLastValue());
}
-U32 Recording::getSum(const TraceType<MemStatAccumulator::AllocationCountFacet>& stat)
+F64Bytes Recording::getSum(const TraceType<MemStatAccumulator::AllocationFacet>& stat)
{
- return mBuffers->mMemStats[stat.getIndex()].mAllocatedCount;
+ return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mAllocated.getSum());
}
-U32 Recording::getSum(const TraceType<MemStatAccumulator::DeallocationCountFacet>& stat)
+F64Bytes Recording::getPerSec(const TraceType<MemStatAccumulator::AllocationFacet>& stat)
{
- return mBuffers->mMemStats[stat.getIndex()].mAllocatedCount;
+ return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mAllocated.getSum() / mElapsedSeconds.value());
}
+U32 Recording::getSampleCount(const TraceType<MemStatAccumulator::AllocationFacet>& stat)
+{
+ return mBuffers->mMemStats[stat.getIndex()].mAllocated.getSampleCount();
+}
+
+F64Bytes Recording::getSum(const TraceType<MemStatAccumulator::DeallocationFacet>& stat)
+{
+ return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mDeallocated.getSum());
+}
+
+F64Bytes Recording::getPerSec(const TraceType<MemStatAccumulator::DeallocationFacet>& stat)
+{
+ return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mDeallocated.getSum() / mElapsedSeconds.value());
+}
+
+U32 Recording::getSampleCount(const TraceType<MemStatAccumulator::DeallocationFacet>& stat)
+{
+ return mBuffers->mMemStats[stat.getIndex()].mDeallocated.getSampleCount();
+}
+
+F64Bytes Recording::getSum(const TraceType<MemStatAccumulator::ShadowAllocationFacet>& stat)
+{
+ return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mShadowAllocated.getSum());
+}
+
+F64Bytes Recording::getPerSec(const TraceType<MemStatAccumulator::ShadowAllocationFacet>& stat)
+{
+ return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mShadowAllocated.getSum() / mElapsedSeconds.value());
+}
+
+U32 Recording::getSampleCount(const TraceType<MemStatAccumulator::ShadowAllocationFacet>& stat)
+{
+ return mBuffers->mMemStats[stat.getIndex()].mShadowAllocated.getSampleCount();
+}
+
+F64Bytes Recording::getSum(const TraceType<MemStatAccumulator::ShadowDeallocationFacet>& stat)
+{
+ return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mShadowDeallocated.getSum());
+}
+
+F64Bytes Recording::getPerSec(const TraceType<MemStatAccumulator::ShadowDeallocationFacet>& stat)
+{
+ return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mShadowDeallocated.getSum() / mElapsedSeconds.value());
+}
+
+U32 Recording::getSampleCount(const TraceType<MemStatAccumulator::ShadowDeallocationFacet>& stat)
+{
+ return mBuffers->mMemStats[stat.getIndex()].mShadowDeallocated.getSampleCount();
+}
F64 Recording::getSum( const TraceType<CountAccumulator>& stat )
{