summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>2007-04-20 01:52:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:32 -0500
commit80576572cc733336d61f33a2d640151393ec977b (patch)
tree65553464dca69939a5f287dd67eebae4f7b6c19c /source3/smbd
parentcd449e610c3b5e4f0d51fedf8cccb706512daac2 (diff)
downloadsamba-80576572cc733336d61f33a2d640151393ec977b.tar.gz
samba-80576572cc733336d61f33a2d640151393ec977b.tar.bz2
samba-80576572cc733336d61f33a2d640151393ec977b.zip
r22395: allow profiling level to be set on startup
(This used to be commit f8f51e8648224af6645dbd0c2f2bffc678b83dac)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/server.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 348d3354d7..f1efcd41e9 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -863,6 +863,7 @@ extern void build_options(BOOL screen);
static BOOL no_process_group = False;
static BOOL log_stdout = False;
static char *ports = NULL;
+ static char *profile_level = NULL;
int opt;
poptContext pc;
@@ -875,6 +876,7 @@ extern void build_options(BOOL screen);
{"log-stdout", 'S', POPT_ARG_VAL, &log_stdout, True, "Log to stdout" },
{"build-options", 'b', POPT_ARG_NONE, NULL, 'b', "Print build options" },
{"port", 'p', POPT_ARG_STRING, &ports, 0, "Listen on the specified ports"},
+ {"profiling-level", 'P', POPT_ARG_STRING, &profile_level, 0, "Set profiling level","PROFILE_LEVEL"},
POPT_COMMON_SAMBA
POPT_COMMON_DYNCONFIG
POPT_TABLEEND
@@ -997,6 +999,14 @@ extern void build_options(BOOL screen);
DEBUG(0,("ERROR: failed to setup profiling\n"));
return -1;
}
+ if (profile_level != NULL) {
+ int pl = atoi(profile_level);
+ struct process_id src;
+
+ DEBUG(1, ("setting profiling level: %s\n",profile_level));
+ src.pid = getpid();
+ set_profile_level(pl, src);
+ }
#endif
DEBUG(3,( "loaded services\n"));