summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/api/cli.md31
-rw-r--r--doc/node.112
2 files changed, 43 insertions, 0 deletions
diff --git a/doc/api/cli.md b/doc/api/cli.md
index a2c92b1334..c26177444c 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -75,6 +75,37 @@ $ node --completion-bash > node_bash_completion
$ source node_bash_completion
```
+### `--cpu-prof`
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental
+
+Starts the V8 CPU profiler on start up, and writes the CPU profile to disk
+before exit. If `--cpu-prof-path` is not specified, the profile will be
+written to `${cwd}/CPU.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.cpuprofile`.
+
+```console
+$ node --cpu-prof index.js
+$ ls *.cpuprofile
+CPU.20190409.202950.15293.0.0.cpuprofile
+```
+
+### `--cpu-prof-path`
+<!-- YAML
+added: REPLACEME
+-->
+
+> Stability: 1 - Experimental
+
+Location where the CPU profile generated by `--cpu-prof`
+should be written to. When used alone, it implies `--cpu-prof`.
+
+```console
+$ node --cpu-prof-path /tmp/test.cpuprofile index.js
+```
+
### `--diagnostic-report-directory=directory`
<!-- YAML
added: v11.8.0
diff --git a/doc/node.1 b/doc/node.1
index 3de9a5748c..8387b6282a 100644
--- a/doc/node.1
+++ b/doc/node.1
@@ -78,6 +78,18 @@ Aborting instead of exiting causes a core file to be generated for analysis.
.It Fl -completion-bash
Print source-able bash completion script for Node.js.
.
+.It Fl -cpu-prof
+Start the V8 CPU profiler on start up, and write the CPU profile to disk
+before exit. If
+.Fl -cpu-prof-path
+is not specified, the profile will be written to the current working directory.
+.
+.It Fl -cpu-prof-path
+Path the V8 CPU profile generated with
+.Fl -cpu-prof
+will be written to. When used alone, it implies
+.Fl -cpu-prof
+.
.It Fl -diagnostic-report-directory
Location at which the
.Sy diagnostic report