#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
message_register(MSG_PING, ping_message);
+ /* Register some debugging related messages */
+
+ register_msg_pool_usage();
+ register_dmalloc_msgs();
+
return True;
}
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!
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 ) );
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
/**************************************************************************** **
}
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;
}
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!
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);
{"dmalloc-log-changed", MSG_REQ_DMALLOC_LOG_CHANGED },
{"shutdown", MSG_SHUTDOWN },
{"drvupgrade", MSG_PRINTER_DRVUPGRADE},
- {"tallocdump", MSG_REQ_TALLOC_USAGE},
{NULL, -1}
};
**/
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);
}
}
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);