diff options
author | Richard Linden <none@none> | 2012-12-06 00:37:15 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2012-12-06 00:37:15 -0800 |
commit | 60800dacdd7e9b66ed654af471f2b9e9680cd981 (patch) | |
tree | f71a65d1ab8a4d277a1ccbd109d852fcc00cba13 /indra/llcommon/lltrace.h | |
parent | 68967e7b2b9416ff66cb49ae755fb33d7b81d129 (diff) |
SH-3406 WIP convert fast timers to lltrace system
fixed gcc compile error
made LLCopyOnWritePointer contain an LLPointer, not derive from it
added type trait to control periodicrecording mean value type
Diffstat (limited to 'indra/llcommon/lltrace.h')
-rw-r--r-- | indra/llcommon/lltrace.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index a6b1b227c9..6e6bb51e47 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -201,18 +201,27 @@ namespace LLTrace } private: - ACCUMULATOR* mStorage; - size_t mStorageSize; - size_t mNextStorageSlot; + ACCUMULATOR* mStorage; + size_t mStorageSize; + size_t mNextStorageSlot; static LLThreadLocalPointer<ACCUMULATOR> sPrimaryStorage; }; template<typename ACCUMULATOR> LLThreadLocalPointer<ACCUMULATOR> AccumulatorBuffer<ACCUMULATOR>::sPrimaryStorage; + //TODO: replace with decltype when C++11 is enabled + template<typename T> + struct MeanValueType + { + typedef F64 type; + }; + template<typename ACCUMULATOR> class TraceType : public LLInstanceTracker<TraceType<ACCUMULATOR>, std::string> { public: + typedef typename MeanValueType<TraceType<ACCUMULATOR> >::type mean_t; + TraceType(const char* name, const char* description = NULL) : LLInstanceTracker(name), mName(name), @@ -415,6 +424,13 @@ namespace LLTrace U32 mCalls; }; + + template<> + struct MeanValueType<TraceType<TimeBlockAccumulator> > + { + typedef LLUnit<LLUnits::Seconds, F64> type; + }; + template<> class TraceType<TimeBlockAccumulator::CallCountAspect> : public TraceType<TimeBlockAccumulator> |