summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAndreas Madsen <amwebdk@gmail.com>2018-01-31 17:12:09 +0100
committerAnatoli Papirovski <apapirovski@mac.com>2018-03-04 12:07:39 +0100
commit85212bb182f555f6d09e0b2f5f78d2d8e19bcef1 (patch)
tree182b8e0698057e8760462964c0deef66e6ccb34c /doc
parent523d44a66e5a4f9bbe335b7872919aa39d6ee4c4 (diff)
downloadandroid-node-v8-85212bb182f555f6d09e0b2f5f78d2d8e19bcef1.tar.gz
android-node-v8-85212bb182f555f6d09e0b2f5f78d2d8e19bcef1.tar.bz2
android-node-v8-85212bb182f555f6d09e0b2f5f78d2d8e19bcef1.zip
trace_events: add file pattern cli option
Allow the user to specify the filepath for the trace_events log file using a template string. PR-URL: https://github.com/nodejs/node/pull/18480 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/cli.md9
-rw-r--r--doc/api/tracing.md9
-rw-r--r--doc/node.14
3 files changed, 22 insertions, 0 deletions
diff --git a/doc/api/cli.md b/doc/api/cli.md
index 47dcd242a1..9bc997a98a 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -235,6 +235,14 @@ added: v7.7.0
A comma separated list of categories that should be traced when trace event
tracing is enabled using `--trace-events-enabled`.
+### `--trace-event-file-pattern`
+<!-- YAML
+added: REPLACEME
+-->
+
+Template string specifying the filepath for the trace event data, it
+supports `${rotation}` and `${pid}`.
+
### `--zero-fill-buffers`
<!-- YAML
added: v6.0.0
@@ -464,6 +472,7 @@ Node options that are allowed are:
- `--trace-deprecation`
- `--trace-events-categories`
- `--trace-events-enabled`
+- `--trace-event-file-pattern`
- `--trace-sync-io`
- `--trace-warnings`
- `--track-heap-objects`
diff --git a/doc/api/tracing.md b/doc/api/tracing.md
index 3a534177a3..4e161faf9c 100644
--- a/doc/api/tracing.md
+++ b/doc/api/tracing.md
@@ -33,6 +33,15 @@ Running Node.js with tracing enabled will produce log files that can be opened
in the [`chrome://tracing`](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool)
tab of Chrome.
+The logging file is by default called `node_trace.${rotation}.log`, where
+`${rotation}` is an incrementing log-rotation id. The filepath pattern can
+be specified with `--trace-event-file-pattern` that accepts a template
+string that supports `${rotation}` and `${pid}`. For example:
+
+```txt
+node --trace-events-enabled --trace-event-file-pattern '${pid}-${rotation}.log' server.js
+```
+
Starting with Node 10.0.0, the tracing system uses the same time source as the
one used by `process.hrtime()` however the trace-event timestamps are expressed
in microseconds, unlike `process.hrtime()` which returns nanoseconds.
diff --git a/doc/node.1 b/doc/node.1
index 26092d2652..d543d9fa03 100644
--- a/doc/node.1
+++ b/doc/node.1
@@ -156,6 +156,10 @@ Enable the collection of trace event tracing information.
A comma-separated list of categories that should be traced when trace event tracing is enabled using
.Fl -trace-events-enabled .
.
+.It Fl -trace-event-file-pattern Ar pattern
+Template string specifying the filepath for the trace event data, it
+supports \fB${rotation}\fR and \fB${pid}\fR.
+.
.It Fl -zero-fill-buffers
Automatically zero-fills all newly allocated Buffer and SlowBuffer instances.
.