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

trace_events,async_hooks: use intrinsic trace #22127

Closed
wants to merge 4 commits into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Aug 4, 2018

Switch to using the faster intrinsic trace event method for async_hooks.

This is a breaking change because of the switch to a nested data argument for exec id and trigger id values. Although trace events and async hooks are still both experimental, there is code deployed that depends on the current data format for async hooks in trace events (e.g. https://github.com/nearform/node-clinic). Therefore, while this is not technically semver-major, I'm marking it "don't land" on 10, 8, and 6.

/cc @mcollina ... once this does land in master, clinic would need to be updated to account for the new data format. The version metadata in the trace event log can be used to determine which format applies.

Example old format: trace_event.args.triggerAsyncId
Example new format: trace_event.args.data.triggerAsyncId

@nodejs/diagnostics @nodejs/trace-events @nodejs/async_hooks

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label Aug 4, 2018
Copy link
Member

@AndreasMadsen AndreasMadsen left a comment

Choose a reason for hiding this comment

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

LGTM, but I think this should also remove the old emit API from the binding module.

@jasnell
Copy link
Member Author

jasnell commented Aug 4, 2018

Yeah, I'm planning to remove that but wanted to make sure there were no objections to this first

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

@addaleax addaleax added async_hooks Issues and PRs related to the async hooks subsystem. trace_events Issues and PRs related to V8, Node.js core, and userspace code trace events. labels Aug 6, 2018
@jasnell
Copy link
Member Author

jasnell commented Aug 6, 2018

@jasnell
Copy link
Member Author

jasnell commented Aug 7, 2018

Rerun interrupted CI on Linux: https://ci.nodejs.org/job/node-test-commit-linux/20514/

@jasnell
Copy link
Member Author

jasnell commented Aug 7, 2018

Trying again on linux due to a seemingly unrelated failure: https://ci.nodejs.org/job/node-test-commit-linux/20518/

Switch to using the intrinsic trace event method for async_hooks.

This is a breaking change because of the switch to a nested data
argument for exec id and trigger id values.
Remove the older emit and categoryGroupEnabled bindings in
favor of the new intrinsics
@jasnell jasnell force-pushed the trace_events_async_hooks_args branch from 5d45705 to c5e0db7 Compare August 9, 2018 20:46
@jasnell
Copy link
Member Author

jasnell commented Aug 9, 2018

@mcollina @ofrobots @AndreasMadsen ... updated the PR to remove the older emit and categoryGroupEnabled functions. Please take another look.

New CI: https://ci.nodejs.org/job/node-test-pull-request/16314/

@jasnell
Copy link
Member Author

jasnell commented Aug 9, 2018

Rerun CI-lite for lint issue: https://ci.nodejs.org/job/node-test-pull-request-lite-pipeline/485/

@jasnell
Copy link
Member Author

jasnell commented Aug 9, 2018

CI is good

@@ -35,6 +36,7 @@ procEnabled.once('exit', common.mustCall(() => {
const procDisabled = cp.spawn(
process.execPath,
[ '--trace-event-categories', 'other',
'--no-warnings',
Copy link
Member

@AndreasMadsen AndreasMadsen Aug 10, 2018

Choose a reason for hiding this comment

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

Why this? Maybe add a comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

just to make the test less noisy since the import of internal/test/binding emits a warning

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

jasnell added a commit that referenced this pull request Aug 10, 2018
Switch to using the intrinsic trace event method for async_hooks.

This is a breaking change because of the switch to a nested data
argument for exec id and trigger id values.

PR-URL: #22127
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
jasnell added a commit that referenced this pull request Aug 10, 2018
Remove the older emit and categoryGroupEnabled bindings in
favor of the new intrinsics

PR-URL: #22127
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
@jasnell
Copy link
Member Author

jasnell commented Aug 10, 2018

Landed in c85933c and b854604

@jasnell jasnell closed this Aug 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
async_hooks Issues and PRs related to the async hooks subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. trace_events Issues and PRs related to V8, Node.js core, and userspace code trace events.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants