Skip to content

ETW stack walking cannot be enabled from NODE_OPTIONS #46202

Closed
@jdapena

Description

@jdapena

Version

19.4.0

Platform

Windows11 (Microsoft Windows NT 10.0.22621.0 x64)

Subsystem

No response

What steps will reproduce the bug?

Add to NODE_OPTIONS --enable-etw-stack-walking.

I.e. in Git Bash: export NODE_OPTIONS="--enable-etw-stack-walking"

Then run Node:
node

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

Node launches, and JIT code from scripts in Node generate symbols to provide stack walking in Windows Performance Recorder/Analyzer.

What do you see instead?

Node fails immediately:

C:/Program Files/nodejs/node.exe: --enable-etw-stack-walking is not allowed in NODE_OPTIONS

Additional information

It works from command line, as V8 flags are also accepted:
node --enable-etw-stack-walking

When it is working, Windows Performance Recorder with CPU usage recording capture properly the JIT generated code symbols, and those are visible from Windows Performance Analyzer sampled views including stack data. Though, often that's not convenient (i.e. for launching all scripts in a session with ETW stack walk enabled as when running from npm or yarn). Environment variable allows to enable ETW stack walk for the whole shell session or even system wide for all the NodeJS sessions.

There is the possibility, in the future, that ETW is enabled by default, and then this will not be required. This depends on confirming the overload of enabling ETW without an ongoing tracing session is null or almost null and is going to be discussed at V8 level. Meanwhile, it will be interesting to support ETW stack walk in a convenient way for NodeJS community.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions