summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2002-01-09 08:27:15 +0000
committerMartin Pool <mbp@samba.org>2002-01-09 08:27:15 +0000
commit6c7050ea95001c6de6085f93e3d6332ed2c3aa60 (patch)
tree68e3d6470f8e4243c8f2cdc06ae2b1d9548cad36 /source3/utils
parenta56f0e93ea775ede87de478f9b09de2daa72ca27 (diff)
downloadsamba-6c7050ea95001c6de6085f93e3d6332ed2c3aa60.tar.gz
samba-6c7050ea95001c6de6085f93e3d6332ed2c3aa60.tar.bz2
samba-6c7050ea95001c6de6085f93e3d6332ed2c3aa60.zip
Add two more memory-debug smbcontrol messages: these ones should
prompt dmalloc to log information about what happening, so you can see in flight why smbd is getting bloated. (This used to be commit bcb443c5c4bf97fe6b5b0993e42496c2e64f0124)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/smbcontrol.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/source3/utils/smbcontrol.c b/source3/utils/smbcontrol.c
index f03387c6e0..318e1657cc 100644
--- a/source3/utils/smbcontrol.c
+++ b/source3/utils/smbcontrol.c
@@ -3,7 +3,7 @@
Version 3.0
program to send control messages to Samba processes
Copyright (C) Andrew Tridgell 1994-1998
- Copyright (C) 2001 by Martin Pool
+ Copyright (C) 2001, 2002 by Martin Pool
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -39,6 +39,8 @@ static struct {
{"samsync", MSG_SMB_SAM_SYNC},
{"samrepl", MSG_SMB_SAM_REPL},
{"pool-usage", MSG_REQ_POOL_USAGE },
+ {"dmalloc-mark", MSG_REQ_DMALLOC_MARK },
+ {"dmalloc-log-changed", MSG_REQ_DMALLOC_LOG_CHANGED },
{NULL, -1}
};
@@ -68,7 +70,6 @@ static BOOL got_level;
static BOOL pong_registered = False;
static BOOL debuglevel_registered = False;
static BOOL profilelevel_registered = False;
-static BOOL pool_usage_registered = False;
/**
@@ -216,6 +217,12 @@ static int parse_type(char *mtype)
}
+static void register_all(void)
+{
+ message_register(MSG_POOL_USAGE, pool_usage_cb);
+}
+
+
/****************************************************************************
do command
****************************************************************************/
@@ -404,15 +411,17 @@ static BOOL do_command(char *dest, char *msg_name, int iparams, char **params)
break;
case MSG_REQ_POOL_USAGE:
- if (!pool_usage_registered) {
- message_register(MSG_POOL_USAGE, pool_usage_cb);
- pool_usage_registered = True;
- }
if (!send_message(dest, MSG_REQ_POOL_USAGE, NULL, 0, True))
return False;
wait_for_replies(MAX_WAIT, NULL);
break;
+
+ case MSG_REQ_DMALLOC_LOG_CHANGED:
+ case MSG_REQ_DMALLOC_MARK:
+ if (!send_message(dest, mtype, NULL, 0, False))
+ return False;
+ break;
}
return (True);
@@ -453,6 +462,8 @@ static BOOL do_command(char *dest, char *msg_name, int iparams, char **params)
argc -= optind;
argv = &argv[optind];
+ register_all();
+
if (!interactive) {
if (argc < 2) usage(True);
/* Need to invert sense of return code -- samba