From 3d4cda3a7d6844ca08df57ec308c540096a38f33 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. Backport-PR-URL: https://github.com/nodejs/node/pull/19144 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 | 4 +++ 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 | 30 +++++++++++++++++++ 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 6bae0a67c3d101..7368be92c3f737 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` + + +Template string specifying the filepath for the trace event data, it +supports `${rotation}` and `${pid}`. + ### `--zero-fill-buffers`