chg: pass --no-profile to disable profiling when starting hg serve
authorKyle Lippincott <spectral@google.com>
Fri, 16 Apr 2021 16:21:26 -0700
changeset 47024 8fcc0a829f3d
parent 47023 a2bf93ab3014
child 47025 124fe94016c0
chg: pass --no-profile to disable profiling when starting hg serve If profiling is enabled via global/user config (as far as I can tell, this doesn't affect use of the --profile flag, but it probably does affect --config profiling.enabled=1), then the profiling data can be *cumulative* for the lifetime of the chg process. This leads to some "interesting" results where hg claims the walltime is something like 200s on a command that took only a second or two to run. Worse, however, is that with at least some profilers (such as the default "stat" profiler), this can cause a large slowdown while generating the profiler output. Differential Revision: https://phab.mercurial-scm.org/D10470
contrib/chg/chg.c
tests/test-blackbox.t
tests/test-chg.t
tests/test-merge-subrepos.t
tests/test-setdiscovery.t
--- a/contrib/chg/chg.c	Fri Apr 16 15:31:05 2021 -0700
+++ b/contrib/chg/chg.c	Fri Apr 16 16:21:26 2021 -0700
@@ -240,13 +240,8 @@
 	const char *hgcmd = gethgcmd();
 
 	const char *baseargv[] = {
-	    hgcmd,
-	    "serve",
-	    "--cmdserver",
-	    "chgunix",
-	    "--address",
-	    opts->initsockname,
-	    "--daemon-postexec",
+	    hgcmd,     "serve",     "--no-profile",     "--cmdserver",
+	    "chgunix", "--address", opts->initsockname, "--daemon-postexec",
 	    "chdir:/",
 	};
 	size_t baseargvsize = sizeof(baseargv) / sizeof(baseargv[0]);
--- a/tests/test-blackbox.t	Fri Apr 16 15:31:05 2021 -0700
+++ b/tests/test-blackbox.t	Fri Apr 16 16:21:26 2021 -0700
@@ -221,7 +221,7 @@
   1970/01/01 00:00:00 bob @6563da9dcf87b1949716e38ff3e3dfaa3198eb06 (5000)> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob)
   1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> exthook-update: echo hooked finished in * seconds (glob)
   1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> update exited 0 after * seconds (glob)
-  1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> serve --cmdserver chgunix --address $TESTTMP.chgsock/server.* --daemon-postexec 'chdir:/' (glob) (chg !)
+  1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> serve --no-profile --cmdserver chgunix --address $TESTTMP.chgsock/server.* --daemon-postexec 'chdir:/' (glob) (chg !)
   1970/01/01 00:00:00 bob @d02f48003e62c24e2659d97d30f2a83abe5d5d51 (5000)> blackbox -l 5
 
 log rotation
--- a/tests/test-chg.t	Fri Apr 16 15:31:05 2021 -0700
+++ b/tests/test-chg.t	Fri Apr 16 16:21:26 2021 -0700
@@ -529,7 +529,7 @@
   > EOF
   Run 1: * samples (glob)
   Run 4: * samples (glob)
-  Run 4 > 3 * Run 1: True
+  Run 4 > 3 * Run 1: False
 (Disabling with --no-profile on the commandline still works, but isn't permanent)
   $ newchg log -r . --no-profile
   $ filteredchg log -r .
--- a/tests/test-merge-subrepos.t	Fri Apr 16 15:31:05 2021 -0700
+++ b/tests/test-merge-subrepos.t	Fri Apr 16 16:21:26 2021 -0700
@@ -61,7 +61,7 @@
   > --config blackbox.track='command commandfinish'
   9bfe45a197d7+ tip
   $ cat .hg/blackbox.log
-  * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> serve --cmdserver chgunix * (glob) (chg !)
+  * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> serve --no-profile --cmdserver chgunix * (glob) (chg !)
   * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* (glob)
   * @9bfe45a197d7b0ab09bf287729dd57e9619c9da5+ (*)> id --config *extensions.blackbox=* --config *blackbox.dirty=True* exited 0 * (glob)
 
--- a/tests/test-setdiscovery.t	Fri Apr 16 15:31:05 2021 -0700
+++ b/tests/test-setdiscovery.t	Fri Apr 16 16:21:26 2021 -0700
@@ -1536,7 +1536,7 @@
   searching for changes
   101 102 103 104 105 106 107 108 109 110  (no-eol)
   $ hg -R r1 --config extensions.blackbox= blackbox --config blackbox.track=
-  * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> serve --cmdserver chgunix * (glob) (chg !)
+  * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> serve --no-profile --cmdserver chgunix * (glob) (chg !)
   * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 outgoing r2 *-T{rev} * --config *extensions.blackbox=* (glob)
   * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> found 101 common and 1 unknown server heads, 1 roundtrips in *.????s (glob)
   * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 outgoing r2 *-T{rev} * --config *extensions.blackbox=* exited 0 after *.?? seconds (glob)