From e602726c68d4b0b70c9a46dabffc6f0f6210eed2 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/19145 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 | 30 +++++++++++++++++++ 10 files changed, 103 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 3192d846e77933..63af8ba5ac85f1 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`