From b778ba1e5558564d11db1453124050f8f0d308e9 Mon Sep 17 00:00:00 2001 From: Leko Date: Mon, 11 Dec 2017 13:05:54 +0900 Subject: [PATCH 01/11] src: allow --perf-prof and --perf-basic-prof in NODE_OPTIONS --- src/node.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/node.cc b/src/node.cc index ed2f0c14ff3c59..b65d0b5839f84d 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3595,6 +3595,8 @@ static void CheckIfAllowedInEnv(const char* exe, bool is_env, "--force-fips", "--openssl-config", "--icu-data-dir", + "--perf-prof", + "--perf-basic-prof", // V8 options (define with '_', which allows '-' or '_') "--abort_on_uncaught_exception", From b35f846f8d8a3804a336351e979c0759071fea43 Mon Sep 17 00:00:00 2001 From: Leko Date: Mon, 11 Dec 2017 13:14:44 +0900 Subject: [PATCH 02/11] test: add test about perf-prof and perf-basic-prof are allowed in NODE_OPTIONS --- test/parallel/test-cli-node-options.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index 85c35508566ff1..6f5e07645384a0 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -24,6 +24,8 @@ expect('--throw-deprecation', 'B\n'); expect('--zero-fill-buffers', 'B\n'); expect('--v8-pool-size=10', 'B\n'); expect('--trace-event-categories node', 'B\n'); +expect('--perf-prof', 'B\n'); +expect('--perf-basic-prof', 'B\n'); if (common.hasCrypto) { expect('--use-openssl-ca', 'B\n'); From 1b7a8d13e51e805c8a59382aa4e05709ba1d3168 Mon Sep 17 00:00:00 2001 From: Leko Date: Mon, 11 Dec 2017 20:52:47 +0900 Subject: [PATCH 03/11] src: redefine perf_prof and perf_basic_prof as option for v8 --- src/node.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node.cc b/src/node.cc index b65d0b5839f84d..d9bfa32ad11a48 100644 --- a/src/node.cc +++ b/src/node.cc @@ -3595,10 +3595,10 @@ static void CheckIfAllowedInEnv(const char* exe, bool is_env, "--force-fips", "--openssl-config", "--icu-data-dir", - "--perf-prof", - "--perf-basic-prof", // V8 options (define with '_', which allows '-' or '_') + "--perf_prof", + "--perf_basic_prof", "--abort_on_uncaught_exception", "--max_old_space_size", "--stack_trace_limit", From 702bd35362bbffc75709d1b319c1212276e3abe3 Mon Sep 17 00:00:00 2001 From: Leko Date: Mon, 11 Dec 2017 21:26:00 +0900 Subject: [PATCH 04/11] test: test --perf-prof only in Linux perf-prof works in Linux only. For example, it not works in MacOS. --- test/parallel/test-cli-node-options.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index 6f5e07645384a0..f2ac8a064560fd 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -24,9 +24,14 @@ expect('--throw-deprecation', 'B\n'); expect('--zero-fill-buffers', 'B\n'); expect('--v8-pool-size=10', 'B\n'); expect('--trace-event-categories node', 'B\n'); -expect('--perf-prof', 'B\n'); expect('--perf-basic-prof', 'B\n'); +if (common.isLinux) { + // PerfJitLogger is only implemented in Linux. + // https://github.com/nodejs/node/pull/17600#issuecomment-350664113 + expect('--perf-prof', 'B\n'); +} + if (common.hasCrypto) { expect('--use-openssl-ca', 'B\n'); expect('--use-bundled-ca', 'B\n'); From 0899557fee6680bf9ede35720074e8e25bd9ff7b Mon Sep 17 00:00:00 2001 From: Leko Date: Mon, 11 Dec 2017 23:12:58 +0900 Subject: [PATCH 05/11] test: remove Github link --- test/parallel/test-cli-node-options.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index f2ac8a064560fd..396fd6b5363087 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -28,7 +28,6 @@ expect('--perf-basic-prof', 'B\n'); if (common.isLinux) { // PerfJitLogger is only implemented in Linux. - // https://github.com/nodejs/node/pull/17600#issuecomment-350664113 expect('--perf-prof', 'B\n'); } From 81a06846371c23f77a079dcba7541c9154728603 Mon Sep 17 00:00:00 2001 From: Leko Date: Tue, 12 Dec 2017 21:59:14 +0900 Subject: [PATCH 06/11] doc: add --perf-prof and --perf-basic-prof to V8 options --- doc/api/cli.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/cli.md b/doc/api/cli.md index b8ea4826dec2fe..5d4506411d0523 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -473,6 +473,8 @@ Node options that are allowed are: - `--zero-fill-buffers` V8 options that are allowed are: +- `--perf-prof` +- `--perf-basic-prof` - `--abort-on-uncaught-exception` - `--max-old-space-size` - `--stack-trace-limit` From b97987ad57f2794d3d0e355c47bd8fc3796a8ea2 Mon Sep 17 00:00:00 2001 From: Leko Date: Wed, 13 Dec 2017 12:38:50 +0900 Subject: [PATCH 07/11] doc: sort V8 options in alphabetical order --- doc/api/cli.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 5d4506411d0523..6bae0a67c3d101 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -473,10 +473,10 @@ Node options that are allowed are: - `--zero-fill-buffers` V8 options that are allowed are: -- `--perf-prof` -- `--perf-basic-prof` - `--abort-on-uncaught-exception` - `--max-old-space-size` +- `--perf-basic-prof` +- `--perf-prof` - `--stack-trace-limit` ### `NODE_PENDING_DEPRECATION=1` From e32f7a4e0455225d18fe87bef8dff5c3eee57ec6 Mon Sep 17 00:00:00 2001 From: Leko Date: Thu, 28 Dec 2017 01:04:01 +0900 Subject: [PATCH 08/11] test: add whitelist to restrict test target --- test/parallel/test-cli-node-options.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index 396fd6b5363087..e1af1c895e160b 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -26,7 +26,7 @@ expect('--v8-pool-size=10', 'B\n'); expect('--trace-event-categories node', 'B\n'); expect('--perf-basic-prof', 'B\n'); -if (common.isLinux) { +if (common.isLinux && ['arm', 'x64', 'ia32', 'mips'].includes(process.arch)) { // PerfJitLogger is only implemented in Linux. expect('--perf-prof', 'B\n'); } From d9e85737513b7c197eac5061fbe9432ae3628569 Mon Sep 17 00:00:00 2001 From: Leko Date: Thu, 28 Dec 2017 23:29:34 +0900 Subject: [PATCH 09/11] test: Not run test in Windows or 32bit --- test/parallel/test-cli-node-options.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index e1af1c895e160b..85931e38404b3e 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -26,7 +26,8 @@ expect('--v8-pool-size=10', 'B\n'); expect('--trace-event-categories node', 'B\n'); expect('--perf-basic-prof', 'B\n'); -if (common.isLinux && ['arm', 'x64', 'ia32', 'mips'].includes(process.arch)) { +const archMatched = ['arm', 'x64', 'mips'].includes(process.arch); +if (common.isLinux && !common.isWindows && archMatched) { // PerfJitLogger is only implemented in Linux. expect('--perf-prof', 'B\n'); } From c436f72b369ef336aa7bae203a7c804b23fb8ea2 Mon Sep 17 00:00:00 2001 From: Leko Date: Fri, 12 Jan 2018 23:35:27 +0900 Subject: [PATCH 10/11] test: remove redundant condition --- test/parallel/test-cli-node-options.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index 85931e38404b3e..9912307fcde39d 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -26,8 +26,7 @@ expect('--v8-pool-size=10', 'B\n'); expect('--trace-event-categories node', 'B\n'); expect('--perf-basic-prof', 'B\n'); -const archMatched = ['arm', 'x64', 'mips'].includes(process.arch); -if (common.isLinux && !common.isWindows && archMatched) { +if (common.isLinux && ['arm', 'x64', 'mips'].includes(process.arch)) { // PerfJitLogger is only implemented in Linux. expect('--perf-prof', 'B\n'); } From 8b7d8be727d8d29e2a7bb55d02a88918b20d0877 Mon Sep 17 00:00:00 2001 From: Leko Date: Fri, 19 Jan 2018 00:52:55 +0900 Subject: [PATCH 11/11] test: Run test --perf-basic-prof except for windows --- test/parallel/test-cli-node-options.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-cli-node-options.js b/test/parallel/test-cli-node-options.js index 9912307fcde39d..a61a315f5b5582 100644 --- a/test/parallel/test-cli-node-options.js +++ b/test/parallel/test-cli-node-options.js @@ -24,7 +24,10 @@ expect('--throw-deprecation', 'B\n'); expect('--zero-fill-buffers', 'B\n'); expect('--v8-pool-size=10', 'B\n'); expect('--trace-event-categories node', 'B\n'); -expect('--perf-basic-prof', '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.