summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/lltrace.h4
-rw-r--r--indra/llcommon/lltracerecording.cpp14
-rw-r--r--indra/llcommon/lltracerecording.h3
3 files changed, 19 insertions, 2 deletions
diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h
index 9e275da647..a6b1b227c9 100644
--- a/indra/llcommon/lltrace.h
+++ b/indra/llcommon/lltrace.h
@@ -213,10 +213,10 @@ namespace LLTrace
: public LLInstanceTracker<TraceType<ACCUMULATOR>, std::string>
{
public:
- TraceType(const char* name, const char* description = "")
+ TraceType(const char* name, const char* description = NULL)
: LLInstanceTracker(name),
mName(name),
- mDescription(description)
+ mDescription(description ? description : "")
{
mAccumulatorIndex = AccumulatorBuffer<ACCUMULATOR>::getDefaultBuffer().reserveSlot();
}
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp
index 0d4d07faf6..7ed7e57570 100644
--- a/indra/llcommon/lltracerecording.cpp
+++ b/indra/llcommon/lltracerecording.cpp
@@ -305,6 +305,20 @@ PeriodicRecording::PeriodicRecording( S32 num_periods, EStopWatchState state)
initTo(state);
}
+PeriodicRecording::PeriodicRecording(PeriodicRecording& other)
+: mNumPeriods(other.mNumPeriods),
+ mCurPeriod(other.mCurPeriod),
+ mTotalValid(other.mTotalValid),
+ mTotalRecording(other.mTotalRecording)
+{
+ mRecordingPeriods = new Recording[mNumPeriods];
+ for (S32 i = 0; i < mNumPeriods; i++)
+ {
+ mRecordingPeriods[i] = other.mRecordingPeriods[i];
+ }
+}
+
+
PeriodicRecording::~PeriodicRecording()
{
delete[] mRecordingPeriods;
diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h
index efed3f662e..a3af215dd3 100644
--- a/indra/llcommon/lltracerecording.h
+++ b/indra/llcommon/lltracerecording.h
@@ -234,6 +234,7 @@ namespace LLTrace
{
public:
PeriodicRecording(S32 num_periods, EStopWatchState state = STOPPED);
+ PeriodicRecording(PeriodicRecording& recording);
~PeriodicRecording();
void nextPeriod();
@@ -261,11 +262,13 @@ namespace LLTrace
Recording& getPrevRecordingPeriod(S32 offset)
{
+ offset = llclamp(offset, 0, mNumPeriods - 1);
return mRecordingPeriods[(mCurPeriod + mNumPeriods - offset) % mNumPeriods];
}
const Recording& getPrevRecordingPeriod(S32 offset) const
{
+ offset = llclamp(offset, 0, mNumPeriods - 1);
return mRecordingPeriods[(mCurPeriod + mNumPeriods - offset) % mNumPeriods];
}