diff options
author | James M Snell <jasnell@gmail.com> | 2018-05-14 09:25:50 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2018-07-22 07:36:27 -0700 |
commit | f7454a53f1318837ea2ca8f2ad495a9869b80e81 (patch) | |
tree | 309e7f3b9d3662a16dd2ecfcbc615a10aaf31b46 /src/node_constants.cc | |
parent | a706456f71e28d4317beb0bf9da7a31adbf11ca5 (diff) | |
download | node-new-f7454a53f1318837ea2ca8f2ad495a9869b80e81.tar.gz |
trace_events: add support for builtin trace
PR-URL: https://github.com/nodejs/node/pull/21899
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'src/node_constants.cc')
-rw-r--r-- | src/node_constants.cc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/node_constants.cc b/src/node_constants.cc index c1e39244b3..61aa42a8ef 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -1282,6 +1282,35 @@ void DefineDLOpenConstants(Local<Object> target) { #endif } +void DefineTraceConstants(Local<Object> target) { + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_BEGIN); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_END); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_COMPLETE); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_INSTANT); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_ASYNC_BEGIN); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_ASYNC_STEP_INTO); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_ASYNC_STEP_PAST); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_ASYNC_END); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_NESTABLE_ASYNC_END); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_FLOW_BEGIN); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_FLOW_STEP); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_FLOW_END); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_METADATA); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_COUNTER); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_SAMPLE); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_CREATE_OBJECT); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_SNAPSHOT_OBJECT); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_DELETE_OBJECT); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_MEMORY_DUMP); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_MARK); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_CLOCK_SYNC); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_ENTER_CONTEXT); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_LEAVE_CONTEXT); + NODE_DEFINE_CONSTANT(target, TRACE_EVENT_PHASE_LINK_IDS); +} + } // anonymous namespace void DefineConstants(v8::Isolate* isolate, Local<Object> target) { @@ -1315,6 +1344,10 @@ void DefineConstants(v8::Isolate* isolate, Local<Object> target) { CHECK(dlopen_constants->SetPrototype(env->context(), Null(env->isolate())).FromJust()); + Local<Object> trace_constants = Object::New(isolate); + CHECK(trace_constants->SetPrototype(env->context(), + Null(env->isolate())).FromJust()); + DefineErrnoConstants(err_constants); DefineWindowsErrorConstants(err_constants); DefineSignalConstants(sig_constants); @@ -1323,6 +1356,7 @@ void DefineConstants(v8::Isolate* isolate, Local<Object> target) { DefineCryptoConstants(crypto_constants); DefineZlibConstants(zlib_constants); DefineDLOpenConstants(dlopen_constants); + DefineTraceConstants(trace_constants); // Define libuv constants. NODE_DEFINE_CONSTANT(os_constants, UV_UDP_REUSEADDR); @@ -1334,6 +1368,7 @@ void DefineConstants(v8::Isolate* isolate, Local<Object> target) { target->Set(OneByteString(isolate, "fs"), fs_constants); target->Set(OneByteString(isolate, "crypto"), crypto_constants); target->Set(OneByteString(isolate, "zlib"), zlib_constants); + target->Set(OneByteString(isolate, "trace"), trace_constants); } } // namespace node |