diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Servers/ServerBase.cs | 21 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 16 | ||||
-rw-r--r-- | prebuild.xml | 1 |
3 files changed, 37 insertions, 1 deletions
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index fd56587..379e224 100644 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Diagnostics; | 30 | using System.Diagnostics; |
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Linq; | ||
32 | using System.Reflection; | 33 | using System.Reflection; |
33 | using System.Text; | 34 | using System.Text; |
34 | using System.Text.RegularExpressions; | 35 | using System.Text.RegularExpressions; |
@@ -292,6 +293,12 @@ namespace OpenSim.Framework.Servers | |||
292 | HandleDebugThreadpoolLevel); | 293 | HandleDebugThreadpoolLevel); |
293 | 294 | ||
294 | m_console.Commands.AddCommand( | 295 | m_console.Commands.AddCommand( |
296 | "Debug", false, "show threadpool calls", | ||
297 | "show threadpool calls", | ||
298 | "Show the number of labelled threadpool calls.", | ||
299 | HandleShowThreadpoolCalls); | ||
300 | |||
301 | m_console.Commands.AddCommand( | ||
295 | "Debug", false, "force gc", | 302 | "Debug", false, "force gc", |
296 | "force gc", | 303 | "force gc", |
297 | "Manually invoke runtime garbage collection. For debugging purposes", | 304 | "Manually invoke runtime garbage collection. For debugging purposes", |
@@ -354,6 +361,20 @@ namespace OpenSim.Framework.Servers | |||
354 | Notice("serialosdreq is now {0}", setSerializeOsdRequests); | 361 | Notice("serialosdreq is now {0}", setSerializeOsdRequests); |
355 | } | 362 | } |
356 | 363 | ||
364 | private void HandleShowThreadpoolCalls(string module, string[] args) | ||
365 | { | ||
366 | List<KeyValuePair<string, int>> calls = Util.GetFireAndForgetCallsMade().ToList(); | ||
367 | calls.Sort((kvp1, kvp2) => kvp2.Value.CompareTo(kvp1.Value)); | ||
368 | |||
369 | ConsoleDisplayList cdl = new ConsoleDisplayList(); | ||
370 | foreach (KeyValuePair<string, int> kvp in calls) | ||
371 | { | ||
372 | cdl.AddRow(kvp.Key, kvp.Value); | ||
373 | } | ||
374 | |||
375 | MainConsole.Instance.Output(cdl.ToString()); | ||
376 | } | ||
377 | |||
357 | private void HandleDebugThreadpoolStatus(string module, string[] args) | 378 | private void HandleDebugThreadpoolStatus(string module, string[] args) |
358 | { | 379 | { |
359 | int workerThreads, iocpThreads; | 380 | int workerThreads, iocpThreads; |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index fefa050..53bbb06 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -2086,14 +2086,28 @@ namespace OpenSim.Framework | |||
2086 | } | 2086 | } |
2087 | } | 2087 | } |
2088 | 2088 | ||
2089 | public static Dictionary<string, int> GetFireAndForgetCallsMade() | ||
2090 | { | ||
2091 | return new Dictionary<string, int>(m_fireAndForgetCallsMade); | ||
2092 | } | ||
2093 | |||
2094 | private static Dictionary<string, int> m_fireAndForgetCallsMade = new Dictionary<string, int>(); | ||
2089 | 2095 | ||
2090 | public static void FireAndForget(System.Threading.WaitCallback callback, object obj) | 2096 | public static void FireAndForget(System.Threading.WaitCallback callback, object obj) |
2091 | { | 2097 | { |
2092 | FireAndForget(callback, obj, null); | 2098 | FireAndForget(callback, obj, null); |
2093 | } | 2099 | } |
2094 | 2100 | ||
2095 | public static void FireAndForget(System.Threading.WaitCallback callback, object obj, string context) | 2101 | public static void FireAndForget(System.Threading.WaitCallback callback, object obj, string context) |
2096 | { | 2102 | { |
2103 | if (context != null) | ||
2104 | { | ||
2105 | if (!m_fireAndForgetCallsMade.ContainsKey(context)) | ||
2106 | m_fireAndForgetCallsMade[context] = 1; | ||
2107 | else | ||
2108 | m_fireAndForgetCallsMade[context]++; | ||
2109 | } | ||
2110 | |||
2097 | WaitCallback realCallback; | 2111 | WaitCallback realCallback; |
2098 | 2112 | ||
2099 | bool loggingEnabled = LogThreadPool > 0; | 2113 | bool loggingEnabled = LogThreadPool > 0; |
diff --git a/prebuild.xml b/prebuild.xml index ddb6cf0..0addf70 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -390,6 +390,7 @@ | |||
390 | 390 | ||
391 | <ReferencePath>../../../bin/</ReferencePath> | 391 | <ReferencePath>../../../bin/</ReferencePath> |
392 | <Reference name="System"/> | 392 | <Reference name="System"/> |
393 | <Reference name="System.Core"/> | ||
393 | <Reference name="System.Xml"/> | 394 | <Reference name="System.Xml"/> |
394 | <Reference name="OpenSim.Data"/> | 395 | <Reference name="OpenSim.Data"/> |
395 | <Reference name="OpenSim.Framework"/> | 396 | <Reference name="OpenSim.Framework"/> |