6

src: add support for ETW stack walking by jdapena · Pull Request #46203 · nodejs...

 1 year ago
source link: https://github.com/nodejs/node/pull/46203
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Contributor

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

nodejs-github-bot

added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.

labels

Jan 13, 2023

Member

Test failures are related.

We should probably formulate a strategy on NODE_OPTIONS vis-a-vis V8 options because there are tons of them. Adding them haphazardly is, let's say, suboptimal.

Having said that, --perf-basic-prof is already allowed so why not --enable-etw-stack-walking too?

Contributor

Author

Test failures are related.

We should probably formulate a strategy on NODE_OPTIONS vis-a-vis V8 options because there are tons of them. Adding them haphazardly is, let's say, suboptimal.

Most interesting thing is that passing any existing V8 flag in command line is already supported, and it will detect if the flag exists. But NODE_OPTIONS has stronger checks.

One possibility would be doing the same thing that is done with CLI arguments and accept any V8 flag. Another possibility is having something like --v8-flags="..." or similar that will pass the arguments to V8. It would be interesting to know why the environment checks are added (if it is just warning user about unsupported flags or security or what...).

Having said that, --perf-basic-prof is already allowed so why not --enable-etw-stack-walking too?

Yes, provisionally we can land this patch (with the extra documentation change I just added). And maybe create a new ticket for working the NODE_OPTIONS V8 flags processing.

Member

or security

That's the reason. With "formulating a strategy" I meant thinking about what flag categories should and should not be accepted.

Right now it's decided on a case-by-case basis but that often leaves glaring holes, like how --max-old-space-size=... was accepted but not --max-semi-space-size=... (fixed, but only recently.)

Contributor

Author

As first time contributor to Node, I cannot kick workflows for the updated patch thinking

About creating a strategy for V8 flags... my first question is if this patch should wait for that.

Then, about how to implement an strategy (i.e. reworking NODE_OPTIONS processing to be more explicit that we have an "allow list", and which flags are allowed). And about functionality discussion... maybe we want to have some clear rules about what should be allowed or not.

Member

About creating a strategy for V8 flags... my first question is if this patch should wait for that.

No, that's for other maintainers to worry about. :-)

I cannot kick workflows for the updated patch

I'm kind of surprised by that because CI went through just fine the first time... I can start it manually but that's pointless when it's going the fail in the exact same way. Can you run make test locally and fix up the failures?

joyeecheung

added the commit-queue Add this label to land a pull request using GitHub Actions. label

Jan 24, 2023

nodejs-github-bot

removed the commit-queue Add this label to land a pull request using GitHub Actions. label

Jan 24, 2023

nodejs-github-bot

merged commit b88628c into

nodejs:main

Jan 24, 2023

49 checks passed

Contributor

Landed in b88628c

Member

I opened #46339 for the question:

We should probably formulate a strategy on NODE_OPTIONS vis-a-vis V8 options because there are tons of them. Adding them haphazardly is, let's say, suboptimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

joyeecheung

joyeecheung approved these changes
Assignees

No one assigned

Labels
c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.
Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

ETW stack walking cannot be enabled from NODE_OPTIONS

4 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK