GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: tracing/trace_event.cc Lines: 19 19 100.0 %
Date: 2022-11-05 03:21:31 Branches: 2 2 100.0 %

Line Branch Exec Source
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
10
11182
void TraceEventHelper::SetAgent(Agent* agent) {
11
11182
  if (agent) {
12
5595
    g_agent = agent;
13
5595
    g_controller = agent->GetTracingController();
14
  } else {
15
5587
    g_agent = nullptr;
16
5587
    g_controller = nullptr;
17
  }
18
11182
}
19
20
1586
Agent* TraceEventHelper::GetAgent() {
21
1586
  return g_agent;
22
}
23
24
1817413
v8::TracingController* TraceEventHelper::GetTracingController() {
25
1817413
  return g_controller;
26
}
27
28
5604
void TraceEventHelper::SetTracingController(v8::TracingController* controller) {
29
5604
  g_controller = controller;
30
5604
}
31
32
}  // namespace tracing
33
34
3
v8::TracingController* GetTracingController() {
35
3
  return tracing::TraceEventHelper::GetTracingController();
36
}
37
38
5604
void SetTracingController(v8::TracingController* controller) {
39
5604
  tracing::TraceEventHelper::SetTracingController(controller);
40
5604
}
41
42
}  // namespace node