Commit Graph

70 Commits (8ea7867528cf2c03f2fc60a361663af2a4084bfb)

Author SHA1 Message Date
Andrey Kleshchev 609a26b59a Merge branch 'master' of https://bitbucket.org/lindenlab/viewer/src/master into DRTVWR-515-maint
# Conflicts:
#	autobuild.xml (llca)
#	indra/llwindow/llwindow.h (SL-13507 vs SL-5894)
#	indra/newview/llscenemonitor.cpp (SL-14422)
#	indra/newview/llvovolume.cpp (SL-12069)
2021-02-01 22:28:15 +02:00
Mnikolenko Productengine 9fc3014435 SL-14422 Crash at LLSceneMonitor::dumpToFile 2021-01-27 18:32:41 +02:00
Mnikolenko Productengine 6d84252619 SL-14422 Get rid of using namespace LLTrace 2020-12-02 16:28:45 +02: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
andreykproductengine f8254a9d78 MAINT-7758 Fixed freeze on loading lsl scripts from unicode named windows folder. 2017-08-30 19:57:02 +03:00
Mnikolenko ProductEngine 593d6701d9 MAINT-4857 FIXED Reset scene monitor after completing teleport. 2015-02-05 11:07:44 +02:00
andreykproductengine f69b11691d MAINT-4283 FIXED [BEAR] Viewer always crashes when opening "Scene Loading Monitor" if you closed it previously with the X 2014-07-23 18:29:18 +03:00
andreykproductengine 5ae64755f8 MAINT-4155 FIXED Scene Loading Monitor does not open from menu 2014-07-04 15:47:05 +03:00
Xiaohong Bao dbfb429bd1 fix for SH-4628: Project Interesting Viewer reduces & fixes graphics to lowest settings on a MAC 2013-11-21 15:32:57 -07:00
Richard Linden 5be20dd024 moved SceneLoadingMonitor settings vars (and renamed SceneLoadingPixelDiffThreshold to SceneLoadingMonitorPixelDiffThreshold)
tweaked layout of floater_model_preview.xml
2013-11-13 16:18:59 -08:00
Richard Linden 6ddfc8031c BUILDFIX - miscellaneous stuff missed in the merge 2013-11-12 11:42:06 -08:00
Richard Linden 697d2e720b renamed TimeBlock to BlockTimerStatHandle 2013-10-15 20:24:42 -07:00
Richard Linden 80dfbbaacd merge from viewer-release 2013-10-08 11:59:24 -07:00
Richard Linden 17df8988fe renamed TraceType to StatType
added more MemTrackable types
optimized memory usage of LLTrace some more
2013-10-07 13:38:03 -07:00
Richard Linden 9bae912308 BUILDFIX: old style fast timer use, broken unit test 2013-10-01 17:18:35 -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 f0a642898d SH-4377 FIX: Interesting: Windows viewer crashes when SceneLoadingMonitorEnabled is enabled 2013-08-29 15:25:48 -07:00
Richard Linden bf99887cbb SH-4453 FIX: Interesting: SceneLoadingMonitorEnabled does not work until the camera turns
set enabled flag before calling freeze scene
2013-08-27 19:32:26 -07:00
Richard Linden 8535b87544 removed some unecessary template parameters from LLUnit member functions
forced unit conversion code to inline
unit conversion now no longer converts all the way to base and back, but tries
to find equivalent units as early as possible
fixed another llinfos instance
scene monitor now outputs n/a for invalid samples
2013-08-26 18:00:24 -07:00
Richard Linden 612892b45a SH-4433 WIP: Interesting: Statistics > Ping Sim is always 0 ms
continued conversion to units system
made units perform type promotion correctly and preserve type in arithmetic
e.g. can now do LLVector3 in units
added typedefs for remaining common unit types, including implicits
2013-08-18 22:30:27 -07:00
Richard Linden 9f7bfa1c37 moved unit types out of LLUnits namespace, since they are prefixed 2013-08-15 00:02:23 -07:00
Richard Linden 26581404e4 BUILDFIX: added header for numeric_limits support on gcc
added convenience types for units F32Seconds, etc.
2013-08-14 11:51:49 -07:00
Xiaohong Bao 3059b59b61 Automated merge with http://bitbucket.org/lindenlab/viewer-interesting 2013-07-31 21:43:42 -06:00
Xiaohong Bao d65243063c fix for SH-4290: Running viewer with SceneLoadingMonitorEnabled causes viewer to be unresponsive on login on low end machine 2013-07-31 21:21:58 -06:00
Richard Linden bd5808765f cleanup - renamed valueAs to valueInUnits and made it a symmetrical getter/setter 2013-07-31 19:32:50 -07:00
Richard Linden 4ff19b8f63 removed debug spam
fast timer data now resets on login
2013-07-20 09:41:55 -07:00
Richard Linden e40065f82c BUILDFIX: #include and dependency cleanup 2013-07-19 15:03:05 -07:00
Richard Linden 29930baf23 SH-4299 WIP: Interesting: High fps shown temporarily off scale in statistics console
made unit types work with ostreams
fixed timing of scene monitor recordings to better respect requested time diff
2013-07-17 10:56:47 -07:00
Richard Linden bd078122e3 SH-4299 FIX: Interesting: High fps shown temporarily off scale in statistics console
timing of scene load recording extension now guaranteed > requested time step
removed double add of recorded data
removed spam
2013-07-15 21:00: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 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 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 3fe19d883d SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
scene monitor output is cleaned up, no duplicate first frame, less scientific notation
periodic recording extension now works more cleanly
2013-06-19 20:30:41 -07:00
Richard Linden 3f2de87340 SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
added getAs and setAs to LLUnit to make it clearer how you specify units
removed accidental 0-based indexing of periodicRecording history...
should now be consistently 1-based, with 0 accessing current active recording
removed per frame timer updates of all historical timer bars in fast timer display
added missing assignment operator to recordings
2013-06-17 01:18:21 -07:00
Richard Linden 9fd3af3c38 SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
changed Units macros and argument order to make it more clear
optimized units for integer types
fixed merging of periodicrecordings...should eliminate duplicate entries in sceneloadmonitor history
2013-06-13 15:29:15 -07:00
Richard Linden a74b5dfa92 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
2013-06-04 19:45:33 -07:00
Richard Linden 715385eed7 BUILDFIX: don't multiple define class statics...use inline static method instead 2013-06-04 10:54:12 -07:00
Richard Linden 5b48107dbf SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
added labels to LLUnit types
added memstat dumps to llscenemonitor
2013-06-04 08:33:11 -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 fd21ddd9d0 SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
made recordings auto-update when executing query while active
2013-05-31 23:40:10 -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 174cfa0a7a Automated merge with ssh://hg.lindenlab.com/richard/viewer-interesting/ 2013-05-29 17:03:45 -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
Xiaohong Bao 774544bc51 Automated merge with ssh://hg.lindenlab.com/richard/viewer-interesting 2013-05-23 18:26:14 -06:00
Xiaohong Bao 16616ae48d for SH-4145: Interesting: Implement occlusion culling for object cache 2013-05-23 18:25:21 -06:00
Richard Linden e8daeb177d SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
clean up of llscenemonitor.cpp
2013-05-22 21:19:46 -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 1225a7a3cc SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
further improvements that should eliminate more short duration recording periods
2013-05-20 00:49:57 -07:00
Richard Linden f850ae03b3 SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
fixed copy construction of Recorders, eliminated most zero-length frames
fixed reset behavior of periodic recordings and extendable recordings to clear entire
history
removed busy-loop recording of stats from worker threads...stats reported only when work is done
2013-05-20 00:01:57 -07:00
Richard Linden 12c34dc30f SH-3931 WIP Interesting: Add graphs to visualize scene load metrics
renamed LLView::handleVisibilityChange to onVisibilityChange to reflect
cleaned up scene monitor stats recording, now all trace stats dumped to csv
also fixed extendablerecording, periodicrecording, etc. to properly implement start/stop/etc
2013-05-16 00:53:01 -07:00