aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/YEngine/XMREngXmrTestLs.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/YEngine/XMREngXmrTestLs.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/YEngine/XMREngXmrTestLs.cs61
1 files changed, 15 insertions, 46 deletions
diff --git a/OpenSim/Region/ScriptEngine/YEngine/XMREngXmrTestLs.cs b/OpenSim/Region/ScriptEngine/YEngine/XMREngXmrTestLs.cs
index 19ff336..ea306c8 100644
--- a/OpenSim/Region/ScriptEngine/YEngine/XMREngXmrTestLs.cs
+++ b/OpenSim/Region/ScriptEngine/YEngine/XMREngXmrTestLs.cs
@@ -56,9 +56,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
56 string outName = null; 56 string outName = null;
57 XMRInstance[] instances; 57 XMRInstance[] instances;
58 58
59 /* 59 // Decode command line options.
60 * Decode command line options.
61 */
62 for(int i = indx; i < args.Length; i++) 60 for(int i = indx; i < args.Length; i++)
63 { 61 {
64 if(args[i] == "-full") 62 if(args[i] == "-full")
@@ -126,10 +124,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
126 124
127 try 125 try
128 { 126 {
129 127 // Scan instance list to find those that match selection criteria.
130 /*
131 * Scan instance list to find those that match selection criteria.
132 */
133 if(!Monitor.TryEnter(m_InstancesDict, 100)) 128 if(!Monitor.TryEnter(m_InstancesDict, 100))
134 { 129 {
135 m_log.Error("[YEngine]: deadlock m_LockedDict=" + m_LockedDict); 130 m_log.Error("[YEngine]: deadlock m_LockedDict=" + m_LockedDict);
@@ -151,17 +146,13 @@ namespace OpenSim.Region.ScriptEngine.Yengine
151 Monitor.Exit(m_InstancesDict); 146 Monitor.Exit(m_InstancesDict);
152 } 147 }
153 148
154 /* 149 // Maybe sort by descending CPU time.
155 * Maybe sort by descending CPU time.
156 */
157 if(flagTopCPU) 150 if(flagTopCPU)
158 { 151 {
159 Array.Sort<XMRInstance>(instances, CompareInstancesByCPUTime); 152 Array.Sort<XMRInstance>(instances, CompareInstancesByCPUTime);
160 } 153 }
161 154
162 /* 155 // Print the entries.
163 * Print the entries.
164 */
165 if(!flagFull) 156 if(!flagFull)
166 { 157 {
167 outFile.WriteLine(" ItemID" + 158 outFile.WriteLine(" ItemID" +
@@ -176,15 +167,11 @@ namespace OpenSim.Region.ScriptEngine.Yengine
176 outFile.WriteLine(instances[i].RunTestLs(flagFull)); 167 outFile.WriteLine(instances[i].RunTestLs(flagFull));
177 } 168 }
178 169
179 /* 170 // Print number of scripts that match selection criteria,
180 * Print number of scripts that match selection criteria, 171 // even if we were told to print fewer.
181 * even if we were told to print fewer.
182 */
183 outFile.WriteLine("total of {0} script(s)", numScripts); 172 outFile.WriteLine("total of {0} script(s)", numScripts);
184 173
185 /* 174 // If -queues given, print out queue contents too.
186 * If -queues given, print out queue contents too.
187 */
188 if(flagQueues) 175 if(flagQueues)
189 { 176 {
190 LsQueue(outFile, "start", m_StartQueue, args, indx); 177 LsQueue(outFile, "start", m_StartQueue, args, indx);
@@ -204,9 +191,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
204 int numScripts = 0; 191 int numScripts = 0;
205 XMRInstance[] instances; 192 XMRInstance[] instances;
206 193
207 /* 194 // Decode command line options.
208 * Decode command line options.
209 */
210 int i, j; 195 int i, j;
211 List<string> selargs = new List<string>(args.Length); 196 List<string> selargs = new List<string>(args.Length);
212 MethodInfo[] eventmethods = typeof(IEventHandlers).GetMethods(); 197 MethodInfo[] eventmethods = typeof(IEventHandlers).GetMethods();
@@ -271,9 +256,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
271 OpenSim.Region.ScriptEngine.Shared.EventParams eps = 256 OpenSim.Region.ScriptEngine.Shared.EventParams eps =
272 new OpenSim.Region.ScriptEngine.Shared.EventParams(eventname, paramvalues, zeroDetectParams); 257 new OpenSim.Region.ScriptEngine.Shared.EventParams(eventname, paramvalues, zeroDetectParams);
273 258
274 /* 259 // Scan instance list to find those that match selection criteria.
275 * Scan instance list to find those that match selection criteria.
276 */
277 if(!Monitor.TryEnter(m_InstancesDict, 100)) 260 if(!Monitor.TryEnter(m_InstancesDict, 100))
278 { 261 {
279 m_log.Error("[YEngine]: deadlock m_LockedDict=" + m_LockedDict); 262 m_log.Error("[YEngine]: deadlock m_LockedDict=" + m_LockedDict);
@@ -296,9 +279,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
296 Monitor.Exit(m_InstancesDict); 279 Monitor.Exit(m_InstancesDict);
297 } 280 }
298 281
299 /* 282 // Post event to the matching instances.
300 * Post event to the matching instances.
301 */
302 for(i = 0; i < numScripts; i++) 283 for(i = 0; i < numScripts; i++)
303 { 284 {
304 XMRInstance inst = instances[i]; 285 XMRInstance inst = instances[i];
@@ -415,9 +396,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
415 return; 396 return;
416 } 397 }
417 398
418 /* 399 // Decode command line options.
419 * Decode command line options.
420 */
421 for(int i = indx; i < args.Length; i++) 400 for(int i = indx; i < args.Length; i++)
422 { 401 {
423 if(args[i] == "-all") 402 if(args[i] == "-all")
@@ -437,9 +416,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
437 } 416 }
438 } 417 }
439 418
440 /* 419 // Scan instance list to find those that match selection criteria.
441 * Scan instance list to find those that match selection criteria.
442 */
443 if(!Monitor.TryEnter(m_InstancesDict, 100)) 420 if(!Monitor.TryEnter(m_InstancesDict, 100))
444 { 421 {
445 m_log.Error("[YEngine]: deadlock m_LockedDict=" + m_LockedDict); 422 m_log.Error("[YEngine]: deadlock m_LockedDict=" + m_LockedDict);
@@ -462,9 +439,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
462 Monitor.Exit(m_InstancesDict); 439 Monitor.Exit(m_InstancesDict);
463 } 440 }
464 441
465 /* 442 // Reset the instances as if someone clicked their "Reset" button.
466 * Reset the instances as if someone clicked their "Reset" button.
467 */
468 for(int i = 0; i < numScripts; i++) 443 for(int i = 0; i < numScripts; i++)
469 { 444 {
470 XMRInstance inst = instances[i]; 445 XMRInstance inst = instances[i];
@@ -499,10 +474,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
499 { 474 {
500 try 475 try
501 { 476 {
502 477 // Try to print instance name.
503 /*
504 * Try to print instance name.
505 */
506 if(InstanceMatchesArgs(inst, args, indx)) 478 if(InstanceMatchesArgs(inst, args, indx))
507 { 479 {
508 outFile.WriteLine(" " + inst.ItemID.ToString() + " " + inst.m_DescName); 480 outFile.WriteLine(" " + inst.ItemID.ToString() + " " + inst.m_DescName);
@@ -510,10 +482,7 @@ namespace OpenSim.Region.ScriptEngine.Yengine
510 } 482 }
511 catch(Exception e) 483 catch(Exception e)
512 { 484 {
513 485 // Sometimes there are instances in the queue that are disposed.
514 /*
515 * Sometimes there are instances in the queue that are disposed.
516 */
517 outFile.WriteLine(" " + inst.ItemID.ToString() + " " + inst.m_DescName + ": " + e.Message); 486 outFile.WriteLine(" " + inst.ItemID.ToString() + " " + inst.m_DescName + ": " + e.Message);
518 } 487 }
519 } 488 }