1 #include "tracing/trace_event.h" 2 #include "node.h" 3 4 namespace node { 5 namespace tracing { 6 7 Agent* g_agent = nullptr; 8 v8::TracingController* g_controller = nullptr; 9 SetAgent(Agent * agent)10void TraceEventHelper::SetAgent(Agent* agent) { 11 if (agent) { 12 g_agent = agent; 13 g_controller = agent->GetTracingController(); 14 } else { 15 g_agent = nullptr; 16 g_controller = nullptr; 17 } 18 } 19 GetAgent()20Agent* TraceEventHelper::GetAgent() { 21 return g_agent; 22 } 23 GetTracingController()24v8::TracingController* TraceEventHelper::GetTracingController() { 25 return g_controller; 26 } 27 SetTracingController(v8::TracingController * controller)28void TraceEventHelper::SetTracingController(v8::TracingController* controller) { 29 g_controller = controller; 30 } 31 32 } // namespace tracing 33 GetTracingController()34v8::TracingController* GetTracingController() { 35 return tracing::TraceEventHelper::GetTracingController(); 36 } 37 SetTracingController(v8::TracingController * controller)38void SetTracingController(v8::TracingController* controller) { 39 tracing::TraceEventHelper::SetTracingController(controller); 40 } 41 42 } // namespace node 43