From 161869ece0cb89e3a03c9f77c013b22b92276e2a Mon Sep 17 00:00:00 2001 From: Leko Date: Mon, 11 Dec 2017 13:05:54 +0900 Subject: [PATCH] src: allow --perf-(basic-)?prof in NODE_OPTIONS PR-URL: https://github.com/nodejs/node/pull/17600 Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Benjamin Gruenbaum Reviewed-By: Joyee Cheung Reviewed-By: Michael Dawson --- doc/api/cli.md | 2 ++ src/node.cc | 2 ++ test/parallel/test-cli-node-options.js | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/doc/api/cli.md b/doc/api/cli.md index 63af8ba5ac85f1..6b98eef3e79ea1 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -494,6 +494,8 @@ Node options that are allowed are: V8 options that are allowed are: - `--abort-on-uncaught-exception` - `--max-old-space-size` +- `--perf-basic-prof` +- `--perf-prof` - `--stack-trace-limit` ### `NODE_PENDING_DEPRECATION=1` diff --git a/src/node.cc b/src/node.cc index 8119f7ee134c59..14c65196d59c65 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3267,6 +3267,8 @@ static void CheckIfAllowedInEnv(const char* exe, bool is_env, "--icu-data-dir", // V8 options (define with '_', which allows '-' or '_') + "--perf_prof", + "--perf_basic_prof", "--abort_on_uncaught_exception", "--max_old_space_size", "--stack_trace_limit", diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index 3118c6bc1bc27d..8eae27b1a2a3a2 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -28,6 +28,15 @@ expect('--trace-event-categories node', 'B\n'); // eslint-disable-next-line no-template-curly-in-string expect('--trace-event-file-pattern {pid}-${rotation}.trace_events', 'B\n'); +if (!common.isWindows) { + expect('--perf-basic-prof', 'B\n'); +} + +if (common.isLinux && ['arm', 'x64', 'mips'].includes(process.arch)) { + // PerfJitLogger is only implemented in Linux. + expect('--perf-prof', 'B\n'); +} + if (common.hasCrypto) { expect('--use-openssl-ca', 'B\n'); expect('--use-bundled-ca', 'B\n');