diff options
author | Oren Hurvitz | 2014-01-16 15:08:45 +0200 |
---|---|---|
committer | Oren Hurvitz | 2014-03-25 08:01:50 +0100 |
commit | 84d7227dfd8fc7e673b3015e2b5495d1752e16a3 (patch) | |
tree | fdacb6bcf75a2090b19d7df43bb036bb795ae9ad /OpenSim/Framework/Servers/ServerBase.cs | |
parent | Added a watchdog to abort slow threads in the main thread pool (diff) | |
download | opensim-SC-84d7227dfd8fc7e673b3015e2b5495d1752e16a3.zip opensim-SC-84d7227dfd8fc7e673b3015e2b5495d1752e16a3.tar.gz opensim-SC-84d7227dfd8fc7e673b3015e2b5495d1752e16a3.tar.bz2 opensim-SC-84d7227dfd8fc7e673b3015e2b5495d1752e16a3.tar.xz |
Changed LogThreadPool to have 4 logging levels. Added console command "debug threadpool level" to set the logging level.
Resolves http://opensimulator.org/mantis/view.php?id=6945
Diffstat (limited to 'OpenSim/Framework/Servers/ServerBase.cs')
-rw-r--r-- | OpenSim/Framework/Servers/ServerBase.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs index c258ff6..fd56587 100644 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs | |||
@@ -279,6 +279,17 @@ namespace OpenSim.Framework.Servers | |||
279 | "debug threadpool status", | 279 | "debug threadpool status", |
280 | "Show current debug threadpool parameters.", | 280 | "Show current debug threadpool parameters.", |
281 | HandleDebugThreadpoolStatus); | 281 | HandleDebugThreadpoolStatus); |
282 | |||
283 | m_console.Commands.AddCommand( | ||
284 | "Debug", false, "debug threadpool level", | ||
285 | "debug threadpool level 0.." + Util.MAX_THREADPOOL_LEVEL, | ||
286 | "Turn on logging of activity in the main thread pool.", | ||
287 | "Log levels:\n" | ||
288 | + " 0 = no logging\n" | ||
289 | + " 1 = only first line of stack trace; don't log common threads\n" | ||
290 | + " 2 = full stack trace; don't log common threads\n" | ||
291 | + " 3 = full stack trace, including common threads\n", | ||
292 | HandleDebugThreadpoolLevel); | ||
282 | 293 | ||
283 | m_console.Commands.AddCommand( | 294 | m_console.Commands.AddCommand( |
284 | "Debug", false, "force gc", | 295 | "Debug", false, "force gc", |
@@ -432,6 +443,33 @@ namespace OpenSim.Framework.Servers | |||
432 | } | 443 | } |
433 | } | 444 | } |
434 | 445 | ||
446 | private static void HandleDebugThreadpoolLevel(string module, string[] cmdparams) | ||
447 | { | ||
448 | if (cmdparams.Length < 4) | ||
449 | { | ||
450 | MainConsole.Instance.Output("Usage: debug threadpool level 0.." + Util.MAX_THREADPOOL_LEVEL); | ||
451 | return; | ||
452 | } | ||
453 | |||
454 | string rawLevel = cmdparams[3]; | ||
455 | int newLevel; | ||
456 | |||
457 | if (!int.TryParse(rawLevel, out newLevel)) | ||
458 | { | ||
459 | MainConsole.Instance.OutputFormat("{0} is not a valid debug level", rawLevel); | ||
460 | return; | ||
461 | } | ||
462 | |||
463 | if (newLevel < 0 || newLevel > Util.MAX_THREADPOOL_LEVEL) | ||
464 | { | ||
465 | MainConsole.Instance.OutputFormat("{0} is outside the valid debug level range of 0.." + Util.MAX_THREADPOOL_LEVEL, newLevel); | ||
466 | return; | ||
467 | } | ||
468 | |||
469 | Util.LogThreadPool = newLevel; | ||
470 | MainConsole.Instance.OutputFormat("LogThreadPool set to {0}", newLevel); | ||
471 | } | ||
472 | |||
435 | private void HandleForceGc(string module, string[] args) | 473 | private void HandleForceGc(string module, string[] args) |
436 | { | 474 | { |
437 | Notice("Manually invoking runtime garbage collection"); | 475 | Notice("Manually invoking runtime garbage collection"); |