summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltracethreadrecorder.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-11-07 00:38:21 -0800
committerRichard Linden <none@none>2012-11-07 00:38:21 -0800
commit860ff2f7e2a7fe932dfb7c148f0dbc0067018038 (patch)
treef6356524dd5d2cecccae3934771a3f81ba31c90a /indra/llcommon/lltracethreadrecorder.cpp
parent0007114cf5a60779319ab8cbd0a23a0d462b8010 (diff)
SH-3499 WIP Ensure asset stats output is correct
fixed trace data gathering and routing from background thread simplified slave->master thread communication (eliminated redundant recording and proxy object) improved performance of fast timer data gathering (slow iterators)
Diffstat (limited to 'indra/llcommon/lltracethreadrecorder.cpp')
-rw-r--r--indra/llcommon/lltracethreadrecorder.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/indra/llcommon/lltracethreadrecorder.cpp b/indra/llcommon/lltracethreadrecorder.cpp
index af66a69492..5a6ff14f97 100644
--- a/indra/llcommon/lltracethreadrecorder.cpp
+++ b/indra/llcommon/lltracethreadrecorder.cpp
@@ -171,15 +171,20 @@ void SlaveThreadRecorder::SharedData::copyTo( Recording& sink )
// MasterThreadRecorder
///////////////////////////////////////////////////////////////////////
+LLFastTimer::DeclareTimer FTM_PULL_TRACE_DATA_FROM_SLAVES("Pull slave trace data");
void MasterThreadRecorder::pullFromSlaveThreads()
{
+ LLFastTimer _(FTM_PULL_TRACE_DATA_FROM_SLAVES);
+ if (mActiveRecordings.empty()) return;
+
LLMutexLock lock(&mSlaveListMutex);
+ Recording& target_recording = mActiveRecordings.front().mBaseline;
for (slave_thread_recorder_list_t::iterator it = mSlaveThreadRecorders.begin(), end_it = mSlaveThreadRecorders.end();
it != end_it;
++it)
{
- (*it)->mRecorder->mSharedData.copyTo((*it)->mSlaveRecording);
+ (*it)->mSharedData.copyTo(target_recording);
}
}
@@ -187,7 +192,7 @@ void MasterThreadRecorder::addSlaveThread( class SlaveThreadRecorder* child )
{
LLMutexLock lock(&mSlaveListMutex);
- mSlaveThreadRecorders.push_back(new SlaveThreadRecorderProxy(child));
+ mSlaveThreadRecorders.push_back(child);
}
void MasterThreadRecorder::removeSlaveThread( class SlaveThreadRecorder* child )
@@ -198,7 +203,7 @@ void MasterThreadRecorder::removeSlaveThread( class SlaveThreadRecorder* child )
it != end_it;
++it)
{
- if ((*it)->mRecorder == child)
+ if ((*it) == child)
{
mSlaveThreadRecorders.erase(it);
break;
@@ -212,12 +217,4 @@ void MasterThreadRecorder::pushToMaster()
MasterThreadRecorder::MasterThreadRecorder()
{}
-///////////////////////////////////////////////////////////////////////
-// MasterThreadRecorder::SlaveThreadTraceProxy
-///////////////////////////////////////////////////////////////////////
-
-MasterThreadRecorder::SlaveThreadRecorderProxy::SlaveThreadRecorderProxy( class SlaveThreadRecorder* recorder)
-: mRecorder(recorder)
-{}
-
}