aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Hinz <mh.codebro@gmail.com>2015-04-14 17:44:47 +0200
committerMarco Hinz <mh.codebro@gmail.com>2015-11-10 02:49:47 +0100
commit588bf76650d6d645403e70437c649e7759430c05 (patch)
tree59405369f1989d67f00ff3b44253211009367c4c
parent69085113b3c21d2dd41e4bbf1e4dd1b6425feddd (diff)
downloadrneovim-588bf76650d6d645403e70437c649e7759430c05.tar.gz
rneovim-588bf76650d6d645403e70437c649e7759430c05.tar.bz2
rneovim-588bf76650d6d645403e70437c649e7759430c05.zip
Add ":profile dump"
Currently the logfile (":profile start {logfile}") only gets written when Vim exits. This new command allows to dump the log immediately without exiting.
-rw-r--r--runtime/doc/repeat.txt3
-rw-r--r--src/nvim/ex_cmds2.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/runtime/doc/repeat.txt b/runtime/doc/repeat.txt
index 75384832ec..eae2c3867e 100644
--- a/runtime/doc/repeat.txt
+++ b/runtime/doc/repeat.txt
@@ -609,6 +609,9 @@ For example, to profile the one_script.vim script file: >
after this command. A :profile command in the script itself
won't work.
+:prof[ile] dump
+ Don't wait until exiting Vim and write the current state of
+ profiling to the log immediately.
:profd[el] ... *:profd* *:profdel*
Stop profiling for the arguments specified. See |:breakdel|
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 2d8307ee06..46bd8685d9 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -773,6 +773,8 @@ void ex_profile(exarg_T *eap)
profile_set_wait(profile_add(profile_get_wait(), pause_time));
}
do_profiling = PROF_YES;
+ } else if (STRCMP(eap->arg, "dump") == 0) {
+ profile_dump();
} else {
/* The rest is similar to ":breakadd". */
ex_breakadd(eap);
@@ -821,6 +823,7 @@ static char *pexpand_cmds[] = {
"continue",
"func",
"file",
+ "dump",
NULL
};