-
Notifications
You must be signed in to change notification settings - Fork 78
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_event.h status? #15
Comments
Thanks for poking on this. trace-event.h hasn't merged into V8 yet (@fmeawad is hoping to get it into 4.5) however, I don't think we need to wait for it to land before building upon it. I did manage to get some time to play with it a little bit. Here are the next steps in getting trace-event into node, as I see them. This is my understanding of trace-event, so @fmeawad and @natduca can keep me honest here.
Beyond this, we will need to do a few things in JavaScript:
The great thing, once this is done is that we'll get traces from the whole stack (V8, node-core, user-space) consolidated into the same place. I started hacking on branch with the above a while back but got side-tracked. I can create the branch on github if there are people who want to collaborate and hack together at this. |
To clarify, the stats are buffered and delivered async. Is the processing of those stats expected to be done off the main thread to prevent blocking? If so, how would this work with exposing a JS API that would force blocking the main thread? |
Can you elaborate what you mean by 'stats'? How are those different from a 'trace'? I know 'trace' can mean different things to different people and in different context, but this is what I mean in this context: var debug = util.debuglog('net');
//...
debug('createConnection', args); Or this:
The JS Trace API needs to do minimal work to create the packet of information and then call trace-event to deposit it to the buffer. This would be synchronous. I do expect the TraceBuffer is would be implementing the flushing as a separate thread, or some other concurrency mechanism that is off the main thread. BTW, the |
Sorry. By "stats" I was talking about the "packet of information" collected and stored in the buffer to be processed asynchronously. |
I think the tracing API should be synchronous. It needs to be near-zero cost (single test) when the trace-category is not enabled. It needs to be very cheap when trace category is enabled. All processing should be done off the main thread. |
I've gotten a bit swamped so am not able to keep pace here right now, but @fmeawad indicated he's planning a reply for this bug shortly :) |
I would like to apologize that trace_event.h has not landed yet in V8. We still think that this is the right direction. We found that we needed more support on the chrome side to support the same things the v8.log currently supports. Therefore it got lowered in priority for a while, but we are still trying to get it landed in 4.5. |
Does it need to be included in V8 for the macros to be used in node? |
I think you need another copy of it in node to be able to use it. And it does not conflict. @ofrobots can comment better since I believe has a prototype. |
What I was getting at is, if the interface is stable could we start using it in node before it's been integrated into V8? |
The interface is very stable, and it has been used in chrome and blink among other places for a long time now. |
Then let's begin discussions on how it should be integrated into node. How would we like to proceed? |
I think the file can be immediately copied into node. We can remove it once it lands in v8 and start including it from there. Until that happens, we won't be getting traces from V8, but that should be fine. |
Sounds good. That will give us time to work on the JS interface. I'd like to explore integration with AsyncWrap. |
What is the status of the trace_event.h work happening with V8? Is that in a state yet where we can start integrating it with node?
If anyone working on V8 is available to attend the collaborator summit, I'd love to work together to get the development effort of this kicked off.
cc: @ofrobots @natduca
The text was updated successfully, but these errors were encountered: