Skip to content

Commit

Permalink
src: allow --perf-(basic-)?prof in NODE_OPTIONS
Browse files Browse the repository at this point in the history
PR-URL: #17600
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
Leko authored and MylesBorins committed Aug 16, 2018
1 parent ebd73ad commit 161869e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 2 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 9 additions & 0 deletions test/parallel/test-cli-node-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 161869e

Please sign in to comment.