summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeko <leko.noor@gmail.com>2017-12-11 13:05:54 +0900
committerRuben Bridgewater <ruben@bridgewater.de>2018-02-01 13:38:24 +0100
commit7ff4888ed2d99a7ea412b3dee46286a8754956c4 (patch)
tree9e14000570d65931215ebec33dda9e3380c05c7b
parent4372185ef8fddf19ab628c10b4d5279528a9be75 (diff)
downloadandroid-node-v8-7ff4888ed2d99a7ea412b3dee46286a8754956c4.tar.gz
android-node-v8-7ff4888ed2d99a7ea412b3dee46286a8754956c4.tar.bz2
android-node-v8-7ff4888ed2d99a7ea412b3dee46286a8754956c4.zip
src: allow --perf-(basic-)?prof in NODE_OPTIONS
PR-URL: https://github.com/nodejs/node/pull/17600 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
-rw-r--r--doc/api/cli.md2
-rw-r--r--src/node.cc2
-rw-r--r--test/parallel/test-cli-node-options.js9
3 files changed, 13 insertions, 0 deletions
diff --git a/doc/api/cli.md b/doc/api/cli.md
index b8ea4826de..6bae0a67c3 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -475,6 +475,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 e86e48060c..50bba93f17 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -3530,6 +3530,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 29358134c2..c9f2d5eace 100644
--- a/test/parallel/test-cli-node-options.js
+++ b/test/parallel/test-cli-node-options.js
@@ -26,6 +26,15 @@ expect('--zero-fill-buffers', 'B\n');
expect('--v8-pool-size=10', 'B\n');
expect('--trace-event-categories node', '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');