summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltracethreadrecorder.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/lltracethreadrecorder.h')
-rw-r--r--indra/llcommon/lltracethreadrecorder.h45
1 files changed, 21 insertions, 24 deletions
diff --git a/indra/llcommon/lltracethreadrecorder.h b/indra/llcommon/lltracethreadrecorder.h
index bf3701304f..0680c2c590 100644
--- a/indra/llcommon/lltracethreadrecorder.h
+++ b/indra/llcommon/lltracethreadrecorder.h
@@ -31,7 +31,8 @@
#include "llpreprocessor.h"
#include "llmutex.h"
-#include "lltracerecording.h"
+#include "lltraceaccumulators.h"
+#include "llthreadlocalstorage.h"
namespace LLTrace
{
@@ -45,9 +46,9 @@ namespace LLTrace
virtual ~ThreadRecorder();
- void activate(Recording* recording);
- void deactivate(Recording* recording);
- active_recording_list_t::reverse_iterator bringUpToDate(Recording* recording);
+ void activate(AccumulatorBufferGroup* recording);
+ void deactivate(AccumulatorBufferGroup* recording);
+ active_recording_list_t::reverse_iterator bringUpToDate(AccumulatorBufferGroup* recording);
virtual void pushToMaster() = 0;
@@ -56,14 +57,14 @@ namespace LLTrace
protected:
struct ActiveRecording
{
- ActiveRecording(Recording* target);
+ ActiveRecording(AccumulatorBufferGroup* target);
- Recording* mTargetRecording;
- RecordingBuffers mPartialRecording;
+ AccumulatorBufferGroup* mTargetRecording;
+ AccumulatorBufferGroup mPartialRecording;
void movePartialToTarget();
};
- Recording mThreadRecording;
+ AccumulatorBufferGroup mThreadRecordingBuffers;
active_recording_list_t mActiveRecordings;
@@ -85,9 +86,6 @@ namespace LLTrace
// call this periodically to gather stats data from slave threads
void pullFromSlaveThreads();
- LLMutex* getSlaveListMutex() { return &mSlaveListMutex; }
-
-
private:
typedef std::list<class SlaveThreadRecorder*> slave_thread_recorder_list_t;
@@ -105,22 +103,21 @@ namespace LLTrace
// call this periodically to gather stats data for master thread to consume
/*virtual*/ void pushToMaster();
+ private:
+ friend class MasterThreadRecorder;
MasterThreadRecorder* mMaster;
-
- class SharedData : public Recording
- {
- public:
- void appendFrom(const Recording& source);
- void appendTo(Recording& sink);
- void mergeFrom(const RecordingBuffers& source);
- void mergeTo(RecordingBuffers& sink);
- void reset();
- private:
- LLMutex mRecordingMutex;
- };
- SharedData mSharedData;
+ LLMutex mSharedRecordingMutex;
+ AccumulatorBufferGroup mSharedRecordingBuffers;
MasterThreadRecorder& mMasterRecorder;
};
+
+ //FIXME: let user code set up thread recorder topology
+ extern MasterThreadRecorder* gUIThreadRecorder ;
+
+ const LLThreadLocalPointer<class ThreadRecorder>& get_thread_recorder();
+ void set_thread_recorder(class ThreadRecorder*);
+ class MasterThreadRecorder& getUIThreadRecorder();
+
}
#endif // LL_LLTRACETHREADRECORDER_H