]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add a debug_pool param to fsctl
authorSeven Du <dujinfang@gmail.com>
Sat, 16 Nov 2013 06:17:41 +0000 (14:17 +0800)
committerSeven Du <dujinfang@gmail.com>
Sat, 16 Nov 2013 06:17:59 +0000 (14:17 +0800)
src/include/switch_core.h
src/mod/applications/mod_commands/mod_commands.c
src/switch_core_session.c

index 40f58ef26c42099fdfcd6840c13556d8708bb777..e2c5749e7d430e4a79f76e5d09a1c399eb894ae1 100644 (file)
@@ -2601,6 +2601,7 @@ SWITCH_DECLARE(int) switch_stream_system_fork(const char *cmd, switch_stream_han
 SWITCH_DECLARE(int) switch_stream_system(const char *cmd, switch_stream_handle_t *stream);
 
 SWITCH_DECLARE(switch_call_direction_t) switch_ice_direction(switch_core_session_t *session);
+SWITCH_DECLARE(void) switch_core_session_debug_pool(switch_stream_handle_t *stream);
 
 SWITCH_END_EXTERN_C
 #endif
index 4a3153de5adba783f1bf03e5c5f00302281880c1..4ae58d2212735a09af455afd50cf7ecec9870974 100644 (file)
@@ -2276,6 +2276,9 @@ SWITCH_STANDARD_API(ctl_function)
                        switch_core_session_ctl(command, &arg);
                        stream->write_function(stream, "+OK\n");
 
+               } else if (!strcasecmp(argv[0], "debug_pool")) {
+                       switch_core_session_debug_pool(stream);
+
                } else if (!strcasecmp(argv[0], "debug_sql")) {
                        int x = 0;
                        switch_core_session_ctl(SCSC_DEBUG_SQL, &x);
@@ -6535,6 +6538,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_commands_load)
        switch_console_set_complete("add complete del");
        switch_console_set_complete("add db_cache status");
        switch_console_set_complete("add fsctl debug_level");
+       switch_console_set_complete("add fsctl debug_pool");
        switch_console_set_complete("add fsctl debug_sql");
        switch_console_set_complete("add fsctl last_sps");
        switch_console_set_complete("add fsctl default_dtmf_duration");
index 63aab9d58355a125ba2210f3b56c3c4188383211..0056e2d15570299b9fed7a02bfb241f1b7dc26c8 100644 (file)
@@ -37,6 +37,8 @@
 #include "switch_core.h"
 #include "private/switch_core_pvt.h"
 
+#define DEBUG_THREAD_POOL
+
 struct switch_session_manager session_manager;
 
 SWITCH_DECLARE(void) switch_core_session_set_dmachine(switch_core_session_t *session, switch_ivr_dmachine_t *dmachine, switch_digit_action_target_t target)
@@ -2984,6 +2986,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_refresh_video(switch_core_se
        return SWITCH_STATUS_FALSE;
 }
 
+SWITCH_DECLARE(void) switch_core_session_debug_pool(switch_stream_handle_t *stream)
+{
+       stream->write_function(stream, "Thread pool: running:%d busy:%d popping:%d\n",
+               session_manager.running, session_manager.busy, session_manager.popping);
+}
 
 /* For Emacs:
  * Local Variables: