Remove duplicate "tallocdump" message from tdb messaging system. The
authorTim Potter <tpot@samba.org>
Mon, 7 Apr 2003 06:13:36 +0000 (06:13 +0000)
committerTim Potter <tpot@samba.org>
Mon, 7 Apr 2003 06:13:36 +0000 (06:13 +0000)
same functionality exists as "pool-usage".

Move initialisation of this and dmalloc messages inside message_init().
(This used to be commit af6ecafcbbf65dbedc49b3a86da39ce608bdadac)

source3/include/messages.h
source3/lib/messages.c
source3/nmbd/nmbd.c
source3/nsswitch/winbindd.c
source3/smbd/server.c
source3/utils/smbcontrol.c

index ce167a772d307bb5d67fa6017990cefb0df462ca..37e9372cdaada42dba7f33f22a4b3cbe96502c86 100644 (file)
 
 #define MSG_SHUTDOWN           13
 
-/* Dump out the talloc useage. */
-#define MSG_REQ_TALLOC_USAGE      14
-#define MSG_TALLOC_USAGE          15
-
 /* nmbd messages */
 #define MSG_FORCE_ELECTION 1001
 #define MSG_WINS_NEW_ENTRY 1002
index c078472880dec455830fc143ab2a9f94e3a28efe..0615cc188377e2a47875c4031fcea124e05c518d 100644 (file)
@@ -111,6 +111,11 @@ BOOL message_init(void)
 
        message_register(MSG_PING, ping_message);
 
+       /* Register some debugging related messages */
+
+       register_msg_pool_usage();
+       register_dmalloc_msgs();
+
        return True;
 }
 
index 013ef9ddb79ae9e76de86cf1065005bbc5f0b7e0..f87ab97798cb882256ef3c0e3e0dfe8b160490dd 100644 (file)
@@ -101,25 +101,6 @@ static void sig_hup(int sig)
        sys_select_signal();
 }
 
-/*******************************************************************
- Print out all talloc memory info.
-********************************************************************/
-
-void return_all_talloc_info(int msg_type, pid_t src_pid, void *buf, size_t len)
-{
-       TALLOC_CTX *ctx = talloc_init("info context");
-       char *info = NULL;
-
-       if (!ctx)
-               return;
-
-       info = talloc_describe_all(ctx);
-       if (info)
-               DEBUG(10,(info));
-       message_send_pid(src_pid, MSG_TALLOC_USAGE, info, info ? strlen(info) + 1 : 0, True);
-       talloc_destroy(ctx);
-}
-
 #if DUMP_CORE
 /**************************************************************************** **
  Prepare to dump a core file - carefully!
@@ -710,7 +691,6 @@ static BOOL open_sockets(BOOL isdaemon, int port)
   message_register(MSG_FORCE_ELECTION, nmbd_message_election);
   message_register(MSG_WINS_NEW_ENTRY, nmbd_wins_new_entry);
   message_register(MSG_SHUTDOWN, nmbd_terminate);
-  message_register(MSG_REQ_TALLOC_USAGE, return_all_talloc_info);
 
   DEBUG( 3, ( "Opening sockets %d\n", global_nmb_port ) );
 
index cd72a4f5721891595424de2bd781072d6587a6b8..5cdddb62228ac1766a6ba185ff535a040b9444e8 100644 (file)
@@ -52,25 +52,6 @@ static BOOL reload_services_file(BOOL test)
        return(ret);
 }
 
-/*******************************************************************
- Print out all talloc memory info.
-********************************************************************/
-
-void return_all_talloc_info(int msg_type, pid_t src_pid, void *buf, size_t len)
-{
-       TALLOC_CTX *ctx = talloc_init("info context");
-       char *info = NULL;
-
-       if (!ctx)
-               return;
-
-       info = talloc_describe_all(ctx);
-       if (info)
-               DEBUG(10,(info));
-       message_send_pid(src_pid, MSG_TALLOC_USAGE, info, info ? strlen(info) + 1: 0, True);
-       talloc_destroy(ctx);
-}
-
 #if DUMP_CORE
 
 /**************************************************************************** **
@@ -916,14 +897,12 @@ int main(int argc, char **argv)
        }
        poptFreeContext(pc);
 
-       register_msg_pool_usage();
-       message_register(MSG_REQ_TALLOC_USAGE, return_all_talloc_info);
-
        /* Loop waiting for requests */
 
        process_loop();
 
        trustdom_cache_shutdown();
        uni_group_cache_shutdown();
+
        return 0;
 }
index ae587ea251e780198ed28b697da913f3bce07852..8ce20c87a431f6b0dbf017eec5bfb46e9e852a67 100644 (file)
@@ -501,25 +501,6 @@ BOOL reload_services(BOOL test)
        return(ret);
 }
 
-/*******************************************************************
- Print out all talloc memory info.
-********************************************************************/
-
-void return_all_talloc_info(int msg_type, pid_t src_pid, void *buf, size_t len)
-{
-       TALLOC_CTX *ctx = talloc_init("info context");
-       char *info = NULL;
-
-       if (!ctx)
-               return;
-
-       info = talloc_describe_all(ctx);
-       if (info)
-               DEBUG(10,(info));
-       message_send_pid(src_pid, MSG_TALLOC_USAGE, info, info ? strlen(info) + 1 : 0, True);
-       talloc_destroy(ctx);
-}
-
 #if DUMP_CORE
 /*******************************************************************
 prepare to dump a core file - carefully!
@@ -821,10 +802,6 @@ static BOOL init_structs(void )
        if (!message_init())
                exit(1);
 
-       register_msg_pool_usage();
-       register_dmalloc_msgs();
-       message_register(MSG_REQ_TALLOC_USAGE, return_all_talloc_info);
-
        if (!print_backend_init())
                exit(1);
 
index ec4f41cad6f34c1ce3b10a89a2121c902f500f64..44b18d57cdb6fde1e18ed6e54c5bdd5c19e76aec 100644 (file)
@@ -43,7 +43,6 @@ static const struct {
        {"dmalloc-log-changed", MSG_REQ_DMALLOC_LOG_CHANGED },
        {"shutdown", MSG_SHUTDOWN },
        {"drvupgrade", MSG_PRINTER_DRVUPGRADE},
-       {"tallocdump", MSG_REQ_TALLOC_USAGE},
        {NULL, -1}
 };
 
@@ -176,7 +175,7 @@ void profilelevel_function(int msg_type, pid_t src, void *buf, size_t len)
  **/
 static void pool_usage_cb(int msg_type, pid_t src_pid, void *buf, size_t len)
 {
-       printf("Got POOL_USAGE reply from pid%u:\n%.*s",
+       printf("Got POOL_USAGE reply from pid %u:\n%.*s",
               (unsigned int) src_pid, (int) len, (const char *) buf);
 }
 
@@ -363,25 +362,6 @@ static BOOL do_command(char *dest, char *msg_name, int iparams, char **params)
                }
                break;
 
-       case MSG_REQ_TALLOC_USAGE:
-               if (!poolusage_registered) {
-                       message_register(MSG_TALLOC_USAGE, tallocdump_function);
-                       poolusage_registered = True;
-               }
-               got_pool = False;
-               retval = send_message(dest, MSG_REQ_TALLOC_USAGE, NULL, 0, True);
-               if (retval) {
-                       timeout_start = time(NULL);
-                       while (!got_pool) {
-                               message_dispatch();
-                               if ((time(NULL) - timeout_start) > MAX_WAIT) {
-                                       fprintf(stderr,"tallocdump timeout\n");
-                                       break;
-                               }
-                       }
-               }
-               break;
-
        case MSG_REQ_DEBUGLEVEL:
                if (!debuglevel_registered) {
                    message_register(MSG_DEBUGLEVEL, debuglevel_function);