Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
src: refactor tracing_agent into v8_platform
Move tracing_agent global into the v8_platform struct, renaming it to
tracing_agent_; CHECK(tracing_agent_ == nullptr) in StartTracingAgent()
to detect double calls; and relace another tracing_agent->Stop() call
with a call to StopTracingAgent().
  • Loading branch information
mykmelez committed Feb 2, 2017
commit b93584b6e32cd137ec32f0e90085991b1fcfa0ff
11 changes: 6 additions & 5 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ static uv_async_t dispatch_debug_messages_async;

static Mutex node_isolate_mutex;
static v8::Isolate* node_isolate;
static tracing::Agent* tracing_agent;

static node::DebugOptions debug_options;

Expand Down Expand Up @@ -229,15 +228,17 @@ static struct {
#endif // HAVE_INSPECTOR

void StartTracingAgent() {
tracing_agent = new tracing::Agent();
tracing_agent->Start(platform_, trace_enabled_categories);
CHECK(tracing_agent_ == nullptr);
tracing_agent_ = new tracing::Agent();
tracing_agent_->Start(platform_, trace_enabled_categories);
}

void StopTracingAgent() {
tracing_agent->Stop();
tracing_agent_->Stop();
}

v8::Platform* platform_;
tracing::Agent* tracing_agent_;
#else // !NODE_USE_V8_PLATFORM
void Initialize(int thread_pool_size) {}
void PumpMessageLoop(Isolate* isolate) {}
Expand Down Expand Up @@ -3401,7 +3402,7 @@ void SetupProcessObject(Environment* env,
void SignalExit(int signo) {
uv_tty_reset_mode();
if (trace_enabled) {
tracing_agent->Stop();
v8_platform.StopTracingAgent();
}
#ifdef __FreeBSD__
// FreeBSD has a nasty bug, see RegisterSignalHandler for details
Expand Down