Commit Graph

68 Commits (a455d3ee7d5ddefcdf008fa86ecc7c80aba758aa)

Author SHA1 Message Date
Alexander Gavriliuk 10ef293bc9 BugSplat Crash #1504587: std::vector::empty() 2024-08-15 19:40:23 +02:00
Andrey Lihatskiy 1b68f71348 #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed 2024-04-29 07:56:09 +03:00
Alexander Gavriliuk 57d784f807 SL-18620 Statistics->Advanced->Memory Usage no longer updating 2023-08-24 20:47:26 +02:00
Fawrsk 9e743c99fb Cleanup for loops in llcommon to use C++11 range based for loops 2023-01-07 00:38:12 -04:00
Nat Goodspeed 12f66fda13 DRTVWR-565: Merge branch 'origin/contribute' into DRTVWR-565 2022-12-12 13:27:57 -05:00
Nat Goodspeed 9522a0b7c1 DRTVWR-575: Fix llcommon assumptions that size_t fits in 4 bytes.
It's a little distressing how often we have historically coded S32 or U32 to
pass a length or index.

There are more such assumptions in other viewer subdirectories, but this is a
start.
2022-11-03 14:58:32 -04:00
Andrey Kleshchev fe26a9d32c SL-17868 Crash at ThreadRecorder::bringUpToDate
According to bugsplat get_thread_recorder was null
Replaced apr based LLThreadLocalPointer with thread_local
2022-07-30 02:57:30 +03:00
Ptolemy 8aa22b4165 SL-16606: Add profiler category STATS 2022-01-14 11:50:22 -08:00
Dave Parks 8d20480c5f SL-16148 SL-16244 SL-16270 SL-16253 Remove most BlockTimers, remove LLMemTracked, introduce alignas, hook most/all reamining allocs, disable synchronous occlusion, and convert frequently accessed LLSingletons to LLSimpleton 2021-10-28 18:06:21 +00:00
Nat Goodspeed 9d5b897600 DRTVWR-494: Defend LLInstanceTracker against multi-thread usage.
The previous implementation went to some effort to crash if anyone attempted
to create or destroy an LLInstanceTracker subclass instance during traversal.
That restriction is manageable within a single thread, but becomes unworkable
if it's possible that a given subclass might be used on more than one thread.

Remove LLInstanceTracker::instance_iter, beginInstances(), endInstances(),
also key_iter, beginKeys() and endKeys(). Instead, introduce key_snapshot()
and instance_snapshot(), the only means of iterating over LLInstanceTracker
instances. (These are intended to resemble functions, but in fact the current
implementation simply presents the classes.) Iterating over a captured
snapshot defends against container modifications during traversal. The term
'snapshot' reminds the coder that a new instance created during traversal will
not be considered. To defend against instance deletion during traversal, a
snapshot stores std::weak_ptrs which it lazily dereferences, skipping on the
fly any that have expired.

Dereferencing instance_snapshot::iterator gets you a reference rather than a
pointer. Because some use cases want to delete all existing instances, add an
instance_snapshot::deleteAll() method that extracts the pointer. Those cases
used to require explicitly copying instance pointers into a separate
container; instance_snapshot() now takes care of that. It remains the caller's
responsibility to ensure that all instances of that LLInstanceTracker subclass
were allocated on the heap.

Replace unkeyed static LLInstanceTracker::getInstance(T*) -- which returned
nullptr if that instance had been destroyed -- with new getWeak() method
returning std::weak_ptr<T>. Caller must detect expiration of that weak_ptr.

Adjust tests accordingly.

Use of std::weak_ptr to detect expired instances requires engaging
std::shared_ptr in the constructor. We now store shared_ptrs in the static
containers (std::map for keyed, std::set for unkeyed).

Make LLInstanceTrackerBase a template parameterized on the type of the static
data it manages. For that reason, hoist static data class declarations out of
the class definitions to an LLInstanceTrackerStuff namespace.

Remove the static atomic sIterationNestDepth and its methods incrementDepth(),
decrementDepth() and getDepth(), since they were used only to forbid creation
and destruction during traversal.

Add a std::mutex to static data. Introduce an internal LockStatic class that
locks the mutex while providing a pointer to static data, making that the only
way to access the static data.

The LLINSTANCETRACKER_DTOR_NOEXCEPT macro goes away because we no longer
expect ~LLInstanceTracker() to throw an exception in test programs.
That affects LLTrace::StatBase as well as LLInstanceTracker itself.

Adapt consumers to the new LLInstanceTracker API.
2020-03-25 15:28:17 -04:00
Richard Linden 3040b429a3 added LL_TRACE_ENABLED to allow disabling of lltrace 2014-02-06 11:27:16 -08:00
Richard Linden a712aab616 added some defensive asserts in lltrace to make cases of misuse more obvious when it crashes 2014-01-10 13:56:35 -08:00
Richard Linden 1522c1b3bd SH-4653 FIX Interesting: Viewer crashes while reading chat history
fix for crash on exit resulting from 8c0e024d0c33
2013-12-10 15:48:57 -08:00
Richard Linden 3cb64c5038 SH-4606 FIX Interesting: Small objects do not load until they are very close.
changed culling to use inverse distance to calculate solid angle, not distance squared
2013-12-03 15:52:36 -08:00
Richard Linden ab43be5ddb moved some common functionality from LLTrace::BlockTimerStatHandle to BlockTimer
updates appearance utility dependency
2013-10-23 13:24:47 -07:00
Richard Linden 1dfba44b3d fixed things so that trace recordings can be read from even while active 2013-10-21 14:22:21 -07:00
Richard Linden 1beaedacad moved root timer to global variable
added flag to LLInstanceTracker to allow multiple values per key
made StatType allow multiple values per key to eliminate block timer related crash
2013-10-17 14:23:56 -07:00
Richard Linden 697d2e720b renamed TimeBlock to BlockTimerStatHandle 2013-10-15 20:24:42 -07:00
Richard Linden 1821fa1283 fixed memory tracking of lltrace system 2013-10-03 16:57:15 -07:00
Richard Linden 754e8752a9 added initial memory usage tracking for lltrace 2013-10-03 14:30:34 -07:00
Richard Linden 053d97db1b better memory usage for LLTrace (tighter packing of recording arrays)
removed complicated and unnecessary fast timer gapless handoff logic (it should be gapless anyway)
improved MemTrackable API, better separation of shadow and footprint
added memory usage stats to floater_stats.xml
2013-09-25 19:12:35 -07:00
Richard Linden 72f979135b merge 2013-09-18 14:20:30 -07:00
Richard Linden c6b6ae7a45 merge 2013-09-07 21:54:03 -07:00
Richard Linden 3fd68662f2 added memory usage and occlusion events to traces
renamed "current" to "primary" when referring to accumulators
2013-09-07 21:16:39 -07:00
Richard Linden cbe397ad13 changed fast timer over to using macro
another attempt to move mem stat into base class
2013-09-05 14:04:13 -07:00
Richard Linden 2c6bc5afa5 SH-4433 WIP Interesting: Statistics > Ping Sim is always 0 ms
made getPrimaryAccumulator return a reference since it was an
always non-null pointer
changed unit conversion to perform lazy division in order to avoid truncation
of timer values
2013-08-21 14:06:57 -07:00
Richard Linden e340009fc5 second phase summer cleaning
replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc.
2013-08-09 17:11:19 -07:00
Richard Linden 11e14cd3b0 SH-4299Interesting: High fps shown temporarily off scale in statistics console
various fixes to lltrace
start() on started recording no longer resets
fixed various instances of unit forgetfullness in lltrace
recording split now has gapless timing
scene monitor now guarantees min sample time
renamed a bunch of stats
added names to debug thread view on windows
2013-07-15 11:05:57 -07:00
Richard Linden 04bdc8ba83 SH-4294 FIX Interesting: Statistics Texture cache hit rate is always 0%
also, removed LLTrace::init and cleanup
removed derived class implementation of memory stat for LLMemTrackable
is automatic now
2013-07-01 17:04:01 -07:00
Richard Linden 2fc422f39d fixed memory leak due to implementation of LLThreadLocalSingleton
removed LLThreadLocalSingleton
collapsed all thread recorder classes to single type, LLTrace::ThreadRecorder
moved fasttimer stack head to llthreadlocalsingletonpointer via ThreadRecorder
2013-06-30 13:32:34 -07:00
Richard Linden ffa7123bb5 SH-4299 FIX Interesting: High fps shown temporarily off scale in statistics console
added ability to force uniqueness of LLCopyOnWritePointer
converted more variables to units
added convenience function for unit constants
2013-06-28 20:45:20 -07:00
Richard Linden 808d3eff19 SH-4299 WIP: Interesting: High fps shown temporarily off scale in statistics console
fixed some lltrace logic errors
more consistent syncing of timestamps of sample values in recording stack
selection of primary buffers was completely incorrect
assignment of recordings got wrong play state due to implicit
operator = defined in base class
fixed asset stats only working up to the first send
2013-06-27 00:07:21 -07:00
Richard Linden 8bddaeec66 fixed scene load monitor resetting to eagerly due to spurious camer amotion
pulled swap() out of ui time block
cleaned up internal lltrace dependencies, factored out common accumulator definitions
2013-06-22 12:00:18 -07:00
Richard Linden d136c4c296 SH-4246 FIX interesting: fast timers significantly decreases framerate
removed implicit flushes on reads from recorders for better performance
made sure stack timers were updated on recorder deactivate
faster rendering and better ui for fast timer view
2013-06-18 23:41:53 -07:00
Richard Linden 233201f822 SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
removed unnecessary templates from accumulator types...now always
track data in double precision floating point, using templated accessors to
convert to and from arbitrary types
2013-06-02 22:49:17 -07:00
Richard Linden 9def3590f4 SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
fixed multithreading lltrace causing values to be interpolated towards 0
added Radians unit
improved sceneloadmonitor restart heuristic to use accumulated camera motion
2013-05-31 16:01:46 -07:00
Richard Linden e50e600408 SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
reverted SlaveThreadRecorder update gating
moved processTimes() outside of Recording, so it is called only once per frame
refined sample merge logic so that multi-threaded samples do not stomp on linear history
of a stat
2013-05-30 20:15:48 -07:00
Richard Linden ae35518832 SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
fixed LLTrace::ExtendablePeriodicRecording::extend() to include *all* frame extensions
gated SlaveThreadRecorder pushing to master based on master update rate
reverted changes to LLThreadLocalSingletonPointer to not use offset-from-default trick
2013-05-30 18:30:11 -07:00
Richard Linden 9ae76d1215 SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
fixed copy construction behavior of Recordings to not zero out data
split measurement into event and sample, with sample representing
a continuous function
2013-05-29 17:00:50 -07:00
Richard Linden ab51065357 SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
removed extra dereference for copy on write pointer
moved copyonwrite mechanism to RecordingBuffers from individual buffer
fixed logic that was leaving scene unfrozen when camera moved during metrics gathering
2013-05-20 19:27:50 -07:00
Richard Linden b9c78533ae separated RecordingBuffers from Recording to make active recording stack more safe (part 2) 2013-03-11 01:09:48 -07:00
Richard Linden 1a256eca28 renamed some variables/methods in LLTrace to make things clearer 2013-03-11 00:37:50 -07:00
Richard Linden 2c68d5367c SH-3275 WIP interesting Update viewer metrics system to be more flexible
fixed memory leak
fixed glitching of fast timer display
2013-01-27 21:35:20 -08:00
Richard Linden e975ae35ab SH-3406 WIP convert fast timers to lltrace system
fixed crash on startup
2013-01-18 15:59:16 -08:00
Richard Linden 43a92d01af SH-3406 WIP convert fast timers to lltrace system
fixed some uninitialized variables
root timer accumulator was being initialized to NULL
2013-01-17 20:11:43 -08:00
Richard Linden 486743e77e SH-3406 WIP convert fast timers to lltrace system
improved performance of fast timer stat gathering (fixed typo)
2013-01-14 23:10:02 -08:00
Richard Linden 20b2fa4052 SH-3406 WIP convert fast timers to lltrace system
improved performance of fast timer stat gathering
2013-01-14 23:08:01 -08:00
Richard Linden 6841351502 SH-3468 WIP add memory tracking base class
fix for unit test failures...cleanup apr without destroying
pools, allowing LLProxy to clean itself up as a singleton (and
avoiding spurious dependencies associated with manually destorying
singletons that rely on apr pools)
2013-01-06 21:37:31 -08:00
Richard Linden cda2cdda51 SH-3406 WIP convert fast timers to lltrace system
made fast timer stack thread local
added LLThreadLocalSingleton
made LLThreadLocalPointer obey pointer rules for const
added LLThreadLocalSingletonPointer for fast thread local pointers
2013-01-03 00:30:54 -08:00
Richard Linden 013f04cabe SH-3468 WIP add memory tracking base class
improvements on lifetime of lltrace core data structures
tweaks to thread local pointer handling so that static constructors/destructors
can safely call functions that use lltrace
2012-12-21 00:13:21 -08:00