diff options
-rwxr-xr-x | indra/llcommon/llfasttimer.cpp | 10 | ||||
-rwxr-xr-x | indra/llcommon/llfasttimer.h | 6 | ||||
-rwxr-xr-x | indra/llcommon/llmemory.cpp | 5 | ||||
-rw-r--r-- | indra/llcommon/lltrace.cpp | 2 | ||||
-rw-r--r-- | indra/llcommon/lltrace.h | 124 | ||||
-rw-r--r-- | indra/llcommon/lltraceaccumulators.cpp | 30 | ||||
-rw-r--r-- | indra/llcommon/lltraceaccumulators.h | 30 | ||||
-rw-r--r-- | indra/llcommon/lltracerecording.cpp | 20 | ||||
-rw-r--r-- | indra/llcommon/lltracerecording.h | 10 | ||||
-rw-r--r-- | indra/llcommon/lltracethreadrecorder.cpp | 14 | ||||
-rwxr-xr-x | indra/llui/llflashtimer.cpp | 20 | ||||
-rwxr-xr-x | indra/newview/llagent.h | 1 | ||||
-rwxr-xr-x | indra/newview/llappviewer.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/llremoteparcelrequest.h | 3 | ||||
-rw-r--r-- | indra/newview/llvieweroctree.cpp | 16 |
15 files changed, 177 insertions, 118 deletions
diff --git a/indra/llcommon/llfasttimer.cpp b/indra/llcommon/llfasttimer.cpp index be240c754a..52b3bb39b2 100755 --- a/indra/llcommon/llfasttimer.cpp +++ b/indra/llcommon/llfasttimer.cpp @@ -189,7 +189,7 @@ void TimeBlock::bootstrapTimerTree() // when this timer was called if (timer.getParent() == &TimeBlock::getRootTimeBlock()) { - TimeBlockAccumulator& accumulator = timer.getPrimaryAccumulator(); + TimeBlockAccumulator& accumulator = timer.getCurrentAccumulator(); if (accumulator.mLastCaller) { @@ -223,7 +223,7 @@ void TimeBlock::incrementalUpdateTimerTree() // skip root timer if (timerp != &TimeBlock::getRootTimeBlock()) { - TimeBlockAccumulator& accumulator = timerp->getPrimaryAccumulator(); + TimeBlockAccumulator& accumulator = timerp->getCurrentAccumulator(); if (accumulator.mMoveUpTree) { @@ -253,7 +253,7 @@ void TimeBlock::updateTimes() U64 cur_time = getCPUClockCount64(); BlockTimer* cur_timer = stack_record->mActiveTimer; - TimeBlockAccumulator* accumulator = &stack_record->mTimeBlock->getPrimaryAccumulator(); + TimeBlockAccumulator* accumulator = &stack_record->mTimeBlock->getCurrentAccumulator(); while(cur_timer && cur_timer->mParentTimerData.mActiveTimer != cur_timer) // root defined by parent pointing to self @@ -269,7 +269,7 @@ void TimeBlock::updateTimes() cur_timer->mBlockStartTotalTimeCounter = accumulator->mTotalTimeCounter; stack_record = &cur_timer->mParentTimerData; - accumulator = &stack_record->mTimeBlock->getPrimaryAccumulator(); + accumulator = &stack_record->mTimeBlock->getCurrentAccumulator(); cur_timer = stack_record->mActiveTimer; stack_record->mChildTime += cumulative_time_delta; @@ -299,7 +299,7 @@ void TimeBlock::processTimes() ++it) { TimeBlock& timer = *it; - TimeBlockAccumulator& accumulator = timer.getPrimaryAccumulator(); + TimeBlockAccumulator& accumulator = timer.getCurrentAccumulator(); accumulator.mLastCaller = NULL; accumulator.mMoveUpTree = false; diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h index e6bf544b51..53c61734e5 100755 --- a/indra/llcommon/llfasttimer.h +++ b/indra/llcommon/llfasttimer.h @@ -285,11 +285,11 @@ LL_FORCE_INLINE BlockTimer::BlockTimer(TimeBlock& timer) #if FAST_TIMER_ON BlockTimerStackRecord* cur_timer_data = LLThreadLocalSingletonPointer<BlockTimerStackRecord>::getInstance(); if (!cur_timer_data) return; - TimeBlockAccumulator& accumulator = timer.getPrimaryAccumulator(); + TimeBlockAccumulator& accumulator = timer.getCurrentAccumulator(); accumulator.mActiveCount++; mBlockStartTotalTimeCounter = accumulator.mTotalTimeCounter; // keep current parent as long as it is active when we are - accumulator.mMoveUpTree |= (accumulator.mParent->getPrimaryAccumulator().mActiveCount == 0); + accumulator.mMoveUpTree |= (accumulator.mParent->getCurrentAccumulator().mActiveCount == 0); // store top of stack mParentTimerData = *cur_timer_data; @@ -309,7 +309,7 @@ LL_FORCE_INLINE BlockTimer::~BlockTimer() BlockTimerStackRecord* cur_timer_data = LLThreadLocalSingletonPointer<BlockTimerStackRecord>::getInstance(); if (!cur_timer_data) return; - TimeBlockAccumulator& accumulator = cur_timer_data->mTimeBlock->getPrimaryAccumulator(); + TimeBlockAccumulator& accumulator = cur_timer_data->mTimeBlock->getCurrentAccumulator(); accumulator.mCalls++; accumulator.mTotalTimeCounter += total_time - (accumulator.mTotalTimeCounter - mBlockStartTotalTimeCounter); diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index cb2f853070..e0b2aa87c2 100755 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -43,12 +43,15 @@ #include "llsys.h" #include "llframetimer.h" +#include "lltrace.h" //---------------------------------------------------------------------------- //static char* LLMemory::reserveMem = 0; U32Kilobytes LLMemory::sAvailPhysicalMemInKB(U32_MAX); U32Kilobytes LLMemory::sMaxPhysicalMemInKB(0); +static LLTrace::SampleStatHandle<F64Megabytes> sAllocatedMem("allocated_mem", "active memory in use by application"); +static LLTrace::SampleStatHandle<F64Megabytes> sVirtualMem("virtual_mem", "virtual memory assigned to application"); U32Kilobytes LLMemory::sAllocatedMemInKB(0); U32Kilobytes LLMemory::sAllocatedPageSizeInKB(0); U32Kilobytes LLMemory::sMaxHeapSizeInKB(U32_MAX); @@ -114,7 +117,9 @@ void LLMemory::updateMemoryInfo() } sAllocatedMemInKB = (U32Bytes)(counters.WorkingSetSize) ; + sample(sAllocatedMem, sAllocatedMemInKB); sAllocatedPageSizeInKB = (U32Bytes)(counters.PagefileUsage) ; + sample(sVirtualMem, sAllocatedPageSizeInKB); U32Kilobytes avail_phys, avail_virtual; LLMemoryInfo::getAvailableMemoryKB(avail_phys, avail_virtual) ; diff --git a/indra/llcommon/lltrace.cpp b/indra/llcommon/lltrace.cpp index 05422f9191..e4a6f4c902 100644 --- a/indra/llcommon/lltrace.cpp +++ b/indra/llcommon/lltrace.cpp @@ -76,7 +76,7 @@ void TimeBlockTreeNode::setParent( TimeBlock* parent ) } mParent = parent; - mBlock->getPrimaryAccumulator().mParent = parent; + mBlock->getCurrentAccumulator().mParent = parent; parent_tree_node->mChildren.push_back(mBlock); parent_tree_node->mNeedsSorting = true; } diff --git a/indra/llcommon/lltrace.h b/indra/llcommon/lltrace.h index afa9933165..472f0b0cf0 100644 --- a/indra/llcommon/lltrace.h +++ b/indra/llcommon/lltrace.h @@ -78,10 +78,10 @@ public: mAccumulatorIndex(AccumulatorBuffer<ACCUMULATOR>::getDefaultBuffer()->reserveSlot()) {} - LL_FORCE_INLINE ACCUMULATOR& getPrimaryAccumulator() const + LL_FORCE_INLINE ACCUMULATOR& getCurrentAccumulator() const { - ACCUMULATOR* accumulator_storage = AccumulatorBuffer<ACCUMULATOR>::getPrimaryStorage(); - return accumulator_storage[mAccumulatorIndex]; + ACCUMULATOR* accumulator_storage = LLThreadLocalSingletonPointer<ACCUMULATOR>::getInstance(); + return accumulator_storage ? accumulator_storage[mAccumulatorIndex] : (*AccumulatorBuffer<ACCUMULATOR>::getDefaultBuffer())[mAccumulatorIndex]; } size_t getIndex() const { return mAccumulatorIndex; } @@ -135,7 +135,7 @@ template<typename T, typename VALUE_T> void record(EventStatHandle<T>& measurement, VALUE_T value) { T converted_value(value); - measurement.getPrimaryAccumulator().record(storage_value(converted_value)); + measurement.getCurrentAccumulator().record(storage_value(converted_value)); } template <typename T = F64> @@ -158,7 +158,22 @@ template<typename T, typename VALUE_T> void sample(SampleStatHandle<T>& measurement, VALUE_T value) { T converted_value(value); - measurement.getPrimaryAccumulator().sample(storage_value(converted_value)); + measurement.getCurrentAccumulator().sample(storage_value(converted_value)); +} + +template<typename T, typename VALUE_T> +void add(SampleStatHandle<T>& measurement, VALUE_T value) +{ + T converted_value(value); + SampleAccumulator& acc = measurement.getCurrentAccumulator(); + if (acc.hasValue()) + { + acc.sample(acc.getLastValue() + converted_value); + } + else + { + acc.sample(converted_value); + } } template <typename T = F64> @@ -181,7 +196,7 @@ template<typename T, typename VALUE_T> void add(CountStatHandle<T>& count, VALUE_T value) { T converted_value(value); - count.getPrimaryAccumulator().add(storage_value(converted_value)); + count.getCurrentAccumulator().add(storage_value(converted_value)); } template<> @@ -207,7 +222,7 @@ public: }; template<> -class TraceType<MemStatAccumulator::ChildMemFacet> +class TraceType<MemStatAccumulator::ShadowMemFacet> : public TraceType<MemStatAccumulator> { public: @@ -225,12 +240,12 @@ public: : trace_t(name) {} - void setName(const char* name) - { - mName = name; - setKey(name); - } - + void setName(const char* name) + { + mName = name; + setKey(name); + } + /*virtual*/ const char* getUnitLabel() const { return "B"; } TraceType<MemStatAccumulator::AllocationCountFacet>& allocationCount() @@ -243,12 +258,51 @@ public: return static_cast<TraceType<MemStatAccumulator::DeallocationCountFacet>&>(*(TraceType<MemStatAccumulator>*)this); } - TraceType<MemStatAccumulator::ChildMemFacet>& childMem() + TraceType<MemStatAccumulator::ShadowMemFacet>& childMem() { - return static_cast<TraceType<MemStatAccumulator::ChildMemFacet>&>(*(TraceType<MemStatAccumulator>*)this); + return static_cast<TraceType<MemStatAccumulator::ShadowMemFacet>&>(*(TraceType<MemStatAccumulator>*)this); } }; +inline void track_alloc(MemStatHandle& measurement, size_t size) +{ + MemStatAccumulator& accumulator = measurement.getCurrentAccumulator(); + accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() + (F64)size : (F64)size); + accumulator.mAllocatedCount++; +} + +inline void track_dealloc(MemStatHandle& measurement, size_t size) +{ + MemStatAccumulator& accumulator = measurement.getCurrentAccumulator(); + accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() - (F64)size : -(F64)size); + accumulator.mAllocatedCount--; + accumulator.mDeallocatedCount++; +} + +inline void claim_mem(MemStatHandle& measurement, size_t size) +{ + MemStatAccumulator& accumulator = measurement.getCurrentAccumulator(); + accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() + (F64)size : (F64)size); +} + +inline void disclaim_mem(MemStatHandle& measurement, size_t size) +{ + MemStatAccumulator& accumulator = measurement.getCurrentAccumulator(); + accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() - (F64)size : -(F64)size); +} + +inline void claim_shadow_mem(MemStatHandle& measurement, size_t size) +{ + MemStatAccumulator& accumulator = measurement.getCurrentAccumulator(); + accumulator.mShadowSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() + (F64)size : (F64)size); +} + +inline void disclaim_shadow_mem(MemStatHandle& measurement, size_t size) +{ + MemStatAccumulator& accumulator = measurement.getCurrentAccumulator(); + accumulator.mShadowSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() - (F64)size : -(F64)size); +} + // measures effective memory footprint of specified type // specialize to cover different types @@ -337,17 +391,16 @@ class MemTrackable public: typedef void mem_trackable_tag_t; - MemTrackable() - { - static bool name_initialized = false; - if (!name_initialized) - { - name_initialized = true; - sMemStat.setName(typeid(DERIVED).name()); - } - } - - + MemTrackable() + { + static bool name_initialized = false; + if (!name_initialized) + { + name_initialized = true; + sMemStat.setName(typeid(DERIVED).name()); + } + } + virtual ~MemTrackable() { memDisclaim(mMemFootprint); @@ -355,9 +408,7 @@ public: void* operator new(size_t size) { - MemStatAccumulator& accumulator = sMemStat.getPrimaryAccumulator(); - accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() + (F64)size : (F64)size); - accumulator.mAllocatedCount++; + track_alloc(sMemStat, size); if (ALIGNMENT == LL_DEFAULT_HEAP_ALIGN) { @@ -379,10 +430,7 @@ public: void operator delete(void* ptr, size_t size) { - MemStatAccumulator& accumulator = sMemStat.getPrimaryAccumulator(); - accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() - (F64)size : -(F64)size); - accumulator.mAllocatedCount--; - accumulator.mDeallocatedCount++; + track_dealloc(sMemStat, size); if (ALIGNMENT == LL_DEFAULT_HEAP_ALIGN) { @@ -404,9 +452,7 @@ public: void *operator new [](size_t size) { - MemStatAccumulator& accumulator = sMemStat.getPrimaryAccumulator(); - accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() + (F64)size : (F64)size); - accumulator.mAllocatedCount++; + track_alloc(sMemStat, size); if (ALIGNMENT == LL_DEFAULT_HEAP_ALIGN) { @@ -472,7 +518,6 @@ public: { MemStatAccumulator& accumulator = sMemStat.getPrimaryAccumulator(); mMemFootprint += (size_t)size; - accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() + (F64)size : (F64)size); return size; } @@ -509,7 +554,7 @@ private: { MemStatAccumulator& accumulator = sMemStat.getPrimaryAccumulator(); size_t footprint = MemFootprint<TRACKED>::measure(tracked); - accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() + (F64)footprint : (F64)footprint); + claim_mem(sMemStat, footprint); tracker.mMemFootprint += footprint; } @@ -517,7 +562,7 @@ private: { MemStatAccumulator& accumulator = sMemStat.getPrimaryAccumulator(); size_t footprint = MemFootprint<TRACKED>::measure(tracked); - accumulator.mSize.sample(accumulator.mSize.hasValue() ? accumulator.mSize.getLastValue() - (F64)footprint : -(F64)footprint); + disclaim_mem(sMemStat, footprint); tracker.mMemFootprint -= footprint; } }; @@ -539,7 +584,6 @@ private: }; }; -// pretty sure typeid of containing class in static object constructor doesn't work in gcc template<typename DERIVED, size_t ALIGNMENT> MemStatHandle MemTrackable<DERIVED, ALIGNMENT>::sMemStat(""); diff --git a/indra/llcommon/lltraceaccumulators.cpp b/indra/llcommon/lltraceaccumulators.cpp index ae769350b9..58d0b5b227 100644 --- a/indra/llcommon/lltraceaccumulators.cpp +++ b/indra/llcommon/lltraceaccumulators.cpp @@ -48,13 +48,13 @@ void AccumulatorBufferGroup::handOffTo(AccumulatorBufferGroup& other) other.mMemStats.reset(&mMemStats); } -void AccumulatorBufferGroup::makePrimary() +void AccumulatorBufferGroup::makeCurrent() { - mCounts.makePrimary(); - mSamples.makePrimary(); - mEvents.makePrimary(); - mStackTimers.makePrimary(); - mMemStats.makePrimary(); + mCounts.makeCurrent(); + mSamples.makeCurrent(); + mEvents.makeCurrent(); + mStackTimers.makeCurrent(); + mMemStats.makeCurrent(); ThreadRecorder* thread_recorder = get_thread_recorder().get(); AccumulatorBuffer<TimeBlockAccumulator>& timer_accumulator_buffer = mStackTimers; @@ -70,18 +70,18 @@ void AccumulatorBufferGroup::makePrimary() } //static -void AccumulatorBufferGroup::clearPrimary() +void AccumulatorBufferGroup::clearCurrent() { - AccumulatorBuffer<CountAccumulator>::clearPrimary(); - AccumulatorBuffer<SampleAccumulator>::clearPrimary(); - AccumulatorBuffer<EventAccumulator>::clearPrimary(); - AccumulatorBuffer<TimeBlockAccumulator>::clearPrimary(); - AccumulatorBuffer<MemStatAccumulator>::clearPrimary(); + AccumulatorBuffer<CountAccumulator>::clearCurrent(); + AccumulatorBuffer<SampleAccumulator>::clearCurrent(); + AccumulatorBuffer<EventAccumulator>::clearCurrent(); + AccumulatorBuffer<TimeBlockAccumulator>::clearCurrent(); + AccumulatorBuffer<MemStatAccumulator>::clearCurrent(); } -bool AccumulatorBufferGroup::isPrimary() const +bool AccumulatorBufferGroup::isCurrent() const { - return mCounts.isPrimary(); + return mCounts.isCurrent(); } void AccumulatorBufferGroup::append( const AccumulatorBufferGroup& other ) @@ -114,7 +114,7 @@ void AccumulatorBufferGroup::reset(AccumulatorBufferGroup* other) void AccumulatorBufferGroup::sync() { - if (isPrimary()) + if (isCurrent()) { F64SecondsImplicit time_stamp = LLTimer::getTotalSeconds(); diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h index 02af480b8a..c5a0693fef 100644 --- a/indra/llcommon/lltraceaccumulators.h +++ b/indra/llcommon/lltraceaccumulators.h @@ -75,7 +75,7 @@ namespace LLTrace ~AccumulatorBuffer() { - if (isPrimary()) + if (isCurrent()) { LLThreadLocalSingletonPointer<ACCUMULATOR>::setInstance(NULL); } @@ -128,27 +128,21 @@ namespace LLTrace } } - void makePrimary() + void makeCurrent() { LLThreadLocalSingletonPointer<ACCUMULATOR>::setInstance(mStorage); } - bool isPrimary() const + bool isCurrent() const { return LLThreadLocalSingletonPointer<ACCUMULATOR>::getInstance() == mStorage; } - static void clearPrimary() + static void clearCurrent() { LLThreadLocalSingletonPointer<ACCUMULATOR>::setInstance(NULL); } - LL_FORCE_INLINE static ACCUMULATOR* getPrimaryStorage() - { - ACCUMULATOR* accumulator = LLThreadLocalSingletonPointer<ACCUMULATOR>::getInstance(); - return accumulator ? accumulator : getDefaultBuffer()->mStorage; - } - // NOTE: this is not thread-safe. We assume that slots are reserved in the main thread before any child threads are spawned size_t reserveSlot() { @@ -491,7 +485,7 @@ namespace LLTrace typedef U32 value_t; }; - struct ChildMemFacet + struct ShadowMemFacet { typedef F64Bytes value_t; }; @@ -504,7 +498,7 @@ namespace LLTrace void addSamples(const MemStatAccumulator& other, EBufferAppendType append_type) { mSize.addSamples(other.mSize, append_type); - mChildSize.addSamples(other.mChildSize, append_type); + mShadowSize.addSamples(other.mShadowSize, append_type); mAllocatedCount += other.mAllocatedCount; mDeallocatedCount += other.mDeallocatedCount; } @@ -512,7 +506,7 @@ namespace LLTrace void reset(const MemStatAccumulator* other) { mSize.reset(other ? &other->mSize : NULL); - mChildSize.reset(other ? &other->mChildSize : NULL); + mShadowSize.reset(other ? &other->mShadowSize : NULL); mAllocatedCount = 0; mDeallocatedCount = 0; } @@ -520,11 +514,11 @@ namespace LLTrace void sync(F64SecondsImplicit time_stamp) { mSize.sync(time_stamp); - mChildSize.sync(time_stamp); + mShadowSize.sync(time_stamp); } SampleAccumulator mSize, - mChildSize; + mShadowSize; int mAllocatedCount, mDeallocatedCount; }; @@ -534,9 +528,9 @@ namespace LLTrace AccumulatorBufferGroup(); void handOffTo(AccumulatorBufferGroup& other); - void makePrimary(); - bool isPrimary() const; - static void clearPrimary(); + void makeCurrent(); + bool isCurrent() const; + static void clearCurrent(); void append(const AccumulatorBufferGroup& other); void merge(const AccumulatorBufferGroup& other); diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index bc98eebf31..c278901bc0 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -193,29 +193,29 @@ F64Bytes Recording::getLastValue(const TraceType<MemStatAccumulator>& stat) return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mSize.getLastValue()); } -F64Bytes Recording::getMin(const TraceType<MemStatAccumulator::ChildMemFacet>& stat) +F64Bytes Recording::getMin(const TraceType<MemStatAccumulator::ShadowMemFacet>& stat) { - return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMin()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mShadowSize.getMin()); } -F64Bytes Recording::getMean(const TraceType<MemStatAccumulator::ChildMemFacet>& stat) +F64Bytes Recording::getMean(const TraceType<MemStatAccumulator::ShadowMemFacet>& stat) { - return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMean()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mShadowSize.getMean()); } -F64Bytes Recording::getMax(const TraceType<MemStatAccumulator::ChildMemFacet>& stat) +F64Bytes Recording::getMax(const TraceType<MemStatAccumulator::ShadowMemFacet>& stat) { - return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getMax()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mShadowSize.getMax()); } -F64Bytes Recording::getStandardDeviation(const TraceType<MemStatAccumulator::ChildMemFacet>& stat) +F64Bytes Recording::getStandardDeviation(const TraceType<MemStatAccumulator::ShadowMemFacet>& stat) { - return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getStandardDeviation()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mShadowSize.getStandardDeviation()); } -F64Bytes Recording::getLastValue(const TraceType<MemStatAccumulator::ChildMemFacet>& stat) +F64Bytes Recording::getLastValue(const TraceType<MemStatAccumulator::ShadowMemFacet>& stat) { - return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mChildSize.getLastValue()); + return F64Bytes(mBuffers->mMemStats[stat.getIndex()].mShadowSize.getLastValue()); } U32 Recording::getSum(const TraceType<MemStatAccumulator::AllocationCountFacet>& stat) diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index ea090e6ee1..9550838798 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -181,11 +181,11 @@ namespace LLTrace F64Bytes getStandardDeviation(const TraceType<MemStatAccumulator>& stat); F64Bytes getLastValue(const TraceType<MemStatAccumulator>& stat); - F64Bytes getMin(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); - F64Bytes getMean(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); - F64Bytes getMax(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); - F64Bytes getStandardDeviation(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); - F64Bytes getLastValue(const TraceType<MemStatAccumulator::ChildMemFacet>& stat); + F64Bytes getMin(const TraceType<MemStatAccumulator::ShadowMemFacet>& stat); + F64Bytes getMean(const TraceType<MemStatAccumulator::ShadowMemFacet>& stat); + F64Bytes getMax(const TraceType<MemStatAccumulator::ShadowMemFacet>& stat); + F64Bytes getStandardDeviation(const TraceType<MemStatAccumulator::ShadowMemFacet>& stat); + F64Bytes getLastValue(const TraceType<MemStatAccumulator::ShadowMemFacet>& stat); U32 getSum(const TraceType<MemStatAccumulator::AllocationCountFacet>& stat); U32 getSum(const TraceType<MemStatAccumulator::DeallocationCountFacet>& stat); diff --git a/indra/llcommon/lltracethreadrecorder.cpp b/indra/llcommon/lltracethreadrecorder.cpp index 4129f1f889..d3d9eb5ca7 100644 --- a/indra/llcommon/lltracethreadrecorder.cpp +++ b/indra/llcommon/lltracethreadrecorder.cpp @@ -69,13 +69,13 @@ void ThreadRecorder::init() tree_node.mBlock = &time_block; tree_node.mParent = &root_time_block; - it->getPrimaryAccumulator().mParent = &root_time_block; + it->getCurrentAccumulator().mParent = &root_time_block; } mRootTimer = new BlockTimer(root_time_block); timer_stack->mActiveTimer = mRootTimer; - TimeBlock::getRootTimeBlock().getPrimaryAccumulator().mActiveCount = 1; + TimeBlock::getRootTimeBlock().getCurrentAccumulator().mActiveCount = 1; } @@ -135,7 +135,7 @@ void ThreadRecorder::activate( AccumulatorBufferGroup* recording, bool from_hand } mActiveRecordings.push_back(active_recording); - mActiveRecordings.back()->mPartialRecording.makePrimary(); + mActiveRecordings.back()->mPartialRecording.makeCurrent(); } ThreadRecorder::active_recording_list_t::reverse_iterator ThreadRecorder::bringUpToDate( AccumulatorBufferGroup* recording ) @@ -186,19 +186,19 @@ void ThreadRecorder::deactivate( AccumulatorBufferGroup* recording ) if (it != mActiveRecordings.rend()) { active_recording_list_t::iterator recording_to_remove = (++it).base(); - bool was_primary = (*recording_to_remove)->mPartialRecording.isPrimary(); + bool was_current = (*recording_to_remove)->mPartialRecording.isCurrent(); llassert((*recording_to_remove)->mTargetRecording == recording); delete *recording_to_remove; mActiveRecordings.erase(recording_to_remove); - if (was_primary) + if (was_current) { if (mActiveRecordings.empty()) { - AccumulatorBufferGroup::clearPrimary(); + AccumulatorBufferGroup::clearCurrent(); } else { - mActiveRecordings.back()->mPartialRecording.makePrimary(); + mActiveRecordings.back()->mPartialRecording.makeCurrent(); } } } diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp index e49628acd5..6d9c429b08 100755 --- a/indra/llui/llflashtimer.cpp +++ b/indra/llui/llflashtimer.cpp @@ -23,29 +23,27 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -#include "../newview/llviewerprecompiledheaders.h" - #include "llflashtimer.h" -#include "../newview/llviewercontrol.h" #include "lleventtimer.h" +#include "llui.h" LLFlashTimer::LLFlashTimer(callback_t cb, S32 count, F32 period) - : LLEventTimer(period) - , mCallback(cb) - , mCurrentTickCount(0) - , mIsFlashingInProgress(false) - , mIsCurrentlyHighlighted(false) - , mUnset(false) +: LLEventTimer(period), + mCallback(cb), + mCurrentTickCount(0), + mIsFlashingInProgress(false), + mIsCurrentlyHighlighted(false), + mUnset(false) { mEventTimer.stop(); // By default use settings from settings.xml to be able change them via Debug settings. See EXT-5973. // Due to Timer is implemented as derived class from EventTimer it is impossible to change period // in runtime. So, both settings are made as required restart. - mFlashCount = 2 * ((count > 0) ? count : gSavedSettings.getS32("FlashCount")); + mFlashCount = 2 * ((count > 0) ? count : LLUI::sSettingGroups["config"]->getS32("FlashCount")); if (mPeriod <= 0) { - mPeriod = gSavedSettings.getF32("FlashPeriod"); + mPeriod = LLUI::sSettingGroups["config"]->getF32("FlashPeriod"); } } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 093a65682a..8e9a1dd40a 100755 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -34,6 +34,7 @@ #include "llcoordframe.h" // for mFrameAgent #include "llavatarappearancedefines.h" #include "llpermissionsflags.h" +#include "v3dmath.h" #include <boost/function.hpp> #include <boost/shared_ptr.hpp> diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 8f41f75c7d..337ce22eac 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1226,8 +1226,8 @@ void LLAppViewer::checkMemory() } mMemCheckTimer.reset() ; - //update the availability of memory - LLMemory::updateMemoryInfo() ; + //update the availability of memory + LLMemory::updateMemoryInfo() ; bool is_low = LLMemory::isMemoryPoolLow() ; diff --git a/indra/newview/llremoteparcelrequest.h b/indra/newview/llremoteparcelrequest.h index b87056573b..e4b8791f7c 100755 --- a/indra/newview/llremoteparcelrequest.h +++ b/indra/newview/llremoteparcelrequest.h @@ -30,7 +30,8 @@ #define LL_LLREMOTEPARCELREQUEST_H #include "llhttpclient.h" -#include "llpanel.h" +#include "llhandle.h" +#include "llsingleton.h" class LLMessageSystem; class LLRemoteParcelInfoObserver; diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 2457f15b50..30658c57bf 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -39,6 +39,11 @@ U32 LLViewerOctreeEntryData::sCurVisible = 0; 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 //----------------------------------------------------------------------------------- @@ -921,6 +926,10 @@ void LLOcclusionCullingGroup::setOcclusionState(U32 state, S32 mode) } else { + if (state & OCCLUDED) + { + add(sNumObjectsOccluded, 1); + } mOcclusionState[LLViewerCamera::sCurCameraID] |= state; if ((state & DISCARD_QUERY) && mOcclusionQuery[LLViewerCamera::sCurCameraID]) { @@ -979,6 +988,10 @@ void LLOcclusionCullingGroup::clearOcclusionState(U32 state, S32 mode) } else { + if (state & OCCLUDED) + { + add(sNumObjectsUnoccluded, 1); + } mOcclusionState[LLViewerCamera::sCurCameraID] &= ~state; } } @@ -1082,6 +1095,7 @@ 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 @@ -1185,6 +1199,8 @@ void LLOcclusionCullingGroup::doOcclusion(LLCamera* camera, const LLVector4a* sh #if LL_TRACK_PENDING_OCCLUSION_QUERIES sPendingQueries.insert(mOcclusionQuery[LLViewerCamera::sCurCameraID]); #endif + add(sOcclusionQueries, 1); + add(sOcclusionQueriesInFlight, 1); { LL_RECORD_BLOCK_TIME(FTM_PUSH_OCCLUSION_VERTS); |