From 3f4abcee075c01356b1753e5b41db9c64c771afe Mon Sep 17 00:00:00 2001 From: Andreas Madsen Date: Wed, 31 Jan 2018 17:12:09 +0100 Subject: [PATCH] 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 Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- doc/api/cli.md | 9 ++++++ doc/api/tracing.md | 13 +++++++++ doc/node.1 | 5 ++++ src/node.cc | 17 ++++++++++- src/tracing/agent.cc | 5 ++-- src/tracing/agent.h | 2 +- src/tracing/node_trace_writer.cc | 26 +++++++++++++---- src/tracing/node_trace_writer.h | 4 ++- test/parallel/test-cli-node-options.js | 2 ++ .../test-trace-events-file-pattern.js | 29 +++++++++++++++++++ 10 files changed, 102 insertions(+), 10 deletions(-) create mode 100644 test/parallel/test-trace-events-file-pattern.js diff --git a/doc/api/cli.md b/doc/api/cli.md index 2e918c2876c1a8..d35efbbbdfd667 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -238,6 +238,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` + + +Template string specifying the filepath for the trace event data, it +supports `${rotation}` and `${pid}`. + ### `--zero-fill-buffers`