SH-3405 WIP convert existing stats to lltrace system
fixed trace recording on background threads hitting null pointermaster
parent
a52d203a4f
commit
1fadd6138e
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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"),
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue