From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@atlassian.com>
Date: Fri, 26 Oct 2018 15:35:13 +1100
Subject: fix: expose tracing::Agent and use tracing::TracingController instead
 of v8::TracingController

diff --git a/src/api/environment.cc b/src/api/environment.cc
index 138f9ada984a952a6ecf8089ddb31bc258a8d35b..356131156b4a714eebf4e202cd105f0f184e3852 100644
--- a/src/api/environment.cc
+++ b/src/api/environment.cc
@@ -314,6 +314,10 @@ MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform() {
   return per_process::v8_platform.Platform();
 }
 
+node::tracing::Agent* CreateAgent() {
+  return new node::tracing::Agent();
+}
+
 MultiIsolatePlatform* CreatePlatform(
     int thread_pool_size,
     node::tracing::TracingController* tracing_controller) {
diff --git a/src/node.h b/src/node.h
index 892dafd8031533d23a88298406356107409cbd0a..e3258434eba34124c71562225e295cd1807fdf7c 100644
--- a/src/node.h
+++ b/src/node.h
@@ -108,6 +108,7 @@ namespace node {
 
 namespace tracing {
 
+class Agent;
 class TracingController;
 
 }
@@ -338,6 +339,8 @@ NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local<v8::Context> context);
 // it returns nullptr.
 NODE_EXTERN MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform();
 
+NODE_EXTERN node::tracing::Agent* CreateAgent();
+
 NODE_EXTERN MultiIsolatePlatform* CreatePlatform(
     int thread_pool_size,
     node::tracing::TracingController* tracing_controller);
