Skip to content

Commit

Permalink
src: add support for ETW stack walking
Browse files Browse the repository at this point in the history
V8 supports native stack walking in Windows by providing JIT code
information to ETW (Event Tracing for Windows). But the option to
enable it is not exposed in NodeJS.

Just add command line (and environment variable) support for
--enable-etw-stack-walking, that maps to V8 option of the same name.

Fixes: #46202
PR-URL: #46203
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
jdapena authored and ruyadorno committed Jan 31, 2023
1 parent 4ae2492 commit 4c59b60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1970,6 +1970,7 @@ V8 options that are allowed are:

* `--abort-on-uncaught-exception`
* `--disallow-code-generation-from-strings`
* `--enable-etw-stack-walking`
* `--huge-max-old-generation-size`
* `--interpreted-frames-native-stack`
* `--jitless`
Expand All @@ -1986,6 +1987,8 @@ V8 options that are allowed are:
`--perf-basic-prof-only-functions`, `--perf-basic-prof`,
`--perf-prof-unwinding-info`, and `--perf-prof` are only available on Linux.

`--enable-etw-stack-walking` is only available on Windows.

### `NODE_PATH=path[:…]`

<!-- YAML
Expand Down
4 changes: 4 additions & 0 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,10 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
&PerIsolateOptions::report_signal,
kAllowedInEnvvar);
Implies("--report-signal", "--report-on-signal");
AddOption("--enable-etw-stack-walking",
"provides heap data to ETW Windows native tracing",
V8Option{},
kAllowedInEnvvar);

AddOption("--experimental-top-level-await", "", NoOp{}, kAllowedInEnvvar);

Expand Down

0 comments on commit 4c59b60

Please sign in to comment.