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 juanarbol committed Mar 5, 2023
1 parent 2f7319e commit 116a336
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
Expand Up @@ -1926,6 +1926,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 @@ -1942,6 +1943,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
Expand Up @@ -751,6 +751,10 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
&PerIsolateOptions::report_signal,
kAllowedInEnvironment);
Implies("--report-signal", "--report-on-signal");
AddOption("--enable-etw-stack-walking",
"provides heap data to ETW Windows native tracing",
V8Option{},
kAllowedInEnvironment);

AddOption(
"--experimental-top-level-await", "", NoOp{}, kAllowedInEnvironment);
Expand Down

0 comments on commit 116a336

Please sign in to comment.