summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-10-18 17:32:44 -0700
committerRichard Linden <none@none>2012-10-18 17:32:44 -0700
commit1fadd6138eebf980776f80b9642f4c19279fcadd (patch)
treeae5ae3e2916f918e23c259406082d8596f89a2aa /indra
parenta52d203a4f1d2988e8ffba16258f3f132f22f56d (diff)
SH-3405 WIP convert existing stats to lltrace system
fixed trace recording on background threads hitting null pointer
Diffstat (limited to 'indra')
-rw-r--r--indra/llcommon/lltrace.h19
-rw-r--r--indra/llcommon/lltracethreadrecorder.cpp9
-rw-r--r--indra/llcommon/lltracethreadrecorder.h4
-rwxr-xr-xindra/newview/llviewerstats.cpp8
-rwxr-xr-xindra/newview/llviewerstats.h7
5 files changed, 29 insertions, 18 deletions
diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h
index 2a479b31d7..2cdae4b0d2 100644
--- a/indra/llcommon/lltrace.h
+++ b/indra/llcommon/lltrace.h
@@ -167,15 +167,24 @@ namespace LLTrace
size_t next_slot = mNextStorageSlot++;
if (next_slot >= mStorageSize)
{
- size_t new_size = mStorageSize + (mStorageSize >> 2);
- delete [] mStorage;
- mStorage = new ACCUMULATOR[new_size];
- mStorageSize = new_size;
+ resize(mStorageSize + (mStorageSize >> 2));
}
- llassert(next_slot < mStorageSize);
+ llassert(mStorage && next_slot < mStorageSize);
return next_slot;
}
+ void resize(size_t new_size)
+ {
+ ACCUMULATOR* old_storage = mStorage;
+ mStorage = new ACCUMULATOR[new_size];
+ for (S32 i = 0; i < mStorageSize; i++)
+ {
+ mStorage[i] = old_storage[i];
+ }
+ mStorageSize = new_size;
+ delete[] old_storage;
+ }
+
static AccumulatorBuffer<ACCUMULATOR>& getDefaultBuffer()
{
static AccumulatorBuffer sBuffer(STATIC_ALLOC);
diff --git a/indra/llcommon/lltracethreadrecorder.cpp b/indra/llcommon/lltracethreadrecorder.cpp
index 02dc55771b..e81333f7f2 100644
--- a/indra/llcommon/lltracethreadrecorder.cpp
+++ b/indra/llcommon/lltracethreadrecorder.cpp
@@ -127,7 +127,6 @@ void ThreadRecorder::ActiveRecording::moveBaselineToTarget()
///////////////////////////////////////////////////////////////////////
SlaveThreadRecorder::SlaveThreadRecorder()
-: ThreadRecorder(getMasterThreadRecorder())
{
getMasterThreadRecorder().addSlaveThread(this);
}
@@ -149,14 +148,14 @@ void SlaveThreadRecorder::pushToMaster()
void SlaveThreadRecorder::SharedData::copyFrom( const Recording& source )
{
- LLMutexLock lock(&mRecorderMutex);
- mRecorder.mergeRecording(source);
+ LLMutexLock lock(&mRecordingMutex);
+ mRecording.mergeRecording(source);
}
void SlaveThreadRecorder::SharedData::copyTo( Recording& sink )
{
- LLMutexLock lock(&mRecorderMutex);
- sink.mergeRecording(mRecorder);
+ LLMutexLock lock(&mRecordingMutex);
+ sink.mergeRecording(mRecording);
}
///////////////////////////////////////////////////////////////////////
diff --git a/indra/llcommon/lltracethreadrecorder.h b/indra/llcommon/lltracethreadrecorder.h
index 678b1a89f0..c9231265af 100644
--- a/indra/llcommon/lltracethreadrecorder.h
+++ b/indra/llcommon/lltracethreadrecorder.h
@@ -114,8 +114,8 @@ namespace LLTrace
void copyFrom(const Recording& source);
void copyTo(Recording& sink);
private:
- LLMutex mRecorderMutex;
- Recording mRecorder;
+ LLMutex mRecordingMutex;
+ Recording mRecording;
};
SharedData mSharedData;
};
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 963d2ebb81..03cc9b12e3 100755
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -149,9 +149,7 @@ LLTrace::Measurement<> NUM_IMAGES("numimagesstat"),
LLTrace::Measurement<LLTrace::Meters> AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections");
-LLTrace::Measurement<LLTrace::Bytes> SIM_UNACKED_BYTES("simtotalunackedbytes"),
- SIM_PHYSICS_MEM("physicsmemoryallocated"),
- GL_TEX_MEM("gltexmemstat"),
+LLTrace::Measurement<LLTrace::Bytes> GL_TEX_MEM("gltexmemstat"),
GL_BOUND_MEM("glboundmemstat"),
RAW_MEM("rawmemstat"),
FORMATTED_MEM("formattedmemstat"),
@@ -174,6 +172,10 @@ SimMeasurement<LLTrace::Milliseconds> SIM_FRAME_TIME("simframemsec", "", LL_SIM_
SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME),
SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME);
+SimMeasurement<LLTrace::Bytes> SIM_UNACKED_BYTES("simtotalunackedbytes", "", LL_SIM_STAT_TOTAL_UNACKED_BYTES),
+ SIM_PHYSICS_MEM("physicsmemoryallocated", "", LL_SIM_STAT_SIMPHYSICSMEMORY);
+
+
LLTrace::Measurement<LLTrace::Milliseconds> FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"),
FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"),
LOGIN_SECONDS("loginseconds", "Time between LoginRequest and LoginReply"),
diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h
index 06f65b2cdd..78c4b89f71 100755
--- a/indra/newview/llviewerstats.h
+++ b/indra/newview/llviewerstats.h
@@ -147,10 +147,8 @@ extern LLTrace::Measurement<> NUM_IMAGES,
extern LLTrace::Measurement<LLTrace::Meters> AGENT_POSITION_SNAP;
-extern LLTrace::Measurement<LLTrace::Bytes> SIM_UNACKED_BYTES,
- DELTA_BANDWIDTH,
+extern LLTrace::Measurement<LLTrace::Bytes> DELTA_BANDWIDTH,
MAX_BANDWIDTH,
- SIM_PHYSICS_MEM,
GL_TEX_MEM,
GL_BOUND_MEM,
RAW_MEM,
@@ -171,6 +169,9 @@ extern SimMeasurement<LLTrace::Milliseconds> SIM_FRAME_TIME,
SIM_SLEEP_TIME,
SIM_PUMP_IO_TIME;
+extern SimMeasurement<LLTrace::Bytes> SIM_UNACKED_BYTES,
+ SIM_PHYSICS_MEM;
+
extern LLTrace::Measurement<LLTrace::Milliseconds> FRAMETIME_JITTER,
FRAMETIME_SLEW,