diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-06-11 23:36:19 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-06-16 01:04:31 +0200 |
commit | b371213d3d2b499f0392af2103cf45262e1042d3 (patch) | |
tree | 4ecab834769e41ad870cc7658ee8cf891b778550 /src/node.h | |
parent | f645cc73185f1d690e82b01907e2c0da330a26de (diff) | |
download | node-new-b371213d3d2b499f0392af2103cf45262e1042d3.tar.gz |
src: add public APIs to manage v8::TracingController
We added a hack for this a while ago for Electron, so let’s remove
that hack and make this an official API.
Refs: https://github.com/nodejs/node/pull/28724
Refs: https://github.com/nodejs/node/issues/33800
PR-URL: https://github.com/nodejs/node/pull/33850
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'src/node.h')
-rw-r--r-- | src/node.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/node.h b/src/node.h index 72989617f7..b3b7c0c169 100644 --- a/src/node.h +++ b/src/node.h @@ -505,6 +505,15 @@ NODE_EXTERN MultiIsolatePlatform* CreatePlatform( v8::TracingController* tracing_controller); NODE_EXTERN void FreePlatform(MultiIsolatePlatform* platform); +// Get/set the currently active tracing controller. Using CreatePlatform() +// will implicitly set this by default. This is global and should be initialized +// along with the v8::Platform instance that is being used. `controller` +// is allowed to be `nullptr`. +// This is used for tracing events from Node.js itself. V8 uses the tracing +// controller returned from the active `v8::Platform` instance. +NODE_EXTERN v8::TracingController* GetTracingController(); +NODE_EXTERN void SetTracingController(v8::TracingController* controller); + NODE_EXTERN void EmitBeforeExit(Environment* env); NODE_EXTERN int EmitExit(Environment* env); NODE_EXTERN void RunAtExit(Environment* env); |