Skip to content

trace_events: add version metadata - #20852

Closed
jasnell wants to merge 1 commit into
nodejs:masterfrom
jasnell:trace-event-metadata-versions
Closed

trace_events: add version metadata#20852
jasnell wants to merge 1 commit into
nodejs:masterfrom
jasnell:trace-event-metadata-versions

Conversation

@jasnell

Copy link
Copy Markdown
Member

Use TRACE_EVENT_METADATA1 to include Node.js, v8, and libuv version
details in the trace log (helpful for log analysis when trace detail
may vary from one Node.js version to another).

/cc @ofrobots

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

@nodejs-github-botnodejs-github-bot added the c++ Issues and PRs that require attention from people who are familiar with C++. label May 20, 2018
@jasnell

Copy link
Copy Markdown
MemberAuthor

@jasnell

Copy link
Copy Markdown
MemberAuthor

Failures in CI are known flakies

@cjihrigcjihrig left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason not to more closely mimic process.versions?

@jasnell

Copy link
Copy Markdown
MemberAuthor

Mimic in which way?

@ofrobotsofrobots left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM w/ nit.

Comment threadsrc/node.cc Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: I'm trying to understand the + 1. If you're skipping the v in the version string: 1) why? 2) it would be good to add a comment explaining what the + 1 does as it is not immediately obvious. I would prefer if the v was included too.

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.

i thought we had a lint rule against messing with pointers like that

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

It is for consistency with the value of process.versions.node (which does not include the v)

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.

If we don't want the v why not use NODE_VERSION_STRING instead?

#defineNODE_VERSION "v" NODE_VERSION_STRING

@jasnell

Copy link
Copy Markdown
MemberAuthor

@ofrobots ... btw, I was going to output all of the versions with a single TRACE_EVENT_METADATA call but the underlying implementation only supports a single argument, and I did not want to have to create and allocate a serializable structure for the version information.

I don't want this to get too out of sync with the V8 version, but it would be helpful to have a TRACE_EVENT_METADATA macro that (a) was not one of the INTERNAL_ macros and (b) supported an arbitrary number of arguments.

@cjihrig

Copy link
Copy Markdown
Contributor

Mimic in which way?

I meant using the same names (for example n-api vs napi), and including the other missing dependencies.

@jasnell

Copy link
Copy Markdown
MemberAuthor

I meant using the same names (for example n-api vs napi), and including the other missing dependencies.

Certainly can do that, yes.

Use `TRACE_EVENT_METADATA1` to include just the node.js version for
now. Later this can be expanded to include more version and platform
details.
@jasnell
jasnellforce-pushed the trace-event-metadata-versions branch from 566c386 to c2e2759CompareMay 25, 2018 21:58
@jasnell

Copy link
Copy Markdown
MemberAuthor

Updated .... After talking it over more with @ofrobots ... I removed everything but the node version in this to give us more flexibility later. We need to think about the best approach to handling complex data as opposed to emitting multiple trace events. Emitting the node version covers the most basic use case for this -- that is, knowing what Node.js version generated the trace file -- so it covers the immediate need.

@jasnell

Copy link
Copy Markdown
MemberAuthor

@jasnelljasnell added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label May 30, 2018
jasnell added a commit that referenced this pull request May 31, 2018
Use `TRACE_EVENT_METADATA1` to include just the node.js version for
now. Later this can be expanded to include more version and platform
details.
PR-URL: #20852
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@jasnell

Copy link
Copy Markdown
MemberAuthor

Landed in e60eed1

@jasnelljasnell closed this May 31, 2018
addaleax pushed a commit that referenced this pull request Jun 1, 2018
Use `TRACE_EVENT_METADATA1` to include just the node.js version for
now. Later this can be expanded to include more version and platform
details.
PR-URL: #20852
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
@MylesBorinsMylesBorins mentioned this pull request Jun 6, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.c++Issues and PRs that require attention from people who are familiar with C++.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@jasnell@cjihrig@ofrobots@richardlau@devsnek@BridgeAR@nodejs-github-bot