diff options
Diffstat (limited to 'source3/nmbd/nmbd.c')
-rw-r--r-- | source3/nmbd/nmbd.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 5987d70a45..988127e431 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -95,6 +95,25 @@ 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! @@ -682,6 +701,7 @@ 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 ) ); |