Commit Graph

227 Commits (28e68329b688b34279c5ff403a6f2b23994b452e)

Author SHA1 Message Date
Justin Clark-Casey (justincc) 430000ad24 minor: remove some mono compile warnings in XEngine.cs 2013-02-08 21:29:43 +00:00
Oren Hurvitz 319069d193 Assign the SmartThreadPool name in the constructor
This is required because some threads are created in the constructor, so assigning the name afterwards would be too late.
2013-02-08 21:26:05 +00:00
Justin Clark-Casey (justincc) 9ddddde42e Add "show sensors" command to show script sensor information for debug purposes. 2013-01-25 23:48:59 +00:00
Justin Clark-Casey (justincc) f47f3dd8b9 minor: Fix command match of "debug script" command to "debug scripts" to match other scripts commands (and it's own short help text) 2013-01-25 23:48:31 +00:00
Justin Clark-Casey (justincc) 8ee078c86b minor: Allow "script *" console commands to take multiple script item ids 2013-01-25 23:48:20 +00:00
Justin Clark-Casey (justincc) bc9a7ba0d6 minor: Assign names to the different SmartThreadPools for debugging purposes.
A different approach to the patch in http://opensimulator.org/mantis/view.php?id=6462
that doesn't involve further forking of SmartThreadPool
2013-01-01 23:57:20 +00:00
Justin Clark-Casey (justincc) e6fd8365af Extend default 1 second wait for event completion to other thread script reset (as called by llResetOtherScript()).
As with script stop (via llDie()) aborting other scripts event threads, llResetOtherScript() can also abort any current event thread on another script.
On mono 2.6, 2.10 and possibly later this may cause locking problems in certain code areas.
This commit reuses the recently introduced [XEngine] WaitForEventCompletionOnScriptStop to make this a 1 sec timeout, rather than 0 secs.
2012-12-17 21:37:02 +00:00
Justin Clark-Casey (justincc) 523213060b Add WaitForEventCompletionOnScriptStop [XEngine] config param to OpenSimDefaults.ini to allow change of the wait time for an event to complete on script removal before aborting its thread
Default is 1000, as has previously been the case.
This parameter exists for further debug work concerning mono 2.10 crashes that may be related to locks not being removed on Thread.Abort
2012-12-13 23:21:25 +00:00
Justin Clark-Casey (justincc) 047270bdc8 Add "debug script log" command to allow setting a numeric debug level on individual IScriptInstances for debugging purposes.
Current, state changes and event fires can be logged for individual scripts.
See command help for more details.
2012-12-12 23:13:34 +00:00
Justin Clark-Casey (justincc) 418c0cb01d Add asset id to "show script" and "show scripts" command output to make it easier to extract and inspect the script's asset via "dump asset" 2012-12-12 22:06:09 +00:00
Justin Clark-Casey (justincc) ec765de7e5 Add engine-wide events queued and events processed numbers to output of "xengine status" console command. For debugging purposes. 2012-12-05 23:41:50 +00:00
Justin Clark-Casey (justincc) 5ba99cbf55 Add IScriptInstance.EventsQueued to match EventsProcessed instead of asking callers to lock and directly inspect the EventQueue 2012-12-05 23:33:48 +00:00
Justin Clark-Casey (justincc) 652f4bcb42 For now, sort "show scripts" output in descending order sorted by events processed.
For debug purposes - should later add options to allow different sorting or show only highest 10, etc.
2012-12-05 23:27:50 +00:00
Justin Clark-Casey (justincc) e8df0f1b4c Add IScriptInstance.EventsProcessed stat so that we can record this information and display in "show scripts" for debug purposes 2012-12-05 22:33:46 +00:00
Justin Clark-Casey (justincc) ea786414c2 In XEngine.DoOnRezScript() use Culture.SetCurrentCulture() instead of constructing a new CultureInfo separately 2012-12-05 21:51:08 +00:00
Justin Clark-Casey (justincc) d97440c7cf On XEngine.ProcessEventHandler(), instead of creating a new CultureInfo on every call use the single one set by Culture.SetCurrentCulture()
This is slightly different in that SetCurrentCulture() does not use overridden settings if the system culture matches en-US but some settings there have been changed.
This is what we want - we do not want to use any system overriden settings.
2012-12-05 21:40:28 +00:00
Justin Clark-Casey (justincc) f3a5e3a02b Log initial script startup info notice when xengine actually starts to do this for debugging purposes, rather than before it actually starts to do this. 2012-08-25 00:42:32 +01:00
Justin Clark-Casey (justincc) aede42b875 If a script state save fails for some reason on shutdown/region removal, get xengine to spit out some useful information and continue to save other script states 2012-08-23 23:13:53 +01:00
SignpostMarv ffdde05bb7 constructor means not having to manually refer to individual properties 2012-08-18 18:29:59 +01:00
SignpostMarv 5d7751da89 refactoring for Vector3 operator & constructor tweaks 2012-08-18 13:21:55 +01:00
Justin Clark-Casey (justincc) 0860a0d856 minor: Make xengine debug message on script load a scripting loading message instead.
This is more useful if compilation fails due to an uncatchable exception since we know what was being compiled.
2012-08-17 22:30:01 +01:00
Justin Clark-Casey (justincc) 31304c222d Make SceneManager.OnRegionsReadyStatusChange event available.
This is fired when all regions are ready or when at least one region becomes not ready.
Recently added EventManager.OnRegionReady becomes OnRegionReadyStatusChange to match OnLoginsEnabledStatusChange
2012-07-25 21:00:59 +01:00
Justin Clark-Casey (justincc) 1971b6bb4f Stop the 15 second initial script compile wait if a script is being rezzed on a previously empty region. 2012-07-18 22:24:52 +01:00
Melanie c489bc1cd2 Make the scrpt running flag work properly 2012-07-17 15:00:42 +02:00
Melanie 1c3b0da74a Revert "Fix script "Running" behavior"
A better solution using the already present flags must be found.

This reverts commit 6d3ee8bb39.
2012-07-16 23:31:55 +01:00
Justin Clark-Casey (justincc) 916e3bf886 Where possible, use the system Encoding.ASCII and Encoding.UTF8 rather than constructing fresh copies.
The encodings are thread-safe and already used in such a manner in other places.
This isn't done where Byte Order Mark output is suppressed, since Encoding.UTF8 is constructed to output the BOM.
2012-07-11 22:54:22 +01:00
Justin Clark-Casey (justincc) 33cff9b9d7 Allow XEngine StartDelay to be configured in the [XEngine] config section.
This is only currently meant for use by regression tests that don't have any issues if XEngine is started up quickly, since no other operations will be occuring simultaneously.
Therefore, this is not yet documented externally.
2012-07-11 21:55:18 +01:00
Justin Clark-Casey (justincc) fc24563206 Add regression TestDetachScriptedAttachmentToInventory()
This currently only does a relatively crude check for a ScriptState node in the serialized xml
2012-07-11 21:43:35 +01:00
Justin Clark-Casey (justincc) eb5ec4a786 If a script is being stopped manually, then give the scriptpool thread 1 second to finish normally before forcibly aborting.
This is to avoid the worst of the problems in mono 2.6, 2.10 where an aborted thread does not always release all its locks.
This very short grace period is identical to the existing behaviour when a script is removed from the scene.
2012-07-10 21:42:51 +01:00
Melanie d32cf21576 Add preservation of running state of scripts when drag-copying. 2012-07-01 18:30:59 +01:00
Justin Clark-Casey (justincc) 972b0b52f9 If rest of first line after colon is blank then still warn about running in XEngine if engine specified does not exist.
This is to take account of situations where the user was intending to specify a script engine using colon using its default language.
This probably generates few false positive as scripts are less likely to end a first line colon with a comment for other purposes.
2012-06-28 21:30:36 +01:00
Justin Clark-Casey (justincc) 25baa2d894 Avoid reporting false positives when a colon is in a comment in the first line of a script where the user was not trying to select a different script engine.
This works by only posting the "Selected engine unavailable" message if we're falling back on XEngine and the language is one handled by XEngine.
In cases where the language is not handled or not allowed, the user will still be notified by the later compiler error.
This avoids the overwhelming majority of false positives where the first line contains a : for other reasons (e.g. source control systems, vim settings, etc.)
Ultimately, I think it would be better to detect script language/engine with a mechanism that didn't just rely on : detection (e.g like #! in unix scripts).
2012-06-28 01:01:18 +01:00
Justin Clark-Casey (justincc) f9769a9fcb minor: reuse colon index calculation in XEngine.OnRezScript. The index if a colon is found on the first line will always be the same as for the whole script. 2012-06-28 00:37:23 +01:00
BlueWall 6d3ee8bb39 Fix script "Running" behavior
Unchecking "Running" box in script editor now persists. This fixes http://opensimulator.org/mantis/view.php?id=6057
2012-06-23 04:15:14 -04:00
Justin Clark-Casey (justincc) 80a41e670d Avoid race condition between m_PrimObjects iteration in XEngine.PostObjectEvent and places where the list is modified by extending the m_PrimObjects lock. 2012-06-22 02:23:25 +01:00
Justin Clark-Casey (justincc) 9f3feeff8d If starting scripts on initial sim start, provide INFO level log feedback each time 50 scripts have been started.
This is to provide an indication of what's happening now that the default isn't to report every single script start.
Changes XEngine logging level in OpenSim.exe.config from WARN to INFO.
2012-06-22 02:10:27 +01:00
Justin Clark-Casey (justincc) f907182ab2 Eliminate unnecessary extra call to TriggerEmptyScriptCompileQueue in XEngine.DoOnRezScriptQueue()
The later invocation of this function will happen on an empty compile queue.
2012-06-22 01:57:14 +01:00
Justin Clark-Casey (justincc) 625e5e913a Comment out recently added log message detailing number of scripts started when compile queue empties for now 2012-06-20 00:25:18 +01:00
Justin Clark-Casey (justincc) 881e92a726 Raise some IO associated Exception logging in XEngine to error level, in line with other similar cases.
Remove more unnecessary Close() calls - these are being triggered by the Dispose() called when exiting the using statement for these sdk io objects.
2012-06-20 00:19:50 +01:00
Justin Clark-Casey (justincc) 0fa303b1cf Log how many scripts are candidates for starting and how many are actually started.
Adds DebugLevel infrastructure to XEngine though currently commented out and unused.
2012-06-20 00:10:19 +01:00
Justin Clark-Casey (justincc) ef686ead37 Like the assembly and text files, only write the c#-lsl linemap in XEngine.SetXMLState() if the trust binaries flag is set.
This doesn't affect other locations where the map is written, such as on script compilation.
2012-06-19 02:11:46 +01:00
Justin Clark-Casey (justincc) 8e7032ece8 minor: Add a little more detail to IOException logging in XEngine.SetXMLState()
Also removes superflous Close() commands for statements taking place within using() constructs
Also adds some comment out debug log messages for future use.
2012-06-19 01:53:50 +01:00
Oren Hurvitz 2f398231ac Minor improvements to logging
Eliminated an extra newline in the console if the log line doesn't contain a category (example of a category: "[ASSETS]").
2012-04-24 21:38:09 +01:00
Melanie beb7b8d189 Fix a logic error in app domain creation 2012-04-18 23:23:37 +01:00
Melanie ea73a03553 Don't re-add the assembly resolver for each script if not creating the appdomain 2012-04-18 20:01:41 +01:00
Talun 08e509978d Mantis 55025 Implement script time.
Signed-off-by: nebadon <michael@osgrid.org>
2012-04-12 18:44:00 -07:00
Justin Clark-Casey (justincc) 437f18bc41 Stop console command "xengine status" throwing an exception if there are no scripts in a region.
Addresses http://opensimulator.org/mantis/view.php?id=5940
2012-03-19 21:43:23 +00:00
Justin Clark-Casey (justincc) 9497a7c7bd refactor: separate out console and status report generation parts of XEngine 2012-03-16 03:32:14 +00:00
Justin Clark-Casey (justincc) c386b68373 Aggregate script execution times by linksets rather than individual prims.
This is for the top scripts report.
2012-03-16 01:31:53 +00:00
Justin Clark-Casey (justincc) a4b01ef38a Replace script-lines-per-second with the script execution time scaled by its measurement period and an idealised frame time.
The previous lines-per-second measurement used for top scripts report was inaccurate, since lines executed does not reflect time taken to execute.
Also, every fetch of the report would reset all the numbers limiting its usefulness and we weren't even guaranteed to see the top 100.
The actual measurement value should be script execution time per frame but XEngine does not work this way.
Therefore, we use actual script execution time scaled by the measurement period and an idealised frame time.
This is still not ideal but gives reasonable results and allows scripts to be compared.
This commit moves script execution time calculations from SceneGraph into IScriptModule implementations.
2012-03-16 00:34:30 +00:00