From a74b5dfa923f8eeccc9b786143f0f832de3ad450 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 4 Jun 2013 19:45:33 -0700 Subject: SH-3931 WIP Interesting: Add graphs to visualize scene load metrics fixed mem stat tracking...now properly tracks memory footprint with floating point precision cleaned up macros for unit declaration renamed units to SI standard for 1024 multiples (kibibytes, etc) fixed units output for scene monitor dump --- indra/llcommon/llfasttimer.h | 12 +-- indra/llcommon/lltrace.h | 143 ++++++++++++++++++++++++++---------- indra/llcommon/lltracerecording.cpp | 74 +++++++++++++++++-- indra/llcommon/lltracerecording.h | 36 ++++++--- indra/llcommon/llunit.h | 59 ++++++--------- indra/llimage/llimage.cpp | 12 +-- indra/newview/llscenemonitor.cpp | 16 +++- indra/newview/lltextureview.cpp | 12 +-- indra/newview/llviewerstats.cpp | 8 +- indra/newview/llviewerstats.h | 2 +- indra/newview/llviewertexture.cpp | 8 +- indra/newview/llviewertexture.h | 8 +- indra/newview/llviewerwindow.cpp | 2 +- 13 files changed, 265 insertions(+), 127 deletions(-) diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index 32a0629a87..f329b30472 100644 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -101,14 +101,14 @@ public: void setCollapsed(bool collapsed) { mCollapsed = collapsed; } bool getCollapsed() const { return mCollapsed; } - TraceType& callCount() + TraceType& callCount() { - return static_cast&>(*(TraceType*)this); + return static_cast&>(*(TraceType*)this); } - TraceType& selfTime() + TraceType& selfTime() { - return static_cast&>(*(TraceType*)this); + return static_cast&>(*(TraceType*)this); } static TimeBlock& getRootTimeBlock(); @@ -277,8 +277,6 @@ public: LL_FORCE_INLINE BlockTimer::BlockTimer(TimeBlock& timer) { #if FAST_TIMER_ON - mStartTime = TimeBlock::getCPUClockCount64(); - BlockTimerStackRecord* cur_timer_data = ThreadTimerStack::getIfExists(); TimeBlockAccumulator* accumulator = timer.getPrimaryAccumulator(); accumulator->mActiveCount++; @@ -292,6 +290,8 @@ LL_FORCE_INLINE BlockTimer::BlockTimer(TimeBlock& timer) cur_timer_data->mActiveTimer = this; cur_timer_data->mTimeBlock = &timer; cur_timer_data->mChildTime = 0; + + mStartTime = TimeBlock::getCPUClockCount64(); #endif } diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index 2953e993d4..37196d9f63 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -46,13 +46,13 @@ namespace LLTrace class Recording; typedef LLUnit Bytes; -typedef LLUnit Kilobytes; -typedef LLUnit Megabytes; -typedef LLUnit Gigabytes; +typedef LLUnit Kibibytes; +typedef LLUnit Mibibytes; +typedef LLUnit Gibibytes; typedef LLUnit Bits; -typedef LLUnit Kilobits; -typedef LLUnit Megabits; -typedef LLUnit Gigabits; +typedef LLUnit Kibibits; +typedef LLUnit Mibibits; +typedef LLUnit Gibibits; typedef LLUnit Seconds; typedef LLUnit Milliseconds; @@ -583,14 +583,14 @@ public: typedef LLUnit mean_t; typedef TimeBlockAccumulator self_t; - // fake class that allows us to view call count aspect of timeblock accumulator - struct CallCountAspect + // fake classes that allows us to view different facets of underlying statistic + struct CallCountFacet { typedef U32 value_t; typedef F32 mean_t; }; - struct SelfTimeAspect + struct SelfTimeFacet { typedef LLUnit value_t; typedef LLUnit mean_t; @@ -616,7 +616,7 @@ public: }; template<> -class TraceType +class TraceType : public TraceType { public: @@ -627,7 +627,7 @@ public: }; template<> -class TraceType +class TraceType : public TraceType { public: @@ -725,35 +725,90 @@ struct MemStatAccumulator { typedef MemStatAccumulator self_t; + // fake classes that allows us to view different facets of underlying statistic + struct AllocationCountFacet + { + typedef U32 value_t; + typedef F32 mean_t; + }; + + struct DeallocationCountFacet + { + typedef U32 value_t; + typedef F32 mean_t; + }; + + struct ChildMemFacet + { + typedef LLUnit value_t; + typedef LLUnit mean_t; + }; + MemStatAccumulator() - : mSize(0), - mChildSize(0), - mAllocatedCount(0), + : mAllocatedCount(0), mDeallocatedCount(0) {} - void addSamples(const MemStatAccumulator& other, bool /*append*/) + void addSamples(const MemStatAccumulator& other, bool append) { - mSize += other.mSize; - mChildSize += other.mChildSize; + mSize.addSamples(other.mSize, append); + mChildSize.addSamples(other.mChildSize, append); mAllocatedCount += other.mAllocatedCount; mDeallocatedCount += other.mDeallocatedCount; } void reset(const MemStatAccumulator* other) { - mSize = 0; - mChildSize = 0; + mSize.reset(other ? &other->mSize : NULL); + mChildSize.reset(other ? &other->mChildSize : NULL); mAllocatedCount = 0; mDeallocatedCount = 0; } - void flush() {} + void flush() + { + mSize.flush(); + mChildSize.flush(); + } + + SampleAccumulator mSize, + mChildSize; + int mAllocatedCount, + mDeallocatedCount; +}; + + +template<> +class TraceType +: public TraceType +{ +public: + + TraceType(const char* name, const char* description = "") + : TraceType(name, description) + {} +}; - size_t mSize, - mChildSize; - int mAllocatedCount, - mDeallocatedCount; +template<> +class TraceType +: public TraceType +{ +public: + + TraceType(const char* name, const char* description = "") + : TraceType(name, description) + {} +}; + +template<> +class TraceType + : public TraceType +{ +public: + + TraceType(const char* name, const char* description = "") + : TraceType(name, description) + {} }; class MemStatHandle : public TraceType @@ -765,6 +820,21 @@ public: {} /*virtual*/ const char* getUnitLabel() { return "B"; } + + TraceType& allocationCount() + { + return static_cast&>(*(TraceType*)this); + } + + TraceType& deallocationCount() + { + return static_cast&>(*(TraceType*)this); + } + + TraceType& childMem() + { + return static_cast&>(*(TraceType*)this); + } }; // measures effective memory footprint of specified type @@ -865,7 +935,7 @@ public: MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { - accumulator->mSize += size; + accumulator->mSize.sample(accumulator->mSize.getLastValue() + (F64)size); accumulator->mAllocatedCount++; } @@ -877,7 +947,7 @@ public: MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { - accumulator->mSize -= size; + accumulator->mSize.sample(accumulator->mSize.getLastValue() - (F64)size); accumulator->mAllocatedCount--; accumulator->mDeallocatedCount++; } @@ -889,7 +959,7 @@ public: MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { - accumulator->mSize += size; + accumulator->mSize.sample(accumulator->mSize.getLastValue() + (F64)size); accumulator->mAllocatedCount++; } @@ -901,7 +971,7 @@ public: MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { - accumulator->mSize -= size; + accumulator->mSize.sample(accumulator->mSize.getLastValue() - (F64)size); accumulator->mAllocatedCount--; accumulator->mDeallocatedCount++; } @@ -924,13 +994,13 @@ public: } - void memClaim(size_t size) + void memClaimAmount(size_t size) { MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); mMemFootprint += size; if (accumulator) { - accumulator->mSize += size; + accumulator->mSize.sample(accumulator->mSize.getLastValue() + (F64)size); } } @@ -949,14 +1019,13 @@ public: return value; } - void memDisclaim(size_t size) + void memDisclaimAmount(size_t size) { MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { - accumulator->mSize -= size; + accumulator->mSize.sample(accumulator->mSize.getLastValue() - (F64)size); } - mMemFootprint -= size; } private: @@ -971,7 +1040,7 @@ private: if (accumulator) { size_t footprint = MemFootprint::measure(tracked); - accumulator->mSize += footprint; + accumulator->mSize.sample(accumulator->mSize.getLastValue() + (F64)footprint); tracker.mMemFootprint += footprint; } } @@ -982,7 +1051,7 @@ private: if (accumulator) { size_t footprint = MemFootprint::measure(tracked); - accumulator->mSize -= footprint; + accumulator->mSize.sample(accumulator->mSize.getLastValue() - (F64)footprint); tracker.mMemFootprint -= footprint; } } @@ -996,7 +1065,7 @@ private: MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { - accumulator->mChildSize += MemFootprint::measure(tracked); + accumulator->mChildSize.sample(accumulator->mChildSize.getLastValue() + (F64)MemFootprint::measure(tracked)); } } @@ -1005,7 +1074,7 @@ private: MemStatAccumulator* accumulator = DERIVED::sMemStat.getPrimaryAccumulator(); if (accumulator) { - accumulator->mChildSize -= MemFootprint::measure(tracked); + accumulator->mChildSize.sample(accumulator->mChildSize.getLastValue() - (F64)MemFootprint::measure(tracked)); } } }; diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 61ba21a365..d32504b014 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -213,7 +213,7 @@ LLUnit Recording::getSum(const TraceType Recording::getSum(const TraceType& stat) +LLUnit Recording::getSum(const TraceType& stat) { const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; update(); @@ -221,7 +221,7 @@ LLUnit Recording::getSum(const TraceType& stat) +U32 Recording::getSum(const TraceType& stat) { update(); return mBuffers->mStackTimers[stat.getIndex()].mCalls; @@ -236,7 +236,7 @@ LLUnit Recording::getPerSec(const TraceType Recording::getPerSec(const TraceType& stat) +LLUnit Recording::getPerSec(const TraceType& stat) { const TimeBlockAccumulator& accumulator = mBuffers->mStackTimers[stat.getIndex()]; @@ -245,22 +245,82 @@ LLUnit Recording::getPerSec(const TraceType& stat) +F32 Recording::getPerSec(const TraceType& stat) { update(); return (F32)mBuffers->mStackTimers[stat.getIndex()].mCalls / mElapsedSeconds; } -LLUnit Recording::getSum(const TraceType& stat) +LLUnit Recording::getMin(const TraceType& stat) +{ + update(); + return mBuffers->mMemStats[stat.getIndex()].mSize.getMin(); +} + +LLUnit Recording::getMean(const TraceType& stat) +{ + update(); + return mBuffers->mMemStats[stat.getIndex()].mSize.getMean(); +} + +LLUnit Recording::getMax(const TraceType& stat) +{ + update(); + return mBuffers->mMemStats[stat.getIndex()].mSize.getMax(); +} + +LLUnit Recording::getStandardDeviation(const TraceType& stat) +{ + update(); + return mBuffers->mMemStats[stat.getIndex()].mSize.getStandardDeviation(); +} + +LLUnit Recording::getLastValue(const TraceType& stat) +{ + update(); + return mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue(); +} + +LLUnit Recording::getMin(const TraceType& stat) +{ + update(); + return mBuffers->mMemStats[stat.getIndex()].mChildSize.getMin(); +} + +LLUnit Recording::getMean(const TraceType& stat) +{ + update(); + return mBuffers->mMemStats[stat.getIndex()].mChildSize.getMean(); +} + +LLUnit Recording::getMax(const TraceType& stat) +{ + update(); + return mBuffers->mMemStats[stat.getIndex()].mChildSize.getMax(); +} + +LLUnit Recording::getStandardDeviation(const TraceType& stat) +{ + update(); + return mBuffers->mMemStats[stat.getIndex()].mChildSize.getStandardDeviation(); +} + +LLUnit Recording::getLastValue(const TraceType& stat) +{ + update(); + return mBuffers->mMemStats[stat.getIndex()].mChildSize.getLastValue(); +} + +U32 Recording::getSum(const TraceType& stat) { update(); return mBuffers->mMemStats[stat.getIndex()].mAllocatedCount; } -LLUnit Recording::getPerSec(const TraceType& stat) +U32 Recording::getSum(const TraceType& stat) { update(); - return (F32)mBuffers->mMemStats[stat.getIndex()].mAllocatedCount / mElapsedSeconds; + return mBuffers->mMemStats[stat.getIndex()].mAllocatedCount; } diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index b4452d67a0..4651bfcb61 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -149,16 +149,28 @@ namespace LLTrace // Timer accessors LLUnit getSum(const TraceType& stat); - LLUnit getSum(const TraceType& stat); - U32 getSum(const TraceType& stat); + LLUnit getSum(const TraceType& stat); + U32 getSum(const TraceType& stat); LLUnit getPerSec(const TraceType& stat); - LLUnit getPerSec(const TraceType& stat); - F32 getPerSec(const TraceType& stat); + LLUnit getPerSec(const TraceType& stat); + F32 getPerSec(const TraceType& stat); // Memory accessors - LLUnit getSum(const TraceType& stat); - LLUnit getPerSec(const TraceType& stat); + LLUnit getMin(const TraceType& stat); + LLUnit getMean(const TraceType& stat); + LLUnit getMax(const TraceType& stat); + LLUnit getStandardDeviation(const TraceType& stat); + LLUnit getLastValue(const TraceType& stat); + + LLUnit getMin(const TraceType& stat); + LLUnit getMean(const TraceType& stat); + LLUnit getMax(const TraceType& stat); + LLUnit getStandardDeviation(const TraceType& stat); + LLUnit getLastValue(const TraceType& stat); + + U32 getSum(const TraceType& stat); + U32 getSum(const TraceType& stat); // CountStatHandle accessors F64 getSum(const TraceType& stat); @@ -186,18 +198,18 @@ namespace LLTrace return (T)getMin(static_cast&> (stat)); } - F64 getMax(const TraceType& stat); + F64 getMean(const TraceType& stat); template - T getMax(const SampleStatHandle& stat) + T getMean(SampleStatHandle& stat) { - return (T)getMax(static_cast&> (stat)); + return (T)getMean(static_cast&> (stat)); } - F64 getMean(const TraceType& stat); + F64 getMax(const TraceType& stat); template - T getMean(SampleStatHandle& stat) + T getMax(const SampleStatHandle& stat) { - return (T)getMean(static_cast&> (stat)); + return (T)getMax(static_cast&> (stat)); } F64 getStandardDeviation(const TraceType& stat); diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h index 77c19b5152..a5406fb3f0 100644 --- a/indra/llcommon/llunit.h +++ b/indra/llcommon/llunit.h @@ -34,24 +34,10 @@ namespace LLUnits { -template -struct HighestPrecisionType -{ - typedef T type_t; -}; - -template<> struct HighestPrecisionType { typedef F64 type_t; }; -template<> struct HighestPrecisionType { typedef S64 type_t; }; -template<> struct HighestPrecisionType { typedef S64 type_t; }; -template<> struct HighestPrecisionType { typedef S64 type_t; }; -template<> struct HighestPrecisionType { typedef S64 type_t; }; -template<> struct HighestPrecisionType { typedef S64 type_t; }; -template<> struct HighestPrecisionType { typedef S64 type_t; }; - template struct ConversionFactor { - static typename HighestPrecisionType::type_t get() + static F64 get() { // spurious use of dependent type to stop gcc from triggering the static assertion before instantiating the template llstatic_assert_template(DERIVED_UNITS_TAG, false, "Cannot convert between types."); @@ -61,7 +47,7 @@ struct ConversionFactor template struct ConversionFactor { - static typename HighestPrecisionType::type_t get() + static F64 get() { return 1; } @@ -433,12 +419,6 @@ STORAGE_TYPE rawValue(LLUnit val) { return val.value(); template STORAGE_TYPE rawValue(LLUnitImplicit val) { return val.value(); } -template -struct HighestPrecisionType > -{ - typedef typename HighestPrecisionType::type_t type_t; -}; - #define LL_DECLARE_DERIVED_UNIT(conversion_factor, base_unit_name, unit_name, unit_label) \ struct unit_name \ { \ @@ -448,49 +428,54 @@ struct unit_name template \ struct ConversionFactor \ { \ - static typename HighestPrecisionType::type_t get() \ + static F64 get() \ { \ - return typename HighestPrecisionType::type_t(conversion_factor); \ + return (F64)conversion_factor; \ } \ }; \ \ template \ struct ConversionFactor \ { \ - static typename HighestPrecisionType::type_t get() \ + static F64 get() \ { \ - return typename HighestPrecisionType::type_t(1.0 / (conversion_factor)); \ + return (F64)(1.0 / (conversion_factor)); \ } \ } -struct Bytes { typedef Bytes base_unit_t; static const char* getUnitLabel() { return "B"; }}; -LL_DECLARE_DERIVED_UNIT(1024, Bytes, Kilobytes, "KiB"); -LL_DECLARE_DERIVED_UNIT(1024 * 1024, Bytes, Megabytes, "MiB"); -LL_DECLARE_DERIVED_UNIT(1024 * 1024 * 1024, Bytes, Gigabytes, "GiB"); +#define LL_DECLARE_BASE_UNIT(base_unit_name, unit_label) \ +struct base_unit_name { typedef base_unit_name base_unit_t; static const char* getUnitLabel() { return unit_label; }} + +LL_DECLARE_BASE_UNIT(Bytes, "B"); +LL_DECLARE_DERIVED_UNIT(1024, Bytes, Kibibytes, "KiB"); +LL_DECLARE_DERIVED_UNIT(1024 * 1024, Bytes, Mibibytes, "MiB"); +LL_DECLARE_DERIVED_UNIT(1024 * 1024 * 1024, Bytes, Gibibytes, "GiB"); LL_DECLARE_DERIVED_UNIT(1.0 / 8.0, Bytes, Bits, "b"); -LL_DECLARE_DERIVED_UNIT(1024 / 8, Bytes, Kilobits, "Kib"); -LL_DECLARE_DERIVED_UNIT(1024 / 8, Bytes, Megabits, "Mib"); -LL_DECLARE_DERIVED_UNIT(1024 * 1024 * 1024 / 8, Bytes, Gigabits, "Gib"); +LL_DECLARE_DERIVED_UNIT(1024 / 8, Bytes, Kibibits, "Kib"); +LL_DECLARE_DERIVED_UNIT(1024 / 8, Bytes, Mibibits, "Mib"); +LL_DECLARE_DERIVED_UNIT(1024 * 1024 * 1024 / 8, Bytes, Gibibits, "Gib"); -struct Seconds { typedef Seconds base_unit_t; static const char* getUnitLabel() { return "s"; } }; +LL_DECLARE_BASE_UNIT(Seconds, "s"); LL_DECLARE_DERIVED_UNIT(60, Seconds, Minutes, "min"); LL_DECLARE_DERIVED_UNIT(60 * 60, Seconds, Hours, "h"); LL_DECLARE_DERIVED_UNIT(1.0 / 1000.0, Seconds, Milliseconds, "ms"); LL_DECLARE_DERIVED_UNIT(1.0 / 1000000.0, Seconds, Microseconds, "\x09\x3cs"); LL_DECLARE_DERIVED_UNIT(1.0 / 1000000000.0, Seconds, Nanoseconds, "ns"); -struct Meters { typedef Meters base_unit_t; static const char* getUnitLabel() { return "m"; } }; +LL_DECLARE_BASE_UNIT(Meters, "m"); LL_DECLARE_DERIVED_UNIT(1000, Meters, Kilometers, "km"); LL_DECLARE_DERIVED_UNIT(1.0 / 100.0, Meters, Centimeters, "cm"); LL_DECLARE_DERIVED_UNIT(1.0 / 1000.0, Meters, Millimeters, "mm"); -struct Hertz { typedef Hertz base_unit_t; static const char* getUnitLabel() { return "Hz"; } }; +LL_DECLARE_BASE_UNIT(Hertz, "Hz"); LL_DECLARE_DERIVED_UNIT(1000, Hertz, Kilohertz, "KHz"); LL_DECLARE_DERIVED_UNIT(1000 * 1000, Hertz, Megahertz, "MHz"); LL_DECLARE_DERIVED_UNIT(1000 * 1000 * 1000, Hertz, Gigahertz, "GHz"); -struct Radians { typedef Radians base_unit_t; static const char* getUnitLabel() { return "rad"; } }; +LL_DECLARE_BASE_UNIT(Radians, "rad"); LL_DECLARE_DERIVED_UNIT(DEG_TO_RAD, Radians, Degrees, "deg"); + + } // namespace LLUnits #endif // LL_LLUNIT_H diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index e7e274ff03..80634b3887 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -159,7 +159,7 @@ void LLImageBase::sanityCheck() void LLImageBase::deleteData() { FREE_MEM(sPrivatePoolp, mData) ; - memDisclaim(mDataSize); + memDisclaimAmount(mDataSize); mData = NULL; mDataSize = 0; } @@ -203,7 +203,7 @@ U8* LLImageBase::allocateData(S32 size) mBadBufferAllocation = true ; } mDataSize = size; - memClaim(mDataSize); + memClaimAmount(mDataSize); } return mData; @@ -225,9 +225,9 @@ U8* LLImageBase::reallocateData(S32 size) FREE_MEM(sPrivatePoolp, mData) ; } mData = new_datap; - memDisclaim(mDataSize); + memDisclaimAmount(mDataSize); mDataSize = size; - memClaim(mDataSize); + memClaimAmount(mDataSize); return mData; } @@ -1589,9 +1589,9 @@ static void avg4_colors2(const U8* a, const U8* b, const U8* c, const U8* d, U8* void LLImageBase::setDataAndSize(U8 *data, S32 size) { ll_assert_aligned(data, 16); - memDisclaim(mDataSize); + memDisclaimAmount(mDataSize); mData = data; mDataSize = size; - memClaim(mDataSize); + memClaimAmount(mDataSize); } //static diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp index f7abb982e1..dccf8a2a17 100644 --- a/indra/newview/llscenemonitor.cpp +++ b/indra/newview/llscenemonitor.cpp @@ -554,6 +554,12 @@ void LLSceneMonitor::dumpToFile(std::string file_name) std::ostringstream row; row << it->getName(); + const char* unit_label = it->getUnitLabel(); + if(unit_label[0]) + { + row << "(" << unit_label << ")"; + } + S32 samples = 0; for (S32 frame = 0; frame < frame_count; frame++) @@ -579,6 +585,12 @@ void LLSceneMonitor::dumpToFile(std::string file_name) std::ostringstream row; row << it->getName(); + const char* unit_label = it->getUnitLabel(); + if(unit_label[0]) + { + row << "(" << unit_label << ")"; + } + S32 samples = 0; for (S32 frame = 0; frame < frame_count; frame++) @@ -600,11 +612,11 @@ void LLSceneMonitor::dumpToFile(std::string file_name) it != end_it; ++it) { - os << it->getName(); + os << it->getName() << "(KiB)"; for (S32 frame = 0; frame < frame_count; frame++) { - os << ", " << scene_load_recording.getPrevRecording(frame_count - frame).getSum(*it).value(); + os << ", " << scene_load_recording.getPrevRecording(frame_count - frame).getMax(*it).as().value(); } os << std::endl; diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 7a6351c880..0df7b46b52 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -507,13 +507,13 @@ private: void LLGLTexMemBar::draw() { - LLUnit bound_mem = LLViewerTexture::sBoundTextureMemory; - LLUnit max_bound_mem = LLViewerTexture::sMaxBoundTextureMem; - LLUnit total_mem = LLViewerTexture::sTotalTextureMemory; - LLUnit max_total_mem = LLViewerTexture::sMaxTotalTextureMem; + LLUnit bound_mem = LLViewerTexture::sBoundTextureMemory; + LLUnit max_bound_mem = LLViewerTexture::sMaxBoundTextureMem; + LLUnit total_mem = LLViewerTexture::sTotalTextureMemory; + LLUnit max_total_mem = LLViewerTexture::sMaxTotalTextureMem; F32 discard_bias = LLViewerTexture::sDesiredDiscardBias; - F32 cache_usage = (F32)LLTrace::Megabytes(LLAppViewer::getTextureCache()->getUsage()).value() ; - F32 cache_max_usage = (F32)LLTrace::Megabytes(LLAppViewer::getTextureCache()->getMaxUsage()).value() ; + F32 cache_usage = (F32)LLTrace::Mibibytes(LLAppViewer::getTextureCache()->getUsage()).value() ; + F32 cache_max_usage = (F32)LLTrace::Mibibytes(LLAppViewer::getTextureCache()->getMaxUsage()).value() ; S32 line_height = LLFontGL::getFontMonospace()->getLineHeight(); S32 v_offset = 0;//(S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f); LLUnit total_texture_downloaded = gTotalTextureData; diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 06a53787e7..d29d1ebe5f 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -89,7 +89,7 @@ LLTrace::CountStatHandle<> FPS("framesrendered"), TEX_BAKES("texbakes"), TEX_REBAKES("texrebakes"), NUM_NEW_OBJECTS("numnewobjectsstat"); -LLTrace::CountStatHandle KBIT("kbitstat"), +LLTrace::CountStatHandle KBIT("kbitstat"), LAYERS_KBIT("layerskbitstat"), OBJECT_KBIT("objectkbitstat"), ASSET_KBIT("assetkbitstat"), @@ -552,9 +552,9 @@ void send_stats() LLSD &download = body["downloads"]; - download["world_kbytes"] = LLTrace::Kilobytes(gTotalWorldData).value(); - download["object_kbytes"] = LLTrace::Kilobytes(gTotalObjectData).value(); - download["texture_kbytes"] = LLTrace::Kilobytes(gTotalTextureData).value(); + download["world_kbytes"] = LLTrace::Kibibytes(gTotalWorldData).value(); + download["object_kbytes"] = LLTrace::Kibibytes(gTotalObjectData).value(); + download["texture_kbytes"] = LLTrace::Kibibytes(gTotalTextureData).value(); download["mesh_kbytes"] = LLMeshRepository::sBytesReceived/1024.0; LLSD &in = body["stats"]["net"]["in"]; diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index ca8c347afa..7ad1e5d053 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -94,7 +94,7 @@ extern LLTrace::CountStatHandle<> FPS, NUM_NEW_OBJECTS; -extern LLTrace::CountStatHandle KBIT, +extern LLTrace::CountStatHandle KBIT, LAYERS_KBIT, OBJECT_KBIT, ASSET_KBIT, diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 12835002d3..a3cd2efd66 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -65,8 +65,8 @@ /////////////////////////////////////////////////////////////////////////////// // extern -const LLUnit gMinVideoRam = 32; -const LLUnit gMaxVideoRam = 512; +const LLUnit gMinVideoRam = 32; +const LLUnit gMaxVideoRam = 512; // statics @@ -89,8 +89,8 @@ F32 LLViewerTexture::sDesiredDiscardBias = 0.f; F32 LLViewerTexture::sDesiredDiscardScale = 1.1f; LLUnit LLViewerTexture::sBoundTextureMemory = 0; LLUnit LLViewerTexture::sTotalTextureMemory = 0; -LLUnit LLViewerTexture::sMaxBoundTextureMem = 0; -LLUnit LLViewerTexture::sMaxTotalTextureMem = 0; +LLUnit LLViewerTexture::sMaxBoundTextureMem = 0; +LLUnit LLViewerTexture::sMaxTotalTextureMem = 0; LLUnit LLViewerTexture::sMaxDesiredTextureMem = 0 ; S8 LLViewerTexture::sCameraMovingDiscardBias = 0 ; F32 LLViewerTexture::sCameraMovingBias = 0.0f ; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index d69a0ffb72..ff1aef181b 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -39,8 +39,8 @@ #include #include -extern const LLUnit gMinVideoRam; -extern const LLUnit gMaxVideoRam; +extern const LLUnit gMinVideoRam; +extern const LLUnit gMaxVideoRam; class LLFace; class LLImageGL ; @@ -329,8 +329,8 @@ public: static F32 sDesiredDiscardScale; static LLUnit sBoundTextureMemory; static LLUnit sTotalTextureMemory; - static LLUnit sMaxBoundTextureMem; - static LLUnit sMaxTotalTextureMem; + static LLUnit sMaxBoundTextureMem; + static LLUnit sMaxTotalTextureMem; static LLUnit sMaxDesiredTextureMem ; static S8 sCameraMovingDiscardBias; static F32 sCameraMovingBias; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index ed85667469..9523037b36 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -734,7 +734,7 @@ public: { if(gTotalTextureBytesPerBoostLevel[i] > 0) { - addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, LLUnit(gTotalTextureBytesPerBoostLevel[i]).value())); + addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, LLUnit(gTotalTextureBytesPerBoostLevel[i]).value())); ypos += y_inc; } } -- cgit v1.2.3