param: add "smbd profiling level" option
authorVolker Lendecke <vl@samba.org>
Thu, 9 Oct 2014 12:56:28 +0000 (12:56 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 19 Nov 2014 19:51:37 +0000 (20:51 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
docs-xml/smbdotconf/misc/smbdprofilinglevel.xml [new file with mode: 0644]
lib/param/loadparm.c
lib/param/param_table.c
source3/param/loadparm.c

diff --git a/docs-xml/smbdotconf/misc/smbdprofilinglevel.xml b/docs-xml/smbdotconf/misc/smbdprofilinglevel.xml
new file mode 100644 (file)
index 0000000..d92e5dc
--- /dev/null
@@ -0,0 +1,16 @@
+<samba:parameter name="smbd profiling level"
+                context="G"
+                type="enum"
+                xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+       <para>
+         This parameter allows the administrator to enable profiling support.
+       </para>
+       <para>
+         Possible values are <constant>off</constant>,
+         <constant>count</constant> and <constant>on</constant>.
+       </para>
+</description>
+<value type="default">off</value>
+<value type="example">on</value>
+</samba:parameter>
index b9a3e2081e62a18c22bd318a1ced0d75aa082253..30b11555e3db2d4f7e4837ed4433291333893122 100644 (file)
@@ -2634,6 +2634,8 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
 
        lpcfg_do_global_parameter(lp_ctx, "keepalive", "300");
 
+       lpcfg_do_global_parameter(lp_ctx, "smbd profiling level", "off");
+
        lpcfg_do_global_parameter(lp_ctx, "winbind cache time", "300");
 
        lpcfg_do_global_parameter(lp_ctx, "level2 oplocks", "yes");
index 7a13e6f84a677b4a6c463e09080d8973e5db8af4..5dbcda8f9437ec158f7417486a1190c02ca5d637 100644 (file)
@@ -174,6 +174,10 @@ static const struct enum_list enum_config_backend[] = {
        {-1, NULL}
 };
 
+static const struct enum_list enum_smbd_profiling_level[] = {
+       {0, "off"}, {1, "count"}, {2, "on"}, {-1, NULL}
+};
+
 
 /* ADS kerberos ticket verification options */
 
@@ -1509,6 +1513,15 @@ struct parm_struct parm_table[] = {
                .enum_list      = NULL,
                .flags          = FLAG_ADVANCED,
        },
+       {
+               .label          = "smbd profiling level",
+               .type           = P_ENUM,
+               .p_class        = P_GLOBAL,
+               .offset         = GLOBAL_VAR(smbd_profiling_level),
+               .special        = NULL,
+               .enum_list      = enum_smbd_profiling_level,
+               .flags          = FLAG_ADVANCED,
+       },
        {
                .label          = "profile acls",
                .type           = P_BOOL,
index d6ba8fba1028957da7521ab47944b2d63c5399ab..f246c28fe6377a28e7d318f43fbe3c96f9b6b39c 100644 (file)
@@ -688,6 +688,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
        Globals.passwd_chat_timeout = 2; /* 2 second default. */
        Globals.nt_pipe_support = true; /* Do NT pipes by default. */
        Globals.nt_status_support = true; /* Use NT status by default. */
+       Globals.smbd_profiling_level = 0;
        Globals.stat_cache = true;      /* use stat cache by default */
        Globals.max_stat_cache_size = 256; /* 256k by default */
        Globals.restrict_anonymous = 0;