GCC Code Coverage Report
Directory: ./ Exec Total Coverage
File: tracing/trace_event.cc Lines: 19 19 100.0 %
Date: 2022-11-04 03:21:42 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
11178
void TraceEventHelper::SetAgent(Agent* agent) {
11
11178
  if (agent) {
12
5593
    g_agent = agent;
13
5593
    g_controller = agent->GetTracingController();
14
  } else {
15
5585
    g_agent = nullptr;
16
5585
    g_controller = nullptr;
17
  }
18
11178
}
19
20
1586
Agent* TraceEventHelper::GetAgent() {
21
1586
  return g_agent;
22
}
23
24
1795367
v8::TracingController* TraceEventHelper::GetTracingController() {
25
1795367
  return g_controller;
26
}
27
28
5602
void TraceEventHelper::SetTracingController(v8::TracingController* controller) {
29
5602
  g_controller = controller;
30
5602
}
31
32
}  // namespace tracing
33
34
3
v8::TracingController* GetTracingController() {
35
3
  return tracing::TraceEventHelper::GetTracingController();
36
}
37
38
5602
void SetTracingController(v8::TracingController* controller) {
39
5602
  tracing::TraceEventHelper::SetTracingController(controller);
40
5602
}
41
42
}  // namespace node