Skip to content

Commit

Permalink
src: allow --interpreted-frames-native-stack in NODE_OPTIONS
Browse files Browse the repository at this point in the history
PR-URL: #27744
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
  • Loading branch information
mmarchini committed Aug 27, 2019
1 parent c246f81 commit 0150490
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ Node.js options that are allowed are:
V8 options that are allowed are:
<!-- node-options-v8 start -->
- `--abort-on-uncaught-exception`
- `--interpreted-frames-native-stack`
- `--max-old-space-size`
- `--perf-basic-prof-only-functions`
- `--perf-basic-prof`
Expand Down
3 changes: 3 additions & 0 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
"for analysis",
V8Option{},
kAllowedInEnvironment);
AddOption("--interpreted-frames-native-stack",
"help system profilers to translate JavaScript interpreted frames",
V8Option{}, kAllowedInEnvironment);
AddOption("--max-old-space-size", "", V8Option{}, kAllowedInEnvironment);
AddOption("--perf-basic-prof", "", V8Option{}, kAllowedInEnvironment);
AddOption("--perf-basic-prof-only-functions",
Expand Down
3 changes: 3 additions & 0 deletions test/parallel/test-cli-node-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ expect('--stack-trace-limit=100',
/(\s*at f \(\[eval\]:1:\d*\)\r?\n){100}/,
'(function f() { f(); })();',
true);
// Unsupported on arm. See https://crbug.com/v8/8713.
if (!['arm', 'arm64'].includes(process.arch))
expect('--interpreted-frames-native-stack', 'B\n');

function expect(opt, want, command = 'console.log("B")', wantsError = false) {
const argv = ['-e', command];
Expand Down

0 comments on commit 0150490

Please sign in to comment.