diff options
-rw-r--r-- | indra/llcommon/lltrace.h | 30 | ||||
-rw-r--r-- | indra/llcommon/lltracerecording.cpp | 102 | ||||
-rw-r--r-- | indra/llcommon/lltracerecording.h | 17 | ||||
-rwxr-xr-x | indra/llimage/llimage.cpp | 8 | ||||
-rwxr-xr-x | indra/llui/llstatbar.cpp | 227 | ||||
-rwxr-xr-x | indra/llui/llstatbar.h | 20 | ||||
-rw-r--r-- | indra/newview/llvieweroctree.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/floater_stats.xml | 11 |
8 files changed, 314 insertions, 105 deletions
diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index 3b4370f947..bf1119d694 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -512,12 +512,17 @@ public: return value; } + size_t& memClaim(size_t& size) + { + claim_mem(sMemStat, size); + mMemFootprint += size; + return size; + } - template<typename AMOUNT_T> - AMOUNT_T& memClaimAmount(AMOUNT_T& size) + int& memClaim(int& size) { - MemStatAccumulator& accumulator = sMemStat.getCurrentAccumulator(); - mMemFootprint += (size_t)size; + claim_mem(sMemStat, size); + mMemFootprint += size; return size; } @@ -536,10 +541,17 @@ public: return value; } - template<typename AMOUNT_T> - AMOUNT_T& memDisclaimAmount(AMOUNT_T& size) + size_t& memDisclaim(size_t& size) + { + disclaim_mem(sMemStat, size); + mMemFootprint -= size; + return size; + } + + int& memDisclaim(int& size) { - disclaim_mem(size); + disclaim_mem(sMemStat, size); + mMemFootprint -= size; return size; } @@ -569,12 +581,12 @@ private: { static void claim(mem_trackable_t& tracker, TRACKED& tracked) { - claim_shadow_mem( (F64)MemFootprint<TRACKED>::measure(tracked)); + claim_shadow_mem( sMemStat, MemFootprint<TRACKED>::measure(tracked)); } static void disclaim(mem_trackable_t& tracker, TRACKED& tracked) { - disclaim_shadow_mem((F64)MemFootprint<TRACKED>::measure(tracked)); + disclaim_shadow_mem(sMemStat, MemFootprint<TRACKED>::measure(tracked)); } }; }; diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index c278901bc0..7155cfa40a 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -168,6 +168,16 @@ F32 Recording::getPerSec(const TraceType<TimeBlockAccumulator::CallCountFacet>& return (F32)mBuffers->mStackTimers[stat.getIndex()].mCalls / mElapsedSeconds.value(); } +bool Recording::hasValue(const TraceType<MemStatAccumulator>& stat) +{ + return mBuffers->mMemStats[stat.getIndex()].mSize.hasValue(); +} + +bool Recording::hasValue(const TraceType<MemStatAccumulator::ShadowMemFacet>& stat) +{ + return mBuffers->mMemStats[stat.getIndex()].mShadowSize.hasValue(); +} + F64Bytes Recording::getMin(const TraceType<MemStatAccumulator>& stat) { return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getMin()); @@ -707,6 +717,98 @@ F64 PeriodicRecording::getPeriodStandardDeviation( const TraceType<SampleAccumul : NaN; } + +F64Bytes PeriodicRecording::getPeriodMin( const TraceType<MemStatAccumulator>& stat, size_t num_periods /*= U32_MAX*/ ) +{ + size_t total_periods = mRecordingPeriods.size(); + num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); + + F64Bytes min_val(std::numeric_limits<F64>::max()); + for (S32 i = 1; i <= num_periods; i++) + { + Recording& recording = getPrevRecording(i); + min_val = llmin(min_val, recording.getMin(stat)); + } + + return min_val; +} + +F64Bytes PeriodicRecording::getPeriodMin(const MemStatHandle& stat, size_t num_periods) +{ + return getPeriodMin(static_cast<const TraceType<MemStatAccumulator>&>(stat), num_periods); +} + +F64Bytes PeriodicRecording::getPeriodMax(const TraceType<MemStatAccumulator>& stat, size_t num_periods /*= U32_MAX*/) +{ + size_t total_periods = mRecordingPeriods.size(); + num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); + + F64Bytes max_val(0.0); + for (S32 i = 1; i <= num_periods; i++) + { + Recording& recording = getPrevRecording(i); + max_val = llmax(max_val, recording.getMax(stat)); + } + + return max_val; +} + +F64Bytes PeriodicRecording::getPeriodMax(const MemStatHandle& stat, size_t num_periods) +{ + return getPeriodMax(static_cast<const TraceType<MemStatAccumulator>&>(stat), num_periods); +} + +F64Bytes PeriodicRecording::getPeriodMean( const TraceType<MemStatAccumulator>& stat, size_t num_periods /*= U32_MAX*/ ) +{ + size_t total_periods = mRecordingPeriods.size(); + num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); + + F64Bytes mean(0); + + for (S32 i = 1; i <= num_periods; i++) + { + Recording& recording = getPrevRecording(i); + mean += recording.getMean(stat); + } + + return mean / F64(num_periods); +} + +F64Bytes PeriodicRecording::getPeriodMean(const MemStatHandle& stat, size_t num_periods) +{ + return getPeriodMean(static_cast<const TraceType<MemStatAccumulator>&>(stat), num_periods); +} + +F64Bytes PeriodicRecording::getPeriodStandardDeviation( const TraceType<MemStatAccumulator>& stat, size_t num_periods /*= U32_MAX*/ ) +{ + size_t total_periods = mRecordingPeriods.size(); + num_periods = llmin(num_periods, isStarted() ? total_periods - 1 : total_periods); + + F64Bytes period_mean = getPeriodMean(stat, num_periods); + S32 valid_period_count = 0; + F64 sum_of_squares = 0; + + for (S32 i = 1; i <= num_periods; i++) + { + Recording& recording = getPrevRecording(i); + if (recording.hasValue(stat)) + { + F64Bytes delta = recording.getMean(stat) - period_mean; + sum_of_squares += delta.value() * delta.value(); + valid_period_count++; + } + } + + return F64Bytes(valid_period_count + ? sqrt(sum_of_squares / (F64)valid_period_count) + : NaN); +} + +F64Bytes PeriodicRecording::getPeriodStandardDeviation(const MemStatHandle& stat, size_t num_periods) +{ + return getPeriodStandardDeviation(static_cast<const TraceType<MemStatAccumulator>&>(stat), num_periods); +} + /////////////////////////////////////////////////////////////////////// // ExtendableRecording /////////////////////////////////////////////////////////////////////// diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index 9550838798..2f5cefa8eb 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -124,6 +124,8 @@ namespace LLTrace template<typename T> class EventStatHandle; + class MemStatHandle; + template<typename T> struct RelatedTypes { @@ -175,6 +177,9 @@ namespace LLTrace F32 getPerSec(const TraceType<TimeBlockAccumulator::CallCountFacet>& stat); // Memory accessors + bool hasValue(const TraceType<MemStatAccumulator>& stat);
+ bool hasValue(const TraceType<MemStatAccumulator::ShadowMemFacet>& stat); + F64Bytes getMin(const TraceType<MemStatAccumulator>& stat); F64Bytes getMean(const TraceType<MemStatAccumulator>& stat); F64Bytes getMax(const TraceType<MemStatAccumulator>& stat); @@ -392,6 +397,9 @@ namespace LLTrace return T(getPeriodMin(static_cast<const TraceType<EventAccumulator>&>(stat), num_periods)); } + F64Bytes getPeriodMin(const TraceType<MemStatAccumulator>& stat, size_t num_periods = U32_MAX); + F64Bytes getPeriodMin(const MemStatHandle& stat, size_t num_periods = U32_MAX); + template <typename T> typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMinPerSec(const TraceType<T>& stat, size_t num_periods = U32_MAX) { @@ -453,6 +461,9 @@ namespace LLTrace return T(getPeriodMax(static_cast<const TraceType<EventAccumulator>&>(stat), num_periods)); } + F64Bytes getPeriodMax(const TraceType<MemStatAccumulator>& stat, size_t num_periods = U32_MAX); + F64Bytes getPeriodMax(const MemStatHandle& stat, size_t num_periods = U32_MAX); + template <typename T> typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMaxPerSec(const TraceType<T>& stat, size_t num_periods = U32_MAX) { @@ -519,6 +530,9 @@ namespace LLTrace return typename RelatedTypes<T>::fractional_t(getPeriodMean(static_cast<const TraceType<EventAccumulator>&>(stat), num_periods)); } + F64Bytes getPeriodMean(const TraceType<MemStatAccumulator>& stat, size_t num_periods = U32_MAX); + F64Bytes getPeriodMean(const MemStatHandle& stat, size_t num_periods = U32_MAX); + template <typename T> typename RelatedTypes<typename T::value_t>::fractional_t getPeriodMeanPerSec(const TraceType<T>& stat, size_t num_periods = U32_MAX) { @@ -566,6 +580,9 @@ namespace LLTrace return typename RelatedTypes<T>::fractional_t(getPeriodStandardDeviation(static_cast<const TraceType<EventAccumulator>&>(stat), num_periods)); } + F64Bytes getPeriodStandardDeviation(const TraceType<MemStatAccumulator>& stat, size_t num_periods = U32_MAX); + F64Bytes getPeriodStandardDeviation(const MemStatHandle& stat, size_t num_periods = U32_MAX); + private: // implementation for LLStopWatchControlsMixin /*virtual*/ void handleStart(); diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index bb4253a9f5..34e0e202b6 100755 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -159,7 +159,7 @@ void LLImageBase::sanityCheck() void LLImageBase::deleteData() { FREE_MEM(sPrivatePoolp, mData) ; - memDisclaimAmount(mDataSize) = 0; + memDisclaim(mDataSize) = 0; mData = NULL; } @@ -202,7 +202,7 @@ U8* LLImageBase::allocateData(S32 size) mBadBufferAllocation = true ; } mDataSize = size; - memClaimAmount(mDataSize); + memClaim(mDataSize); } return mData; @@ -224,7 +224,7 @@ U8* LLImageBase::reallocateData(S32 size) FREE_MEM(sPrivatePoolp, mData) ; } mData = new_datap; - memClaimAmount(memDisclaimAmount(mDataSize) = size); + memClaim(memDisclaim(mDataSize) = size); return mData; } @@ -1619,7 +1619,7 @@ void LLImageBase::setDataAndSize(U8 *data, S32 size) { ll_assert_aligned(data, 16); mData = data; - memClaimAmount(memDisclaimAmount(mDataSize) = size); + memClaim(memDisclaim(mDataSize) = size); } //static diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 725a835f7f..222db70d2b 100755 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -190,8 +190,10 @@ LLStatBar::LLStatBar(const Params& p) mAutoScaleMax(!p.bar_max.isProvided()), mAutoScaleMin(!p.bar_min.isProvided()), mTickValue(p.tick_spacing), - mLastDisplayValue(0.f) + mLastDisplayValue(0.f), + mStatType(STAT_NONE) { + mStat.valid = NULL; // tick value will be automatically calculated later if (!p.tick_spacing.isProvided() && p.bar_min.isProvided() && p.bar_max.isProvided()) { @@ -203,17 +205,22 @@ LLStatBar::LLStatBar(const Params& p) BOOL LLStatBar::handleHover(S32 x, S32 y, MASK mask) { - if (mCountFloatp) + switch(mStatType) { - LLToolTipMgr::instance().show(LLToolTip::Params().message(mCountFloatp->getDescription()).sticky_rect(calcScreenRect())); - } - else if ( mEventFloatp) - { - LLToolTipMgr::instance().show(LLToolTip::Params().message(mEventFloatp->getDescription()).sticky_rect(calcScreenRect())); - } - else if (mSampleFloatp) - { - LLToolTipMgr::instance().show(LLToolTip::Params().message(mSampleFloatp->getDescription()).sticky_rect(calcScreenRect())); + case STAT_COUNT: + LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.countStatp->getDescription()).sticky_rect(calcScreenRect())); + break; + case STAT_EVENT: + LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.eventStatp->getDescription()).sticky_rect(calcScreenRect())); + break; + case STAT_SAMPLE: + LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.sampleStatp->getDescription()).sticky_rect(calcScreenRect())); + break; + case STAT_MEM: + LLToolTipMgr::instance().show(LLToolTip::Params().message(mStat.memStatp->getDescription()).sticky_rect(calcScreenRect())); + break; + default: + break; } return TRUE; } @@ -321,50 +328,69 @@ void LLStatBar::draw() : mNumShortHistoryFrames; S32 num_rapid_changes = 0; - if (mCountFloatp) - { - const LLTrace::TraceType<LLTrace::CountAccumulator>& count_stat = *mCountFloatp; - - unit_label = std::string(count_stat.getUnitLabel()) + "/s"; - current = last_frame_recording.getPerSec(count_stat); - min = frame_recording.getPeriodMinPerSec(count_stat, num_frames); - max = frame_recording.getPeriodMaxPerSec(count_stat, num_frames); - mean = frame_recording.getPeriodMeanPerSec(count_stat, num_frames); - display_value = mean; - } - else if (mEventFloatp) + switch(mStatType) { - const LLTrace::TraceType<LLTrace::EventAccumulator>& event_stat = *mEventFloatp; - - unit_label = mUnitLabel.empty() ? event_stat.getUnitLabel() : mUnitLabel; - current = last_frame_recording.getLastValue(event_stat); - min = frame_recording.getPeriodMin(event_stat, num_frames); - max = frame_recording.getPeriodMax(event_stat, num_frames); - mean = frame_recording.getPeriodMean(event_stat, num_frames); - num_rapid_changes = calc_num_rapid_changes(frame_recording, event_stat, RAPID_CHANGE_WINDOW); - display_value = mean; - } - else if (mSampleFloatp) - { - const LLTrace::TraceType<LLTrace::SampleAccumulator>& sample_stat = *mSampleFloatp; - - unit_label = mUnitLabel.empty() ? sample_stat.getUnitLabel() : mUnitLabel; - current = last_frame_recording.getLastValue(sample_stat); - min = frame_recording.getPeriodMin(sample_stat, num_frames); - max = frame_recording.getPeriodMax(sample_stat, num_frames); - mean = frame_recording.getPeriodMean(sample_stat, num_frames); - num_rapid_changes = calc_num_rapid_changes(frame_recording, sample_stat, RAPID_CHANGE_WINDOW); - - if (num_rapid_changes / RAPID_CHANGE_WINDOW.value() > MAX_RAPID_CHANGES_PER_SEC) + case STAT_COUNT: { + const LLTrace::TraceType<LLTrace::CountAccumulator>& count_stat = *mStat.countStatp; + + unit_label = std::string(count_stat.getUnitLabel()) + "/s"; + current = last_frame_recording.getPerSec(count_stat); + min = frame_recording.getPeriodMinPerSec(count_stat, num_frames); + max = frame_recording.getPeriodMaxPerSec(count_stat, num_frames); + mean = frame_recording.getPeriodMeanPerSec(count_stat, num_frames); display_value = mean; } - else + break; + case STAT_EVENT: + { + const LLTrace::TraceType<LLTrace::EventAccumulator>& event_stat = *mStat.eventStatp; + + unit_label = mUnitLabel.empty() ? event_stat.getUnitLabel() : mUnitLabel; + current = last_frame_recording.getLastValue(event_stat); + min = frame_recording.getPeriodMin(event_stat, num_frames); + max = frame_recording.getPeriodMax(event_stat, num_frames); + mean = frame_recording.getPeriodMean(event_stat, num_frames); + display_value = mean; + } + break; + case STAT_SAMPLE: { - display_value = current; - // always display current value, don't rate limit - mLastDisplayValue = current; + const LLTrace::TraceType<LLTrace::SampleAccumulator>& sample_stat = *mStat.sampleStatp; + + unit_label = mUnitLabel.empty() ? sample_stat.getUnitLabel() : mUnitLabel; + current = last_frame_recording.getLastValue(sample_stat); + min = frame_recording.getPeriodMin(sample_stat, num_frames); + max = frame_recording.getPeriodMax(sample_stat, num_frames); + mean = frame_recording.getPeriodMean(sample_stat, num_frames); + num_rapid_changes = calc_num_rapid_changes(frame_recording, sample_stat, RAPID_CHANGE_WINDOW); + + if (num_rapid_changes / RAPID_CHANGE_WINDOW.value() > MAX_RAPID_CHANGES_PER_SEC) + { + display_value = mean; + } + else + { + display_value = current; + // always display current value, don't rate limit + mLastDisplayValue = current; + } } + break; + case STAT_MEM: + { + const LLTrace::TraceType<LLTrace::MemStatAccumulator>& mem_stat = *mStat.memStatp; + + unit_label = mUnitLabel.empty() ? mem_stat.getUnitLabel() : mUnitLabel; + current = last_frame_recording.getLastValue(mem_stat).value(); + min = frame_recording.getPeriodMin(mem_stat, num_frames).value(); + max = frame_recording.getPeriodMax(mem_stat, num_frames).value(); + mean = frame_recording.getPeriodMean(mem_stat, num_frames).value(); + display_value = current; + } + break; + default: + break; } LLRect bar_rect; @@ -405,8 +431,7 @@ void LLStatBar::draw() mLastDisplayValue = display_value; - if (mDisplayBar - && (mCountFloatp || mEventFloatp || mSampleFloatp)) + if (mDisplayBar && mStat.valid) { // Draw the tick marks. LLGLSUIDefault gls_ui; @@ -454,52 +479,64 @@ void LLStatBar::draw() ? (bar_rect.getWidth()) : (bar_rect.getHeight()); - if (mDisplayHistory && (mCountFloatp || mEventFloatp || mSampleFloatp)) + if (mDisplayHistory && mStat.valid) { const S32 num_values = frame_recording.getNumRecordedPeriods() - 1; - F32 value = 0; - S32 i; - gGL.color4f( 1.f, 0.f, 0.f, 1.f ); + F32 min_value = 0.f, + max_value = 0.f; + + gGL.color4f(1.f, 0.f, 0.f, 1.f); gGL.begin( LLRender::QUADS ); const S32 max_frame = llmin(num_frames, num_values); U32 num_samples = 0; - for (i = 1; i <= max_frame; i++) + for (S32 i = 1; i <= max_frame; i++) { F32 offset = ((F32)i / (F32)num_frames) * span; LLTrace::Recording& recording = frame_recording.getPrevRecording(i); - if (mCountFloatp) - { - value = recording.getPerSec(*mCountFloatp); - num_samples = recording.getSampleCount(*mCountFloatp); - } - else if (mEventFloatp) + switch(mStatType) { - value = recording.getMean(*mEventFloatp); - num_samples = recording.getSampleCount(*mEventFloatp); + case STAT_COUNT: + min_value = recording.getPerSec(*mStat.countStatp); + max_value = min_value; + num_samples = recording.getSampleCount(*mStat.countStatp); + break; + case STAT_EVENT: + min_value = recording.getMin(*mStat.eventStatp); + max_value = recording.getMax(*mStat.eventStatp); + num_samples = recording.getSampleCount(*mStat.eventStatp); + break; + case STAT_SAMPLE: + min_value = recording.getMin(*mStat.sampleStatp); + max_value = recording.getMax(*mStat.sampleStatp); + num_samples = recording.getSampleCount(*mStat.sampleStatp); + break; + case STAT_MEM: + min_value = recording.getMin(*mStat.memStatp).value(); + max_value = recording.getMax(*mStat.memStatp).value(); + num_samples = 1; + break; + default: + break; } - else if (mSampleFloatp) - { - value = recording.getMean(*mSampleFloatp); - num_samples = recording.getSampleCount(*mSampleFloatp); - } - + if (!num_samples) continue; - F32 begin = (value - mCurMinBar) * value_scale; + F32 min = (min_value - mCurMinBar) * value_scale; + F32 max = llmax(min + 1, (max_value - mCurMinBar) * value_scale); if (mOrientation == HORIZONTAL) { - gGL.vertex2f((F32)bar_rect.mRight - offset, begin + 1); - gGL.vertex2f((F32)bar_rect.mRight - offset, begin); - gGL.vertex2f((F32)bar_rect.mRight - offset - 1, begin); - gGL.vertex2f((F32)bar_rect.mRight - offset - 1, begin + 1); + gGL.vertex2f((F32)bar_rect.mRight - offset, max); + gGL.vertex2f((F32)bar_rect.mRight - offset, min); + gGL.vertex2f((F32)bar_rect.mRight - offset - 1, min); + gGL.vertex2f((F32)bar_rect.mRight - offset - 1, max); } else { - gGL.vertex2f(begin, (F32)bar_rect.mBottom + offset + 1); - gGL.vertex2f(begin, (F32)bar_rect.mBottom + offset); - gGL.vertex2f(begin + 1, (F32)bar_rect.mBottom + offset); - gGL.vertex2f(begin + 1, (F32)bar_rect.mBottom + offset + 1 ); + gGL.vertex2f(min, (F32)bar_rect.mBottom + offset + 1); + gGL.vertex2f(min, (F32)bar_rect.mBottom + offset); + gGL.vertex2f(max, (F32)bar_rect.mBottom + offset); + gGL.vertex2f(max, (F32)bar_rect.mBottom + offset + 1 ); } } gGL.end(); @@ -540,9 +577,32 @@ void LLStatBar::draw() void LLStatBar::setStat(const std::string& stat_name) { - mCountFloatp = LLTrace::TraceType<LLTrace::CountAccumulator>::getInstance(stat_name); - mEventFloatp = LLTrace::TraceType<LLTrace::EventAccumulator>::getInstance(stat_name); - mSampleFloatp = LLTrace::TraceType<LLTrace::SampleAccumulator>::getInstance(stat_name); + using namespace LLTrace; + const TraceType<CountAccumulator>* count_stat; + const TraceType<EventAccumulator>* event_stat; + const TraceType<SampleAccumulator>* sample_stat; + const TraceType<MemStatAccumulator>* mem_stat; + + if ((count_stat = TraceType<CountAccumulator>::getInstance(stat_name))) + { + mStat.countStatp = count_stat; + mStatType = STAT_COUNT; + } + else if ((event_stat = TraceType<EventAccumulator>::getInstance(stat_name))) + { + mStat.eventStatp = event_stat; + mStatType = STAT_EVENT; + } + else if ((sample_stat = TraceType<SampleAccumulator>::getInstance(stat_name))) + { + mStat.sampleStatp = sample_stat; + mStatType = STAT_SAMPLE; + } + else if ((mem_stat = TraceType<MemStatAccumulator>::getInstance(stat_name))) + { + mStat.memStatp = mem_stat; + mStatType = STAT_MEM; + } } @@ -688,6 +748,3 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect ) } } } - - - diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index f311e4a13c..5e9255b9eb 100755 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -93,9 +93,23 @@ private: F32 mLastDisplayValue; LLFrameTimer mLastDisplayValueTimer; - const LLTrace::TraceType<LLTrace::CountAccumulator>* mCountFloatp; - const LLTrace::TraceType<LLTrace::EventAccumulator>* mEventFloatp; - const LLTrace::TraceType<LLTrace::SampleAccumulator>* mSampleFloatp; + enum + { + STAT_NONE, + STAT_COUNT, + STAT_EVENT, + STAT_SAMPLE, + STAT_MEM + } mStatType; + + union + { + void* valid; + const LLTrace::TraceType<LLTrace::CountAccumulator>* countStatp; + const LLTrace::TraceType<LLTrace::EventAccumulator>* eventStatp; + const LLTrace::TraceType<LLTrace::SampleAccumulator>* sampleStatp; + const LLTrace::TraceType<LLTrace::MemStatAccumulator>* memStatp; + } mStat; LLUIString mLabel; std::string mUnitLabel; diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 30658c57bf..47033afea3 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -42,7 +42,6 @@ BOOL LLViewerOctreeDebug::sInDebug = FALSE; static LLTrace::CountStatHandle<S32> sOcclusionQueries("occlusion_queries", "Number of occlusion queries executed"), sNumObjectsOccluded("occluded_objects", "Count of objects being occluded by a query"), sNumObjectsUnoccluded("unoccluded_objects", "Count of objects being unoccluded by a query"); -static LLTrace::SampleStatHandle<S32> sOcclusionQueriesInFlight("occlusion_queries_in_flight", "Number of occlusion queries waiting for results"); //----------------------------------------------------------------------------------- //some global functions definitions @@ -784,6 +783,7 @@ protected: { #if LL_TRACK_PENDING_OCCLUSION_QUERIES LLSpatialGroup::sPendingQueries.erase(name); + #endif llassert(std::find(mAvailableName.begin(), mAvailableName.end(), name) == mAvailableName.end()); mAvailableName.push_back(name); @@ -1095,7 +1095,6 @@ void LLOcclusionCullingGroup::checkOcclusion() #if LL_TRACK_PENDING_OCCLUSION_QUERIES sPendingQueries.erase(mOcclusionQuery[LLViewerCamera::sCurCameraID]); #endif - add(sOcclusionQueriesInFlight, -1); } else if (mOcclusionQuery[LLViewerCamera::sCurCameraID]) { //delete the query to avoid holding onto hundreds of pending queries @@ -1200,7 +1199,6 @@ void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera, const LLVector4a* sh sPendingQueries.insert(mOcclusionQuery[LLViewerCamera::sCurCameraID]); #endif add(sOcclusionQueries, 1); - add(sOcclusionQueriesInFlight, 1); { LL_RECORD_BLOCK_TIME(FTM_PUSH_OCCLUSION_VERTS); diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml index 02d1bf6a0e..fa1823ed67 100755 --- a/indra/newview/skins/default/xui/en/floater_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_stats.xml @@ -75,7 +75,16 @@ label="Object Cache Hit Rate" stat="object_cache_hits" show_history="true"/> - </stat_view> + <stat_bar name="occlusion_queries" + label="Occlusion Queries Performed" + stat="occlusion_queries"/> + <stat_bar name="occluded" + label="Objects Occluded" + stat="occluded_objects"/> + <stat_bar name="unoccluded" + label="Object Unoccluded" + stat="unoccluded_objects"/> + </stat_view> <stat_view name="texture" label="Texture" follows="left|top|right" |