Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Intel VTune profiling support #45248

Merged
merged 5 commits into from
Nov 22, 2022
Merged

Fix Intel VTune profiling support #45248

merged 5 commits into from
Nov 22, 2022

Conversation

lucshi
Copy link

@lucshi lucshi commented Oct 31, 2022

We received upcoming requests to fix the broken building of Intel
Vtune on Node.js to profile JS and JITted code.

This change fix the Intel Vtune profiling support for JITted
JavaScript on IA32 / X64 / X32 platform. The advantage of this profiling
is that the user / developer of NodeJS application can get the detailed
profiling information for every line of the JavaScript source code and
JITted code.

This feature is a compile-time option. For windows platform, the user
needs to pass the following parameter to vcbuild.bat: "enable-vtune"

For other OS, the user needs to pass the following parameter to
./configure command: "--enable-vtune-profiling"

This fix was originally address in PR and author is @fanchenkong1
fanchen.kong@intel.com in
#39374 last year. The PR has been
broken in current Node.js repo and I fixed the broken, fully tested and
submit this new PR on behalf of @fanchenkong1.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/tsc
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. labels Oct 31, 2022
@mscdex
Copy link
Contributor

mscdex commented Oct 31, 2022

There seems to be unrelated (eslint-related) commits added here?

Also, with vtune support being removed back in 2019 due to bitrot, is there any kind of guarantee we won't see a repeat of this?

@gengjiawen
Copy link
Member

You also need to upstream v8 patches in v8 repo

@lucshi
Copy link
Author

lucshi commented Oct 31, 2022

You also need to upstream v8 patches in v8 repo

No need for now. The ittapi code has been in V8 repo. At present Node.js node-core-util lack of the auto sync-up support for V8 ittapi componenent and this was addressed by PR nodejs/node-core-utils#552. The reviewing decision of PR 552 is that it will be landed after vtune patch landed. So for now, the solution is I commit the V8 depedency ittapi to Node.js for the first time, and then land the node-core-util PR. In future ittapi could be sync up automatically.

@lucshi
Copy link
Author

lucshi commented Oct 31, 2022

There seems to be unrelated (eslint-related) commits added here?

Also, with vtune support being removed back in 2019 due to bitrot, is there any kind of guarantee we won't see a repeat of this?

The root cause of 2019 bitrot is that we had code changes in V8 repo but not synced to Node.js repo. To avoid such issue there are options like

  1. Add maintainer for vtune support. Maintainer is responsible for tracking code changes.
  2. Add vtune building flag into CI.

Please advice more options. Thanks!

@targos
Copy link
Member

targos commented Oct 31, 2022

Changes to config/build files LGTM. /cc @nodejs/cpp-reviewers

@lucshi
Copy link
Author

lucshi commented Oct 31, 2022

There are 2 lint related patch submitted. Is there a way to remove them without resubmitting PR again?

@legendecas
Copy link
Member

There are 2 lint related patch submitted. Is there a way to remove them without resubmitting PR again?

You can try squashing the commits and force-push the same branch to GitHub.

@BridgeAR
Copy link
Member

@lucshi

git rebase -i HEAD~3
# Remove the unreleated commits
git push --force-with-lease

@bnoordhuis
Copy link
Member

Add vtune building flag into CI.

Node's CI matrix is already unwieldy and realistically no one cares (reports bugs) about vtune except Intel personnel.

If Intel wants to be more proactive w.r.t. fixing issues, that's of course welcome, just send pull requests.

@lucshi
Copy link
Author

lucshi commented Nov 1, 2022

git rebase -i HEAD~3
# Remove the unreleated commits
git push --force-with-lease

Done. Thank you!

@lucshi
Copy link
Author

lucshi commented Nov 1, 2022

Add vtune building flag into CI.

Node's CI matrix is already unwieldy and realistically no one cares (reports bugs) about vtune except Intel personnel.

If Intel wants to be more proactive w.r.t. fixing issues, that's of course welcome, just send pull requests.

Sure. Will submit a new PR to enable the checks in Windows build and Linux buid CI checks.

@lucshi
Copy link
Author

lucshi commented Nov 1, 2022

All review comments are resolved. Please kindly have a review and submit.
After this landed, I will submit a new PR to add vtune build into windows and linux build CI.

@Trott
Copy link
Member

Trott commented Nov 1, 2022

@nodejs/build

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

LICENSE Show resolved Hide resolved
@BridgeAR
Copy link
Member

BridgeAR commented Nov 9, 2022

@lucshi seems like something went wrong while pushing something new to the branch :-)
You could rebase with main to remove those again and then push force with lease.

tools/license-builder.sh Outdated Show resolved Hide resolved
@targos targos added the request-ci Add this label to start a Jenkins CI on a PR. label Nov 12, 2022
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Nov 12, 2022
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@lucshi
Copy link
Author

lucshi commented Nov 22, 2022

Can this PR be merged?

@targos targos added the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 22, 2022
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Nov 22, 2022
@nodejs-github-bot nodejs-github-bot merged commit d783a1c into nodejs:main Nov 22, 2022
@nodejs-github-bot
Copy link
Collaborator

Landed in d783a1c

targos pushed a commit to nodejs/node-core-utils that referenced this pull request Nov 22, 2022
Add ittapi to the list of V8 dependencies, which is used by VTune JIT
profiling.

Refs: nodejs/node#45248
marco-ippolito pushed a commit to marco-ippolito/node that referenced this pull request Nov 23, 2022
PR-URL: nodejs#45248
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
ruyadorno pushed a commit that referenced this pull request Nov 24, 2022
PR-URL: #45248
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
@ruyadorno ruyadorno mentioned this pull request Nov 24, 2022
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
PR-URL: #45248
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
danielleadams pushed a commit that referenced this pull request Dec 30, 2022
PR-URL: #45248
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
danielleadams pushed a commit that referenced this pull request Jan 3, 2023
PR-URL: #45248
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
danielleadams pushed a commit that referenced this pull request Jan 4, 2023
PR-URL: #45248
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
danielleadams pushed a commit that referenced this pull request Jan 5, 2023
PR-URL: #45248
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
patrickm68 added a commit to patrickm68/NodeJS-core-utils that referenced this pull request Sep 14, 2023
Add ittapi to the list of V8 dependencies, which is used by VTune JIT
profiling.

Refs: nodejs/node#45248
@lucshi lucshi deleted the vtune branch December 4, 2023 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants