Skip to content

trace_events,async_hooks: use intrinsic trace - #22127

Closed
jasnell wants to merge 4 commits into
nodejs:masterfrom
jasnell:trace_events_async_hooks_args
Closed

trace_events,async_hooks: use intrinsic trace#22127
jasnell wants to merge 4 commits into
nodejs:masterfrom
jasnell:trace_events_async_hooks_args

Conversation

@jasnell

@jasnell jasnell commented Aug 4, 2018

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Collaborator

@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
@jasnell
jasnell requested review from mafintosh and mcollina August 4, 2018 16:54

@AndreasMadsen AndreasMadsen left a comment

Copy link
Copy Markdown
Member

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

jasnell commented Aug 4, 2018

Copy link
Copy Markdown
Member Author

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

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

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

jasnell commented Aug 6, 2018

Copy link
Copy Markdown
Member Author

@jasnell

jasnell commented Aug 7, 2018

Copy link
Copy Markdown
Member Author

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

@jasnell

jasnell commented Aug 7, 2018

Copy link
Copy Markdown
Member Author

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

jasnell added 2 commits August 9, 2018 12:31
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

jasnell commented Aug 9, 2018

Copy link
Copy Markdown
Member Author

@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

jasnell commented Aug 9, 2018

Copy link
Copy Markdown
Member Author

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

@jasnell

jasnell commented Aug 9, 2018

Copy link
Copy Markdown
Member Author

CI is good

const procDisabled = cp.spawn(
process.execPath,
[ '--trace-event-categories', 'other',
'--no-warnings',

@AndreasMadsen AndreasMadsen Aug 10, 2018

Copy link
Copy Markdown
Member

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
Copy Markdown
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

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

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

jasnell commented Aug 10, 2018

Copy link
Copy Markdown
Member Author

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.

7 participants