diff options
author | Eugene Ostroukhov <eostroukhov@google.com> | 2018-04-27 17:20:37 -0700 |
---|---|---|
committer | Eugene Ostroukhov <eostroukhov@google.com> | 2018-05-17 13:14:26 -0700 |
commit | 47bdc716f83462b6ab938315d11de6c92be082ac (patch) | |
tree | 8bdfd8c487cdcfb4e5b573b24d7809d053c675a6 /src/tracing/node_trace_buffer.h | |
parent | 5248401174ff1ec02f5e1a247a97594341bbfd89 (diff) | |
download | android-node-v8-47bdc716f83462b6ab938315d11de6c92be082ac.tar.gz android-node-v8-47bdc716f83462b6ab938315d11de6c92be082ac.tar.bz2 android-node-v8-47bdc716f83462b6ab938315d11de6c92be082ac.zip |
inspector: add a "NodeTracing" domain support
This change adds a new inspector domain for receiving Node tracing
data.
1. Node.js now can extend Inspector protocol with new domains with
the API defined in the src/inspector/node_protocol.pdl.
2. Plumbing code will be generated at the build time. /json/protocol
HTTP endpoint returns both V8 and Node.js inspector protocol.
3. "NodeTracing" domain was introduced. It is based on the Chrome
"Tracing" domain.
PR-URL: https://github.com/nodejs/node/pull/20608
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'src/tracing/node_trace_buffer.h')
-rw-r--r-- | src/tracing/node_trace_buffer.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/tracing/node_trace_buffer.h b/src/tracing/node_trace_buffer.h index 4d725ce31f..f08e6a69da 100644 --- a/src/tracing/node_trace_buffer.h +++ b/src/tracing/node_trace_buffer.h @@ -1,8 +1,8 @@ #ifndef SRC_TRACING_NODE_TRACE_BUFFER_H_ #define SRC_TRACING_NODE_TRACE_BUFFER_H_ +#include "tracing/agent.h" #include "node_mutex.h" -#include "tracing/node_trace_writer.h" #include "libplatform/v8-tracing.h" #include <atomic> @@ -19,8 +19,7 @@ class NodeTraceBuffer; class InternalTraceBuffer { public: - InternalTraceBuffer(size_t max_chunks, uint32_t id, - NodeTraceWriter* trace_writer); + InternalTraceBuffer(size_t max_chunks, uint32_t id, Agent* agent); TraceObject* AddTraceEvent(uint64_t* handle); TraceObject* GetEventByHandle(uint64_t handle); @@ -42,7 +41,7 @@ class InternalTraceBuffer { Mutex mutex_; bool flushing_; size_t max_chunks_; - NodeTraceWriter* trace_writer_; + Agent* agent_; std::vector<std::unique_ptr<TraceBufferChunk>> chunks_; size_t total_chunks_ = 0; uint32_t current_chunk_seq_ = 1; @@ -51,8 +50,7 @@ class InternalTraceBuffer { class NodeTraceBuffer : public TraceBuffer { public: - NodeTraceBuffer(size_t max_chunks, NodeTraceWriter* trace_writer, - uv_loop_t* tracing_loop); + NodeTraceBuffer(size_t max_chunks, Agent* agent, uv_loop_t* tracing_loop); ~NodeTraceBuffer(); TraceObject* AddTraceEvent(uint64_t* handle) override; @@ -74,7 +72,7 @@ class NodeTraceBuffer : public TraceBuffer { Mutex exit_mutex_; // Used to wait until async handles have been closed. ConditionVariable exit_cond_; - std::unique_ptr<NodeTraceWriter> trace_writer_; + Agent* agent_; std::atomic<InternalTraceBuffer*> current_buf_; InternalTraceBuffer buffer1_; InternalTraceBuffer buffer2_; |