diff options
author | Richard Linden <none@none> | 2013-09-27 11:18:39 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-09-27 11:18:39 -0700 |
commit | e0a443f5a6b76fd1ab5ffaa8e7a1941d47c80f4f (patch) | |
tree | ba8ed1f921f6ddb8c16b37be082d48fd700211de /indra/llcommon | |
parent | 1733be96680e7ceb1911acc6af7fa3e12282fad7 (diff) |
BUILDFIX: fix for mac builds
also, fixed alignment of tick labels on stat bars
Diffstat (limited to 'indra/llcommon')
-rwxr-xr-x | indra/llcommon/llmemory.h | 2 | ||||
-rw-r--r-- | indra/llcommon/lltraceaccumulators.h | 18 | ||||
-rw-r--r-- | indra/llcommon/lltracerecording.cpp | 112 | ||||
-rw-r--r-- | indra/llcommon/lltracerecording.h | 120 |
4 files changed, 126 insertions, 126 deletions
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index 2330bfb8ea..8daea255f9 100755 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -145,7 +145,7 @@ inline void ll_aligned_free_32(void *p) #if defined(LL_WINDOWS) _aligned_free(p); #elif defined(LL_DARWIN) - ll_aligned_free( p ); + ll_aligned_free_fallback( p ); #else free(p); // posix_memalign() is compatible with heap deallocator #endif diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h index 4fe84455a6..2dcfdf48ad 100644 --- a/indra/llcommon/lltraceaccumulators.h +++ b/indra/llcommon/lltraceaccumulators.h @@ -52,7 +52,7 @@ namespace LLTrace class AccumulatorBuffer : public LLRefCount { typedef AccumulatorBuffer<ACCUMULATOR> self_t; - static const U32 ACCUMULATOR_BUFFER_SIZE_INCREMENT = 16; + static const S32 ACCUMULATOR_BUFFER_SIZE_INCREMENT = 16; private: struct StaticAllocationMarker { }; @@ -267,7 +267,7 @@ namespace LLTrace F64 getMean() const { return mMean; } F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mNumSamples); } F64 getSumOfSquares() const { return mSumOfSquares; } - U32 getSampleCount() const { return mNumSamples; } + S32 getSampleCount() const { return mNumSamples; } bool hasValue() const { return mNumSamples > 0; } private: @@ -279,7 +279,7 @@ namespace LLTrace F64 mMean, mSumOfSquares; - U32 mNumSamples; + S32 mNumSamples; }; @@ -352,7 +352,7 @@ namespace LLTrace F64 getStandardDeviation() const { return sqrtf(mSumOfSquares / mTotalSamplingTime); } F64 getSumOfSquares() const { return mSumOfSquares; } F64SecondsImplicit getSamplingTime() { return mTotalSamplingTime; } - U32 getSampleCount() const { return mNumSamples; } + S32 getSampleCount() const { return mNumSamples; } bool hasValue() const { return mHasValue; } private: @@ -370,7 +370,7 @@ namespace LLTrace mLastSampleTimeStamp, mTotalSamplingTime; - U32 mNumSamples; + S32 mNumSamples; }; class CountAccumulator @@ -405,12 +405,12 @@ namespace LLTrace F64 getSum() const { return mSum; } - U32 getSampleCount() const { return mNumSamples; } + S32 getSampleCount() const { return mNumSamples; } private: F64 mSum; - U32 mNumSamples; + S32 mNumSamples; }; class TimeBlockAccumulator @@ -422,7 +422,7 @@ namespace LLTrace // fake classes that allows us to view different facets of underlying statistic struct CallCountFacet { - typedef U32 value_t; + typedef S32 value_t; }; struct SelfTimeFacet @@ -451,7 +451,7 @@ namespace LLTrace // U64 mTotalTimeCounter, mSelfTimeCounter; - U32 mCalls; + S32 mCalls; class TimeBlock* mParent; // last acknowledged parent of this time block class TimeBlock* mLastCaller; // used to bootstrap tree construction U16 mActiveCount; // number of timers with this ID active on stack diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index c16d02216d..ddf62845a0 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -142,7 +142,7 @@ F64Seconds Recording::getSum(const TraceType<TimeBlockAccumulator::SelfTimeFacet } -U32 Recording::getSum(const TraceType<TimeBlockAccumulator::CallCountFacet>& stat) +S32 Recording::getSum(const TraceType<TimeBlockAccumulator::CallCountFacet>& stat) { return mBuffers->mStackTimers[stat.getIndex()].mCalls; } @@ -238,7 +238,7 @@ F64Kilobytes Recording::getPerSec(const TraceType<MemStatAccumulator::Allocation return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mAllocated.getSum() / mElapsedSeconds.value()); } -U32 Recording::getSampleCount(const TraceType<MemStatAccumulator::AllocationFacet>& stat) +S32 Recording::getSampleCount(const TraceType<MemStatAccumulator::AllocationFacet>& stat) { return mBuffers->mMemStats[stat.getIndex()].mAllocated.getSampleCount(); } @@ -253,7 +253,7 @@ F64Kilobytes Recording::getPerSec(const TraceType<MemStatAccumulator::Deallocati return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mDeallocated.getSum() / mElapsedSeconds.value()); } -U32 Recording::getSampleCount(const TraceType<MemStatAccumulator::DeallocationFacet>& stat) +S32 Recording::getSampleCount(const TraceType<MemStatAccumulator::DeallocationFacet>& stat) { return mBuffers->mMemStats[stat.getIndex()].mDeallocated.getSampleCount(); } @@ -268,7 +268,7 @@ F64Kilobytes Recording::getPerSec(const TraceType<MemStatAccumulator::ShadowAllo return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mShadowAllocated.getSum() / mElapsedSeconds.value()); } -U32 Recording::getSampleCount(const TraceType<MemStatAccumulator::ShadowAllocationFacet>& stat) +S32 Recording::getSampleCount(const TraceType<MemStatAccumulator::ShadowAllocationFacet>& stat) { return mBuffers->mMemStats[stat.getIndex()].mShadowAllocated.getSampleCount(); } @@ -283,7 +283,7 @@ F64Kilobytes Recording::getPerSec(const TraceType<MemStatAccumulator::ShadowDeal return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mShadowDeallocated.getSum() / mElapsedSeconds.value()); } -U32 Recording::getSampleCount(const TraceType<MemStatAccumulator::ShadowDeallocationFacet>& stat) +S32 Recording::getSampleCount(const TraceType<MemStatAccumulator::ShadowDeallocationFacet>& stat) { return mBuffers->mMemStats[stat.getIndex()].mShadowDeallocated.getSampleCount(); } @@ -304,7 +304,7 @@ F64 Recording::getPerSec( const TraceType<CountAccumulator>& stat ) return sum / mElapsedSeconds.value(); } -U32 Recording::getSampleCount( const TraceType<CountAccumulator>& stat ) +S32 Recording::getSampleCount( const TraceType<CountAccumulator>& stat ) { return mBuffers->mCounts[stat.getIndex()].getSampleCount(); } @@ -339,7 +339,7 @@ F64 Recording::getLastValue( const TraceType<SampleAccumulator>& stat ) return mBuffers->mSamples[stat.getIndex()].getLastValue(); } -U32 Recording::getSampleCount( const TraceType<SampleAccumulator>& stat ) +S32 Recording::getSampleCount( const TraceType<SampleAccumulator>& stat ) { return mBuffers->mSamples[stat.getIndex()].getSampleCount(); } @@ -374,7 +374,7 @@ F64 Recording::getLastValue( const TraceType<EventAccumulator>& stat ) return mBuffers->mEvents[stat.getIndex()].getLastValue(); } -U32 Recording::getSampleCount( const TraceType<EventAccumulator>& stat ) +S32 Recording::getSampleCount( const TraceType<EventAccumulator>& stat ) { return mBuffers->mEvents[stat.getIndex()].getSampleCount(); } @@ -383,7 +383,7 @@ U32 Recording::getSampleCount( const TraceType<EventAccumulator>& stat ) // PeriodicRecording /////////////////////////////////////////////////////////////////////// -PeriodicRecording::PeriodicRecording( U32 num_periods, EPlayState state) +PeriodicRecording::PeriodicRecording( S32 num_periods, EPlayState state) : mAutoResize(num_periods == 0), mCurPeriod(0), mNumPeriods(0), @@ -403,7 +403,7 @@ void PeriodicRecording::nextPeriod() mCurPeriod = (mCurPeriod + 1) % mRecordingPeriods.size(); old_recording.splitTo(getCurRecording()); - mNumPeriods = llmin(mRecordingPeriods.size(), mNumPeriods + 1); + mNumPeriods = llmin((S32)mRecordingPeriods.size(), mNumPeriods + 1); } void PeriodicRecording::appendRecording(Recording& recording) @@ -420,21 +420,21 @@ void PeriodicRecording::appendPeriodicRecording( PeriodicRecording& other ) getCurRecording().update(); other.getCurRecording().update(); - const U32 other_recording_slots = other.mRecordingPeriods.size(); - const U32 other_num_recordings = other.getNumRecordedPeriods(); - const U32 other_current_recording_index = other.mCurPeriod; - const U32 other_oldest_recording_index = (other_current_recording_index + other_recording_slots - other_num_recordings + 1) % other_recording_slots; + const S32 other_recording_slots = other.mRecordingPeriods.size(); + const S32 other_num_recordings = other.getNumRecordedPeriods(); + const S32 other_current_recording_index = other.mCurPeriod; + const S32 other_oldest_recording_index = (other_current_recording_index + other_recording_slots - other_num_recordings + 1) % other_recording_slots; // append first recording into our current slot getCurRecording().appendRecording(other.mRecordingPeriods[other_oldest_recording_index]); // from now on, add new recordings for everything after the first - U32 other_index = (other_oldest_recording_index + 1) % other_recording_slots; + S32 other_index = (other_oldest_recording_index + 1) % other_recording_slots; if (mAutoResize) { // push back recordings for everything in the middle - U32 other_index = (other_oldest_recording_index + 1) % other_recording_slots; + S32 other_index = (other_oldest_recording_index + 1) % other_recording_slots; while (other_index != other_current_recording_index) { mRecordingPeriods.push_back(other.mRecordingPeriods[other_index]); @@ -452,13 +452,13 @@ void PeriodicRecording::appendPeriodicRecording( PeriodicRecording& other ) } else { - size_t num_to_copy = llmin( mRecordingPeriods.size(), (size_t)other_num_recordings); + S32 num_to_copy = llmin((S32)mRecordingPeriods.size(), (S32)other_num_recordings); std::vector<Recording>::iterator src_it = other.mRecordingPeriods.begin() + other_index ; std::vector<Recording>::iterator dest_it = mRecordingPeriods.begin() + mCurPeriod; // already consumed the first recording from other, so start counting at 1 - for(size_t i = 1; i < num_to_copy; i++) + for(S32 i = 1; i < num_to_copy; i++) { *dest_it = *src_it; @@ -477,7 +477,7 @@ void PeriodicRecording::appendPeriodicRecording( PeriodicRecording& other ) llassert(num_to_copy >= 1); // advance to last recording period copied, and make that our current period mCurPeriod = (mCurPeriod + num_to_copy - 1) % mRecordingPeriods.size(); - mNumPeriods = llmin(mRecordingPeriods.size(), mNumPeriods + num_to_copy - 1); + mNumPeriods = llmin((S32)mRecordingPeriods.size(), mNumPeriods + num_to_copy - 1); } // end with fresh period, otherwise next appendPeriodicRecording() will merge the first @@ -489,10 +489,10 @@ void PeriodicRecording::appendPeriodicRecording( PeriodicRecording& other ) F64Seconds PeriodicRecording::getDuration() const { F64Seconds duration; - size_t num_periods = mRecordingPeriods.size(); - for (size_t i = 1; i <= num_periods; i++) + S32 num_periods = mRecordingPeriods.size(); + for (S32 i = 1; i <= num_periods; i++) { - size_t index = (mCurPeriod + num_periods - i) % num_periods; + S32 index = (mCurPeriod + num_periods - i) % num_periods; duration += mRecordingPeriods[index].getDuration(); } return duration; @@ -527,17 +527,17 @@ const Recording& PeriodicRecording::getCurRecording() const return mRecordingPeriods[mCurPeriod]; } -Recording& PeriodicRecording::getPrevRecording( U32 offset ) +Recording& PeriodicRecording::getPrevRecording( S32 offset ) { - U32 num_periods = mRecordingPeriods.size(); - offset = llclamp(offset, 0u, num_periods - 1); + S32 num_periods = mRecordingPeriods.size(); + offset = llclamp(offset, 0, num_periods - 1); return mRecordingPeriods[(mCurPeriod + num_periods - offset) % num_periods]; } -const Recording& PeriodicRecording::getPrevRecording( U32 offset ) const +const Recording& PeriodicRecording::getPrevRecording( S32 offset ) const { - U32 num_periods = mRecordingPeriods.size(); - offset = llclamp(offset, 0u, num_periods - 1); + S32 num_periods = mRecordingPeriods.size(); + offset = llclamp(offset, 0, num_periods - 1); return mRecordingPeriods[(mCurPeriod + num_periods - offset) % num_periods]; } @@ -579,9 +579,9 @@ void PeriodicRecording::handleSplitTo(PeriodicRecording& other) getCurRecording().splitTo(other.getCurRecording()); } -F64 PeriodicRecording::getPeriodMin( const TraceType<EventAccumulator>& stat, size_t num_periods /*= U32_MAX*/ ) +F64 PeriodicRecording::getPeriodMin( const TraceType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { - size_t total_periods = mRecordingPeriods.size(); + S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); bool has_value = false; @@ -601,9 +601,9 @@ F64 PeriodicRecording::getPeriodMin( const TraceType<EventAccumulator>& stat, si : NaN; } -F64 PeriodicRecording::getPeriodMax( const TraceType<EventAccumulator>& stat, size_t num_periods /*= U32_MAX*/ ) +F64 PeriodicRecording::getPeriodMax( const TraceType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { - size_t total_periods = mRecordingPeriods.size(); + S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); bool has_value = false; @@ -624,9 +624,9 @@ F64 PeriodicRecording::getPeriodMax( const TraceType<EventAccumulator>& stat, si } // calculates means using aggregates per period -F64 PeriodicRecording::getPeriodMean( const TraceType<EventAccumulator>& stat, size_t num_periods /*= U32_MAX*/ ) +F64 PeriodicRecording::getPeriodMean( const TraceType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { - size_t total_periods = mRecordingPeriods.size(); + S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); F64 mean = 0; @@ -648,9 +648,9 @@ F64 PeriodicRecording::getPeriodMean( const TraceType<EventAccumulator>& stat, s } -F64 PeriodicRecording::getPeriodStandardDeviation( const TraceType<EventAccumulator>& stat, size_t num_periods /*= U32_MAX*/ ) +F64 PeriodicRecording::getPeriodStandardDeviation( const TraceType<EventAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { - size_t total_periods = mRecordingPeriods.size(); + S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); F64 period_mean = getPeriodMean(stat, num_periods); @@ -673,9 +673,9 @@ F64 PeriodicRecording::getPeriodStandardDeviation( const TraceType<EventAccumula : NaN; } -F64 PeriodicRecording::getPeriodMin( const TraceType<SampleAccumulator>& stat, size_t num_periods /*= U32_MAX*/ ) +F64 PeriodicRecording::getPeriodMin( const TraceType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { - size_t total_periods = mRecordingPeriods.size(); + S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); bool has_value = false; @@ -695,9 +695,9 @@ F64 PeriodicRecording::getPeriodMin( const TraceType<SampleAccumulator>& stat, s : NaN; } -F64 PeriodicRecording::getPeriodMax(const TraceType<SampleAccumulator>& stat, size_t num_periods /*= U32_MAX*/) +F64 PeriodicRecording::getPeriodMax(const TraceType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/) { - size_t total_periods = mRecordingPeriods.size(); + S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); bool has_value = false; @@ -718,9 +718,9 @@ F64 PeriodicRecording::getPeriodMax(const TraceType<SampleAccumulator>& stat, si } -F64 PeriodicRecording::getPeriodMean( const TraceType<SampleAccumulator>& stat, size_t num_periods /*= U32_MAX*/ ) +F64 PeriodicRecording::getPeriodMean( const TraceType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { - size_t total_periods = mRecordingPeriods.size(); + S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); S32 valid_period_count = 0; @@ -741,9 +741,9 @@ F64 PeriodicRecording::getPeriodMean( const TraceType<SampleAccumulator>& stat, : NaN; } -F64 PeriodicRecording::getPeriodStandardDeviation( const TraceType<SampleAccumulator>& stat, size_t num_periods /*= U32_MAX*/ ) +F64 PeriodicRecording::getPeriodStandardDeviation( const TraceType<SampleAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { - size_t total_periods = mRecordingPeriods.size(); + S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); F64 period_mean = getPeriodMean(stat, num_periods); @@ -767,9 +767,9 @@ F64 PeriodicRecording::getPeriodStandardDeviation( const TraceType<SampleAccumul } -F64Kilobytes PeriodicRecording::getPeriodMin( const TraceType<MemStatAccumulator>& stat, size_t num_periods /*= U32_MAX*/ ) +F64Kilobytes PeriodicRecording::getPeriodMin( const TraceType<MemStatAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { - size_t total_periods = mRecordingPeriods.size(); + S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); F64Kilobytes min_val(std::numeric_limits<F64>::max()); @@ -782,14 +782,14 @@ F64Kilobytes PeriodicRecording::getPeriodMin( const TraceType<MemStatAccumulator return min_val; } -F64Kilobytes PeriodicRecording::getPeriodMin(const MemStatHandle& stat, size_t num_periods) +F64Kilobytes PeriodicRecording::getPeriodMin(const MemStatHandle& stat, S32 num_periods) { return getPeriodMin(static_cast<const TraceType<MemStatAccumulator>&>(stat), num_periods); } -F64Kilobytes PeriodicRecording::getPeriodMax(const TraceType<MemStatAccumulator>& stat, size_t num_periods /*= U32_MAX*/) +F64Kilobytes PeriodicRecording::getPeriodMax(const TraceType<MemStatAccumulator>& stat, S32 num_periods /*= S32_MAX*/) { - size_t total_periods = mRecordingPeriods.size(); + S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); F64Kilobytes max_val(0.0); @@ -802,14 +802,14 @@ F64Kilobytes PeriodicRecording::getPeriodMax(const TraceType<MemStatAccumulator> return max_val; } -F64Kilobytes PeriodicRecording::getPeriodMax(const MemStatHandle& stat, size_t num_periods) +F64Kilobytes PeriodicRecording::getPeriodMax(const MemStatHandle& stat, S32 num_periods) { return getPeriodMax(static_cast<const TraceType<MemStatAccumulator>&>(stat), num_periods); } -F64Kilobytes PeriodicRecording::getPeriodMean( const TraceType<MemStatAccumulator>& stat, size_t num_periods /*= U32_MAX*/ ) +F64Kilobytes PeriodicRecording::getPeriodMean( const TraceType<MemStatAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { - size_t total_periods = mRecordingPeriods.size(); + S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); F64Kilobytes mean(0); @@ -823,14 +823,14 @@ F64Kilobytes PeriodicRecording::getPeriodMean( const TraceType<MemStatAccumulato return mean / F64(num_periods); } -F64Kilobytes PeriodicRecording::getPeriodMean(const MemStatHandle& stat, size_t num_periods) +F64Kilobytes PeriodicRecording::getPeriodMean(const MemStatHandle& stat, S32 num_periods) { return getPeriodMean(static_cast<const TraceType<MemStatAccumulator>&>(stat), num_periods); } -F64Kilobytes PeriodicRecording::getPeriodStandardDeviation( const TraceType<MemStatAccumulator>& stat, size_t num_periods /*= U32_MAX*/ ) +F64Kilobytes PeriodicRecording::getPeriodStandardDeviation( const TraceType<MemStatAccumulator>& stat, S32 num_periods /*= S32_MAX*/ ) { - size_t total_periods = mRecordingPeriods.size(); + S32 total_periods = mRecordingPeriods.size(); num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); F64Kilobytes period_mean = getPeriodMean(stat, num_periods); @@ -853,7 +853,7 @@ F64Kilobytes PeriodicRecording::getPeriodStandardDeviation( const TraceType<MemS : NaN); } -F64Kilobytes PeriodicRecording::getPeriodStandardDeviation(const MemStatHandle& stat, size_t num_periods) +F64Kilobytes PeriodicRecording::getPeriodStandardDeviation(const MemStatHandle& stat, S32 num_periods) { return getPeriodStandardDeviation(static_cast<const TraceType<MemStatAccumulator>&>(stat), num_periods); } diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index 3f7737b20b..13dffdc701 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -144,7 +144,7 @@ namespace LLTrace struct RelatedTypes<bool> { typedef F64 fractional_t; - typedef U32 sum_t; + typedef S32 sum_t; }; class Recording @@ -170,7 +170,7 @@ namespace LLTrace // Timer accessors F64Seconds getSum(const TraceType<TimeBlockAccumulator>& stat); F64Seconds getSum(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat); - U32 getSum(const TraceType<TimeBlockAccumulator::CallCountFacet>& stat); + S32 getSum(const TraceType<TimeBlockAccumulator::CallCountFacet>& stat); F64Seconds getPerSec(const TraceType<TimeBlockAccumulator>& stat); F64Seconds getPerSec(const TraceType<TimeBlockAccumulator::SelfTimeFacet>& stat); @@ -194,19 +194,19 @@ namespace LLTrace F64Kilobytes getSum(const TraceType<MemStatAccumulator::AllocationFacet>& stat); F64Kilobytes getPerSec(const TraceType<MemStatAccumulator::AllocationFacet>& stat); - U32 getSampleCount(const TraceType<MemStatAccumulator::AllocationFacet>& stat); + S32 getSampleCount(const TraceType<MemStatAccumulator::AllocationFacet>& stat); F64Kilobytes getSum(const TraceType<MemStatAccumulator::DeallocationFacet>& stat); F64Kilobytes getPerSec(const TraceType<MemStatAccumulator::DeallocationFacet>& stat); - U32 getSampleCount(const TraceType<MemStatAccumulator::DeallocationFacet>& stat); + S32 getSampleCount(const TraceType<MemStatAccumulator::DeallocationFacet>& stat); F64Kilobytes getSum(const TraceType<MemStatAccumulator::ShadowAllocationFacet>& stat); F64Kilobytes getPerSec(const TraceType<MemStatAccumulator::ShadowAllocationFacet>& stat); - U32 getSampleCount(const TraceType<MemStatAccumulator::ShadowAllocationFacet>& stat); + S32 getSampleCount(const TraceType<MemStatAccumulator::ShadowAllocationFacet>& stat); F64Kilobytes getSum(const TraceType<MemStatAccumulator::ShadowDeallocationFacet>& stat); F64Kilobytes getPerSec(const TraceType<MemStatAccumulator::ShadowDeallocationFacet>& stat); - U32 getSampleCount(const TraceType<MemStatAccumulator::ShadowDeallocationFacet>& stat); + S32 getSampleCount(const TraceType<MemStatAccumulator::ShadowDeallocationFacet>& stat); // CountStatHandle accessors F64 getSum(const TraceType<CountAccumulator>& stat); @@ -223,7 +223,7 @@ namespace LLTrace return (typename RelatedTypes<T>::fractional_t)getPerSec(static_cast<const TraceType<CountAccumulator>&> (stat)); } - U32 getSampleCount(const TraceType<CountAccumulator>& stat); + S32 getSampleCount(const TraceType<CountAccumulator>& stat); // SampleStatHandle accessors @@ -264,7 +264,7 @@ namespace LLTrace return (T)getLastValue(static_cast<const TraceType<SampleAccumulator>&> (stat)); } - U32 getSampleCount(const TraceType<SampleAccumulator>& stat); + S32 getSampleCount(const TraceType<SampleAccumulator>& stat); // EventStatHandle accessors bool hasValue(const TraceType<EventAccumulator>& stat); @@ -311,7 +311,7 @@ namespace LLTrace return (T)getLastValue(static_cast<const TraceType<EventAccumulator>&> (stat)); } - U32 getSampleCount(const TraceType<EventAccumulator>& stat); + S32 getSampleCount(const TraceType<EventAccumulator>& stat); F64Seconds getDuration() const { return mElapsedSeconds; } @@ -338,10 +338,10 @@ namespace LLTrace : public LLStopWatchControlsMixin<PeriodicRecording> { public: - PeriodicRecording(U32 num_periods, EPlayState state = STOPPED); + PeriodicRecording(S32 num_periods, EPlayState state = STOPPED); void nextPeriod(); - size_t getNumRecordedPeriods() { return mNumPeriods; } + S32 getNumRecordedPeriods() { return mNumPeriods; } F64Seconds getDuration() const; @@ -351,17 +351,17 @@ namespace LLTrace const Recording& getLastRecording() const; Recording& getCurRecording(); const Recording& getCurRecording() const; - Recording& getPrevRecording(U32 offset); - const Recording& getPrevRecording(U32 offset) const; + Recording& getPrevRecording(S32 offset); + const Recording& getPrevRecording(S32 offset) const; Recording snapshotCurRecording() const; template <typename T> - size_t getSampleCount(const TraceType<T>& stat, size_t num_periods = U32_MAX) + S32 getSampleCount(const TraceType<T>& stat, S32 num_periods = S32_MAX) { - size_t total_periods = mNumPeriods; + S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); - size_t num_samples = 0; + S32 num_samples = 0; for (S32 i = 1; i <= num_periods; i++) { Recording& recording = getPrevRecording(i); @@ -376,9 +376,9 @@ namespace LLTrace // catch all for stats that have a defined sum template <typename T> - typename T::value_t getPeriodMin(const TraceType<T>& stat, size_t num_periods = U32_MAX) + typename T::value_t getPeriodMin(const TraceType<T>& stat, S32 num_periods = S32_MAX) { - size_t total_periods = mNumPeriods; + S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); typename T::value_t min_val = std::numeric_limits<typename T::value_t>::max(); @@ -391,32 +391,32 @@ namespace LLTrace } template<typename T> - T getPeriodMin(const CountStatHandle<T>& stat, size_t num_periods = U32_MAX) + T getPeriodMin(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX) { return T(getPeriodMin(static_cast<const TraceType<CountAccumulator>&>(stat), num_periods)); } - F64 getPeriodMin(const TraceType<SampleAccumulator>& stat, size_t num_periods = U32_MAX); + F64 getPeriodMin(const TraceType<SampleAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> - T getPeriodMin(const SampleStatHandle<T>& stat, size_t num_periods = U32_MAX) + T getPeriodMin(const SampleStatHandle<T>& stat, S32 num_periods = S32_MAX) { return T(getPeriodMin(static_cast<const TraceType<SampleAccumulator>&>(stat), num_periods)); } - F64 getPeriodMin(const TraceType<EventAccumulator>& stat, size_t num_periods = U32_MAX); + F64 getPeriodMin(const TraceType<EventAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> - T getPeriodMin(const EventStatHandle<T>& stat, size_t num_periods = U32_MAX) + T getPeriodMin(const EventStatHandle<T>& stat, S32 num_periods = S32_MAX) { return T(getPeriodMin(static_cast<const TraceType<EventAccumulator>&>(stat), num_periods)); } - F64Kilobytes getPeriodMin(const TraceType<MemStatAccumulator>& stat, size_t num_periods = U32_MAX); - F64Kilobytes getPeriodMin(const MemStatHandle& stat, size_t num_periods = U32_MAX); + F64Kilobytes getPeriodMin(const TraceType<MemStatAccumulator>& stat, S32 num_periods = S32_MAX); + F64Kilobytes getPeriodMin(const MemStatHandle& stat, S32 num_periods = S32_MAX); template <typename T> - typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMinPerSec(const TraceType<T>& stat, size_t num_periods = U32_MAX) + typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMinPerSec(const TraceType<T>& stat, S32 num_periods = S32_MAX) { - size_t total_periods = mNumPeriods; + S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); typename RelatedTypes<typename T::value_t>::fractional_t min_val = std::numeric_limits<F64>::max(); @@ -429,7 +429,7 @@ namespace LLTrace } template<typename T> - typename RelatedTypes<T>::fractional_t getPeriodMinPerSec(const CountStatHandle<T>& stat, size_t num_periods = U32_MAX) + typename RelatedTypes<T>::fractional_t getPeriodMinPerSec(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX) { return typename RelatedTypes<T>::fractional_t(getPeriodMinPerSec(static_cast<const TraceType<CountAccumulator>&>(stat), num_periods)); } @@ -440,9 +440,9 @@ namespace LLTrace // catch all for stats that have a defined sum template <typename T> - typename T::value_t getPeriodMax(const TraceType<T>& stat, size_t num_periods = U32_MAX) + typename T::value_t getPeriodMax(const TraceType<T>& stat, S32 num_periods = S32_MAX) { - size_t total_periods = mNumPeriods; + S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); typename T::value_t max_val = std::numeric_limits<typename T::value_t>::min(); @@ -455,32 +455,32 @@ namespace LLTrace } template<typename T> - T getPeriodMax(const CountStatHandle<T>& stat, size_t num_periods = U32_MAX) + T getPeriodMax(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX) { return T(getPeriodMax(static_cast<const TraceType<CountAccumulator>&>(stat), num_periods)); } - F64 getPeriodMax(const TraceType<SampleAccumulator>& stat, size_t num_periods = U32_MAX); + F64 getPeriodMax(const TraceType<SampleAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> - T getPeriodMax(const SampleStatHandle<T>& stat, size_t num_periods = U32_MAX) + T getPeriodMax(const SampleStatHandle<T>& stat, S32 num_periods = S32_MAX) { return T(getPeriodMax(static_cast<const TraceType<SampleAccumulator>&>(stat), num_periods)); } - F64 getPeriodMax(const TraceType<EventAccumulator>& stat, size_t num_periods = U32_MAX); + F64 getPeriodMax(const TraceType<EventAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> - T getPeriodMax(const EventStatHandle<T>& stat, size_t num_periods = U32_MAX) + T getPeriodMax(const EventStatHandle<T>& stat, S32 num_periods = S32_MAX) { return T(getPeriodMax(static_cast<const TraceType<EventAccumulator>&>(stat), num_periods)); } - F64Kilobytes getPeriodMax(const TraceType<MemStatAccumulator>& stat, size_t num_periods = U32_MAX); - F64Kilobytes getPeriodMax(const MemStatHandle& stat, size_t num_periods = U32_MAX); + F64Kilobytes getPeriodMax(const TraceType<MemStatAccumulator>& stat, S32 num_periods = S32_MAX); + F64Kilobytes getPeriodMax(const MemStatHandle& stat, S32 num_periods = S32_MAX); template <typename T> - typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMaxPerSec(const TraceType<T>& stat, size_t num_periods = U32_MAX) + typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMaxPerSec(const TraceType<T>& stat, S32 num_periods = S32_MAX) { - size_t total_periods = mNumPeriods; + S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); F64 max_val = std::numeric_limits<F64>::min(); @@ -493,7 +493,7 @@ namespace LLTrace } template<typename T> - typename RelatedTypes<T>::fractional_t getPeriodMaxPerSec(const CountStatHandle<T>& stat, size_t num_periods = U32_MAX) + typename RelatedTypes<T>::fractional_t getPeriodMaxPerSec(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX) { return typename RelatedTypes<T>::fractional_t(getPeriodMaxPerSec(static_cast<const TraceType<CountAccumulator>&>(stat), num_periods)); } @@ -504,9 +504,9 @@ namespace LLTrace // catch all for stats that have a defined sum template <typename T> - typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMean(const TraceType<T >& stat, size_t num_periods = U32_MAX) + typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMean(const TraceType<T >& stat, S32 num_periods = S32_MAX) { - size_t total_periods = mNumPeriods; + S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); typename RelatedTypes<typename T::value_t>::fractional_t mean(0); @@ -525,31 +525,31 @@ namespace LLTrace } template<typename T> - typename RelatedTypes<T>::fractional_t getPeriodMean(const CountStatHandle<T>& stat, size_t num_periods = U32_MAX) + typename RelatedTypes<T>::fractional_t getPeriodMean(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX) { return typename RelatedTypes<T>::fractional_t(getPeriodMean(static_cast<const TraceType<CountAccumulator>&>(stat), num_periods)); } - F64 getPeriodMean(const TraceType<SampleAccumulator>& stat, size_t num_periods = U32_MAX); + F64 getPeriodMean(const TraceType<SampleAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> - typename RelatedTypes<T>::fractional_t getPeriodMean(const SampleStatHandle<T>& stat, size_t num_periods = U32_MAX) + typename RelatedTypes<T>::fractional_t getPeriodMean(const SampleStatHandle<T>& stat, S32 num_periods = S32_MAX) { return typename RelatedTypes<T>::fractional_t(getPeriodMean(static_cast<const TraceType<SampleAccumulator>&>(stat), num_periods)); } - F64 getPeriodMean(const TraceType<EventAccumulator>& stat, size_t num_periods = U32_MAX); + F64 getPeriodMean(const TraceType<EventAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> - typename RelatedTypes<T>::fractional_t getPeriodMean(const EventStatHandle<T>& stat, size_t num_periods = U32_MAX) + typename RelatedTypes<T>::fractional_t getPeriodMean(const EventStatHandle<T>& stat, S32 num_periods = S32_MAX) { return typename RelatedTypes<T>::fractional_t(getPeriodMean(static_cast<const TraceType<EventAccumulator>&>(stat), num_periods)); } - F64Kilobytes getPeriodMean(const TraceType<MemStatAccumulator>& stat, size_t num_periods = U32_MAX); - F64Kilobytes getPeriodMean(const MemStatHandle& stat, size_t num_periods = U32_MAX); + F64Kilobytes getPeriodMean(const TraceType<MemStatAccumulator>& stat, S32 num_periods = S32_MAX); + F64Kilobytes getPeriodMean(const MemStatHandle& stat, S32 num_periods = S32_MAX); template <typename T> - typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMeanPerSec(const TraceType<T>& stat, size_t num_periods = U32_MAX) + typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMeanPerSec(const TraceType<T>& stat, S32 num_periods = S32_MAX) { - size_t total_periods = mNumPeriods; + S32 total_periods = mNumPeriods; num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); typename RelatedTypes<typename T::value_t>::fractional_t mean = 0; @@ -569,7 +569,7 @@ namespace LLTrace } template<typename T> - typename RelatedTypes<T>::fractional_t getPeriodMeanPerSec(const CountStatHandle<T>& stat, size_t num_periods = U32_MAX) + typename RelatedTypes<T>::fractional_t getPeriodMeanPerSec(const CountStatHandle<T>& stat, S32 num_periods = S32_MAX) { return typename RelatedTypes<T>::fractional_t(getPeriodMeanPerSec(static_cast<const TraceType<CountAccumulator>&>(stat), num_periods)); } @@ -578,23 +578,23 @@ namespace LLTrace // PERIODIC STANDARD DEVIATION // - F64 getPeriodStandardDeviation(const TraceType<SampleAccumulator>& stat, size_t num_periods = U32_MAX); + F64 getPeriodStandardDeviation(const TraceType<SampleAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> - typename RelatedTypes<T>::fractional_t getPeriodStandardDeviation(const SampleStatHandle<T>& stat, size_t num_periods = U32_MAX) + typename RelatedTypes<T>::fractional_t getPeriodStandardDeviation(const SampleStatHandle<T>& stat, S32 num_periods = S32_MAX) { return typename RelatedTypes<T>::fractional_t(getPeriodStandardDeviation(static_cast<const TraceType<SampleAccumulator>&>(stat), num_periods)); } - F64 getPeriodStandardDeviation(const TraceType<EventAccumulator>& stat, size_t num_periods = U32_MAX); + F64 getPeriodStandardDeviation(const TraceType<EventAccumulator>& stat, S32 num_periods = S32_MAX); template<typename T> - typename RelatedTypes<T>::fractional_t getPeriodStandardDeviation(const EventStatHandle<T>& stat, size_t num_periods = U32_MAX) + typename RelatedTypes<T>::fractional_t getPeriodStandardDeviation(const EventStatHandle<T>& stat, S32 num_periods = S32_MAX) { return typename RelatedTypes<T>::fractional_t(getPeriodStandardDeviation(static_cast<const TraceType<EventAccumulator>&>(stat), num_periods)); } - F64Kilobytes getPeriodStandardDeviation(const TraceType<MemStatAccumulator>& stat, size_t num_periods = U32_MAX); - F64Kilobytes getPeriodStandardDeviation(const MemStatHandle& stat, size_t num_periods = U32_MAX); + F64Kilobytes getPeriodStandardDeviation(const TraceType<MemStatAccumulator>& stat, S32 num_periods = S32_MAX); + F64Kilobytes getPeriodStandardDeviation(const MemStatHandle& stat, S32 num_periods = S32_MAX); private: // implementation for LLStopWatchControlsMixin @@ -606,8 +606,8 @@ namespace LLTrace private: std::vector<Recording> mRecordingPeriods; const bool mAutoResize; - size_t mCurPeriod; - size_t mNumPeriods; + S32 mCurPeriod; + S32 mNumPeriods; }; PeriodicRecording& get_frame_recording(); |