summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/lltrace.h8
-rw-r--r--indra/llcommon/lltracerecording.cpp2
-rw-r--r--indra/llcommon/lltracerecording.h9
-rw-r--r--indra/llcommon/lltracethreadrecorder.cpp2
-rw-r--r--indra/llcommon/llunit.h3
5 files changed, 14 insertions, 10 deletions
diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h
index 6dfe9e4b4e..0daac95ea4 100644
--- a/indra/llcommon/lltrace.h
+++ b/indra/llcommon/lltrace.h
@@ -504,9 +504,11 @@ public:
LLUnitImplicit<LLUnits::Seconds, F64> time_stamp = LLTimer::getTotalSeconds();
LLUnitImplicit<LLUnits::Seconds, F64> delta_time = time_stamp - mLastSampleTimeStamp;
- mSum += (F64)mLastValue * delta_time;
-
- mTotalSamplingTime += delta_time;
+ if (mHasValue)
+ {
+ mSum += (F64)mLastValue * delta_time;
+ mTotalSamplingTime += delta_time;
+ }
mLastSampleTimeStamp = time_stamp;
}
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp
index 3994e4f521..e45639a034 100644
--- a/indra/llcommon/lltracerecording.cpp
+++ b/indra/llcommon/lltracerecording.cpp
@@ -538,7 +538,7 @@ void PeriodicRecording::appendPeriodicRecording( PeriodicRecording& other )
other.setPlayState(other_play_state);
}
-LLUnit<LLUnits::Seconds, F64> PeriodicRecording::getDuration()
+LLUnit<LLUnits::Seconds, F64> PeriodicRecording::getDuration() const
{
LLUnit<LLUnits::Seconds, F64> duration;
size_t num_periods = mRecordingPeriods.size();
diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h
index aaeb32e891..4a77dfb1f6 100644
--- a/indra/llcommon/lltracerecording.h
+++ b/indra/llcommon/lltracerecording.h
@@ -308,7 +308,7 @@ namespace LLTrace
void nextPeriod();
U32 getNumPeriods() { return mRecordingPeriods.size(); }
- LLUnit<LLUnits::Seconds, F64> getDuration();
+ LLUnit<LLUnits::Seconds, F64> getDuration() const;
void appendPeriodicRecording(PeriodicRecording& other);
Recording& getLastRecording();
@@ -356,7 +356,7 @@ namespace LLTrace
size_t total_periods = mRecordingPeriods.size();
num_periods = llmin(num_periods, total_periods);
- typename T min_val = std::numeric_limits<T>::max();
+ T min_val = std::numeric_limits<T>::max();
for (S32 i = 1; i <= num_periods; i++)
{
S32 index = (mCurPeriod + total_periods - i) % total_periods;
@@ -397,7 +397,7 @@ namespace LLTrace
}
template <typename T>
- typename T getPeriodMax(const TraceType<SampleAccumulator<T> >& stat, size_t num_periods = U32_MAX) const
+ T getPeriodMax(const TraceType<SampleAccumulator<T> >& stat, size_t num_periods = U32_MAX) const
{
size_t total_periods = mRecordingPeriods.size();
num_periods = llmin(num_periods, total_periods);
@@ -412,7 +412,7 @@ namespace LLTrace
}
template <typename T>
- typename T getPeriodMax(const TraceType<EventAccumulator<T> >& stat, size_t num_periods = U32_MAX) const
+ T getPeriodMax(const TraceType<EventAccumulator<T> >& stat, size_t num_periods = U32_MAX) const
{
size_t total_periods = mRecordingPeriods.size();
num_periods = llmin(num_periods, total_periods);
@@ -551,7 +551,6 @@ namespace LLTrace
private:
std::vector<Recording> mRecordingPeriods;
- Recording mTotalRecording;
const bool mAutoResize;
S32 mCurPeriod;
};
diff --git a/indra/llcommon/lltracethreadrecorder.cpp b/indra/llcommon/lltracethreadrecorder.cpp
index 75c7cb2ff1..c281b768ce 100644
--- a/indra/llcommon/lltracethreadrecorder.cpp
+++ b/indra/llcommon/lltracethreadrecorder.cpp
@@ -247,7 +247,7 @@ void SlaveThreadRecorder::SharedData::reset()
// MasterThreadRecorder
///////////////////////////////////////////////////////////////////////
-LLFastTimer::DeclareTimer FTM_PULL_TRACE_DATA_FROM_SLAVES("Pull slave trace data");
+static LLFastTimer::DeclareTimer FTM_PULL_TRACE_DATA_FROM_SLAVES("Pull slave trace data");
void MasterThreadRecorder::pullFromSlaveThreads()
{
LLFastTimer _(FTM_PULL_TRACE_DATA_FROM_SLAVES);
diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h
index f86f111b90..e2803c74b0 100644
--- a/indra/llcommon/llunit.h
+++ b/indra/llcommon/llunit.h
@@ -471,6 +471,9 @@ struct Hertz { typedef Hertz base_unit_t; };
LL_DECLARE_DERIVED_UNIT(1000, Hertz, Kilohertz);
LL_DECLARE_DERIVED_UNIT(1000 * 1000, Hertz, Megahertz);
LL_DECLARE_DERIVED_UNIT(1000 * 1000 * 1000, Hertz, Gigahertz);
+
+struct Radians { typedef Radians base_unit_t; };
+LL_DECLARE_DERIVED_UNIT(DEG_TO_RAD, Radians, Degrees);
} // namespace LLUnits
#endif // LL_LLUNIT_H