-
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 more process metadata #21785
Conversation
Now that TracedValue has landed, add more detailed process `__metadata` including versions, arch, platform, release detail, and argv/execArgv to the trace event log.
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 would really like it if we could avoid the overhead of these calls when tracing is not enabled, especially if this is going to be a more common pattern?
src/node_internals.h
Outdated
@@ -32,6 +32,7 @@ | |||
#include "uv.h" | |||
#include "v8.h" | |||
#include "tracing/trace_event.h" | |||
#include "tracing/traced_value.h" |
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.
Can we include these headers where they are used, rather than (almost) globally?
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.
Sure
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 would really like it if we could avoid the overhead of these calls when tracing is not enabled, especially if this is going to be a more common pattern?
Retracting my own review comment: I think I have a good idea for how to do that, let me code that out real quick :)
Edit: No, sorry. My idea was to create a custom kind of smart pointer to use instead of std::unique_ptr<TracedValue>
, which would mirror these methods and turn them into no-ops if the handle contained nullptr
.
But that requires knowing in advance whether a tracing category is enabled, and I don’t really know how to do that :/
There's a way. The difficulty with metadata events is that they are always implicitly enabled if any tracing at all is enabled. So we would need to separate them out to allow on demand creation. I can work on that. |
I'll be pushing a commit in a few minutes... but the way to do this is to attach a |
Ok, @addaleax ... take a look now. I'm using a Note: by switching to this, just to keep things simple, the process metadata no longer includes the argv and execArgv details since those are not around when the |
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.
Thanks!
Now that TracedValue has landed, add more detailed process `__metadata` including versions, arch, platform, release detail, and argv/execArgv to the trace event log. PR-URL: nodejs#21785 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Landed in ededb4b 🎉 |
Now that TracedValue has landed, add more detailed process `__metadata` including versions, arch, platform, release detail, and argv/execArgv to the trace event log. PR-URL: #21785 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Now that TracedValue has landed, add more detailed
process
__metadata
including versions, arch, platform,release detail, and argv/execArgv to the trace event
log.
This adds an entry like:
Checklist
(UNIX), or
vcbuild test` (Windows) passes