-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: add version metadata #20852
Conversation
Failures in CI are known flakies |
There was a problem hiding this comment.
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
?
Mimic in which way? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM w/ nit.
src/node.cc
Outdated
@@ -4234,6 +4234,11 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, | |||
Environment env(isolate_data, context, v8_platform.GetTracingAgent()); | |||
env.Start(argc, argv, exec_argc, exec_argv, v8_is_profiling); | |||
|
|||
TRACE_EVENT_METADATA1("__metadata", "version", "node", NODE_VERSION + 1); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
)
There was a problem hiding this comment.
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?
Line 65 in 32873c5
#define NODE_VERSION "v" NODE_VERSION_STRING |
@ofrobots ... btw, I was going to output all of the versions with a single I don't want this to get too out of sync with the V8 version, but it would be helpful to have a |
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.
566c386
to
c2e2759
Compare
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. |
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>
Landed in e60eed1 |
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>
Use
TRACE_EVENT_METADATA1
to include Node.js, v8, and libuv versiondetails 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), orvcbuild test
(Windows) passes