summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2022-07-17 18:33:52 +0200
committerGitHub <noreply@github.com>2022-07-17 17:33:52 +0100
commitaa3a572e6bee116cde69508dc29478b40f40551a (patch)
tree8ba8f2359f27dc38644ae1065067d85d9b96a7ea
parent8baf372313a435722783e248ec7a02f02de3f332 (diff)
downloadnode-new-aa3a572e6bee116cde69508dc29478b40f40551a.tar.gz
build: remove dtrace & etw support
There are no clear indicators anyone is using the dtrace USDT probes. ETW support is very intertwined with the dtrace infrastructure. It's not clear if anyone uses ETW so to keep things simple it too is removed. Fixes: https://github.com/nodejs/node/issues/43649 PR-URL: https://github.com/nodejs/node/pull/43652 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
-rw-r--r--common.gypi3
-rwxr-xr-xconfigure.py44
-rw-r--r--doc/api/process.md1
-rw-r--r--lib/_http_client.js7
-rw-r--r--lib/_http_server.js6
-rw-r--r--lib/internal/dtrace.js21
-rw-r--r--lib/net.js6
-rw-r--r--node.gyp245
-rw-r--r--src/node.cc8
-rw-r--r--src/node.d315
-rw-r--r--src/node_binding.cc9
-rw-r--r--src/node_config.cc8
-rw-r--r--src/node_dtrace.cc323
-rw-r--r--src/node_dtrace.h86
-rw-r--r--src/node_external_reference.h7
-rw-r--r--src/node_provider.d80
-rw-r--r--src/node_win32_etw_provider-inl.h288
-rw-r--r--src/node_win32_etw_provider.cc213
-rw-r--r--src/node_win32_etw_provider.h99
-rw-r--r--src/res/node_etw_provider.man185
-rw-r--r--src/v8ustack.d695
-rw-r--r--test/parallel/test-bootstrap-modules.js6
-rw-r--r--test/parallel/test-internal-dtrace.js24
-rwxr-xr-xtools/install.py2
-rw-r--r--tools/msvs/msi/i18n/de-de.wxl3
-rw-r--r--tools/msvs/msi/i18n/en-us.wxl3
-rw-r--r--tools/msvs/msi/i18n/it-it.wxl3
-rw-r--r--tools/msvs/msi/i18n/zh-cn.wxl3
-rw-r--r--tools/msvs/msi/nodemsi.wixproj12
-rwxr-xr-xtools/msvs/msi/product.wxs15
-rw-r--r--vcbuild.bat12
31 files changed, 10 insertions, 2722 deletions
diff --git a/common.gypi b/common.gypi
index 851816e084..3b9dd77759 100644
--- a/common.gypi
+++ b/common.gypi
@@ -546,9 +546,6 @@
}],
],
}],
- ['OS=="freebsd" and node_use_dtrace=="true"', {
- 'libraries': [ '-lelf' ],
- }],
['OS=="freebsd"', {
'ldflags': [
'-Wl,--export-dynamic',
diff --git a/configure.py b/configure.py
index d6b92ea42b..5b4f950e2b 100755
--- a/configure.py
+++ b/configure.py
@@ -508,18 +508,6 @@ parser.add_argument('--with-mips-float-abi',
help='MIPS floating-point ABI ({0}) [default: %(default)s]'.format(
', '.join(valid_mips_float_abi)))
-parser.add_argument('--with-dtrace',
- action='store_true',
- dest='with_dtrace',
- default=None,
- help='build with DTrace (default is true on sunos and darwin)')
-
-parser.add_argument('--with-etw',
- action='store_true',
- dest='with_etw',
- default=None,
- help='build with ETW (default is true on Windows)')
-
parser.add_argument('--use-largepages',
action='store_true',
dest='node_use_large_pages',
@@ -628,18 +616,6 @@ http2_optgroup.add_argument('--debug-nghttp2',
parser.add_argument_group(http2_optgroup)
-parser.add_argument('--without-dtrace',
- action='store_true',
- dest='without_dtrace',
- default=None,
- help='build without DTrace')
-
-parser.add_argument('--without-etw',
- action='store_true',
- dest='without_etw',
- default=None,
- help='build without ETW')
-
parser.add_argument('--without-npm',
action='store_true',
dest='without_npm',
@@ -1306,18 +1282,6 @@ def configure_node(o):
o['variables']['enable_lto'] = b(options.enable_lto)
- if flavor in ('solaris', 'mac', 'linux', 'freebsd'):
- use_dtrace = not options.without_dtrace
- # Don't enable by default on linux and freebsd
- if flavor in ('linux', 'freebsd'):
- use_dtrace = options.with_dtrace
- o['variables']['node_use_dtrace'] = b(use_dtrace)
- elif options.with_dtrace:
- raise Exception(
- 'DTrace is currently only supported on SunOS, MacOS or Linux systems.')
- else:
- o['variables']['node_use_dtrace'] = 'false'
-
if options.node_use_large_pages or options.node_use_large_pages_script_lld:
warn('''The `--use-largepages` and `--use-largepages-script-lld` options
have no effect during build time. Support for mapping to large pages is
@@ -1328,14 +1292,6 @@ def configure_node(o):
if options.no_ifaddrs:
o['defines'] += ['SUNOS_NO_IFADDRS']
- # By default, enable ETW on Windows.
- if flavor == 'win':
- o['variables']['node_use_etw'] = b(not options.without_etw)
- elif options.with_etw:
- raise Exception('ETW is only supported on Windows.')
- else:
- o['variables']['node_use_etw'] = 'false'
-
o['variables']['node_with_ltcg'] = b(options.with_ltcg)
if flavor != 'win' and options.with_ltcg:
raise Exception('Link Time Code Generation is only supported on Windows.')
diff --git a/doc/api/process.md b/doc/api/process.md
index 538020ff86..b38ef46189 100644
--- a/doc/api/process.md
+++ b/doc/api/process.md
@@ -1075,7 +1075,6 @@ An example of the possible output looks like:
node_shared_http_parser: 'false',
node_shared_libuv: 'false',
node_shared_zlib: 'false',
- node_use_dtrace: 'false',
node_use_openssl: 'true',
node_shared_openssl: 'false',
strict_aliasing: 'true',
diff --git a/lib/_http_client.js b/lib/_http_client.js
index 98ebdfc5b7..6697735187 100644
--- a/lib/_http_client.js
+++ b/lib/_http_client.js
@@ -78,11 +78,6 @@ const {
} = require('internal/validators');
const { getTimerDuration } = require('internal/timers');
const {
- DTRACE_HTTP_CLIENT_REQUEST,
- DTRACE_HTTP_CLIENT_RESPONSE
-} = require('internal/dtrace');
-
-const {
hasObserver,
startPerf,
stopPerf,
@@ -356,7 +351,6 @@ ObjectSetPrototypeOf(ClientRequest.prototype, OutgoingMessage.prototype);
ObjectSetPrototypeOf(ClientRequest, OutgoingMessage);
ClientRequest.prototype._finish = function _finish() {
- DTRACE_HTTP_CLIENT_REQUEST(this, this.socket);
FunctionPrototypeCall(OutgoingMessage.prototype._finish, this);
if (hasObserver('http')) {
startPerf(this, kClientRequestStatistics, {
@@ -642,7 +636,6 @@ function parserOnIncomingClient(res, shouldKeepAlive) {
req.shouldKeepAlive = false;
}
- DTRACE_HTTP_CLIENT_RESPONSE(socket, req);
if (req[kClientRequestStatistics] && hasObserver('http')) {
stopPerf(req, kClientRequestStatistics, {
detail: {
diff --git a/lib/_http_server.js b/lib/_http_server.js
index 0eedace9ea..dbb9de4c13 100644
--- a/lib/_http_server.js
+++ b/lib/_http_server.js
@@ -79,10 +79,6 @@ const {
validateBoolean
} = require('internal/validators');
const Buffer = require('buffer').Buffer;
-const {
- DTRACE_HTTP_SERVER_REQUEST,
- DTRACE_HTTP_SERVER_RESPONSE
-} = require('internal/dtrace');
const { setInterval, clearInterval } = require('timers');
let debug = require('internal/util/debuglog').debuglog('http', (fn) => {
debug = fn;
@@ -215,7 +211,6 @@ ObjectSetPrototypeOf(ServerResponse.prototype, OutgoingMessage.prototype);
ObjectSetPrototypeOf(ServerResponse, OutgoingMessage);
ServerResponse.prototype._finish = function _finish() {
- DTRACE_HTTP_SERVER_RESPONSE(this.socket);
if (this[kServerResponseStatistics] && hasObserver('http')) {
stopPerf(this, kServerResponseStatistics, {
detail: {
@@ -944,7 +939,6 @@ function parserOnIncoming(server, socket, state, req, keepAlive) {
res.shouldKeepAlive = keepAlive;
res[kUniqueHeaders] = server[kUniqueHeaders];
- DTRACE_HTTP_SERVER_REQUEST(req, socket);
if (onRequestStartChannel.hasSubscribers) {
onRequestStartChannel.publish({
diff --git a/lib/internal/dtrace.js b/lib/internal/dtrace.js
deleted file mode 100644
index 8eb1df7807..0000000000
--- a/lib/internal/dtrace.js
+++ /dev/null
@@ -1,21 +0,0 @@
-'use strict';
-
-const config = internalBinding('config');
-
-const {
- DTRACE_HTTP_CLIENT_REQUEST = () => {},
- DTRACE_HTTP_CLIENT_RESPONSE = () => {},
- DTRACE_HTTP_SERVER_REQUEST = () => {},
- DTRACE_HTTP_SERVER_RESPONSE = () => {},
- DTRACE_NET_SERVER_CONNECTION = () => {},
- DTRACE_NET_STREAM_END = () => {}
-} = (config.hasDtrace ? internalBinding('dtrace') : {});
-
-module.exports = {
- DTRACE_HTTP_CLIENT_REQUEST,
- DTRACE_HTTP_CLIENT_RESPONSE,
- DTRACE_HTTP_SERVER_REQUEST,
- DTRACE_HTTP_SERVER_RESPONSE,
- DTRACE_NET_SERVER_CONNECTION,
- DTRACE_NET_STREAM_END
-};
diff --git a/lib/net.js b/lib/net.js
index b446e21847..d6e0ad679f 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -111,10 +111,6 @@ const {
validateString
} = require('internal/validators');
const kLastWriteQueueSize = Symbol('lastWriteQueueSize');
-const {
- DTRACE_NET_SERVER_CONNECTION,
- DTRACE_NET_STREAM_END
-} = require('internal/dtrace');
// Lazy loaded to improve startup performance.
let cluster;
@@ -654,7 +650,6 @@ Socket.prototype._read = function(n) {
Socket.prototype.end = function(data, encoding, callback) {
stream.Duplex.prototype.end.call(this,
data, encoding, callback);
- DTRACE_NET_STREAM_END(this);
return this;
};
@@ -1711,7 +1706,6 @@ function onconnection(err, clientHandle) {
socket.server = self;
socket._server = self;
- DTRACE_NET_SERVER_CONNECTION(socket);
self.emit('connection', socket);
}
diff --git a/node.gyp b/node.gyp
index 03f2dbdf94..a5106284fc 100644
--- a/node.gyp
+++ b/node.gyp
@@ -4,8 +4,6 @@
'v8_trace_maps%': 0,
'v8_enable_pointer_compression%': 0,
'v8_enable_31bit_smis_on_64bit_arch%': 0,
- 'node_use_dtrace%': 'false',
- 'node_use_etw%': 'false',
'node_no_browser_globals%': 'false',
'node_snapshot_main%': '',
'node_use_node_snapshot%': 'false',
@@ -236,16 +234,6 @@
'-Wl,--no-whole-archive',
],
}],
- [ 'OS=="win"', {
- 'sources': [ 'src/res/node.rc' ],
- 'conditions': [
- [ 'node_use_etw=="true"', {
- 'sources': [
- 'tools/msvs/genfiles/node_etw_provider.rc'
- ],
- }],
- ],
- }],
],
}],
[ 'node_shared=="true"', {
@@ -755,72 +743,6 @@
'Ws2_32',
],
}],
- [ 'node_use_etw=="true"', {
- 'defines': [ 'HAVE_ETW=1' ],
- 'dependencies': [ 'node_etw' ],
- 'include_dirs': [
- 'src',
- 'tools/msvs/genfiles',
- '<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
- ],
- 'sources': [
- 'src/node_win32_etw_provider.h',
- 'src/node_win32_etw_provider-inl.h',
- 'src/node_win32_etw_provider.cc',
- 'src/node_dtrace.h',
- 'src/node_dtrace.cc',
- 'tools/msvs/genfiles/node_etw_provider.h',
- ],
- 'conditions': [
- ['node_intermediate_lib_type != "static_library"', {
- 'sources': [
- 'tools/msvs/genfiles/node_etw_provider.rc',
- ],
- }],
- ],
- }],
- [ 'node_use_dtrace=="true"', {
- 'defines': [ 'HAVE_DTRACE=1' ],
- 'dependencies': [
- 'node_dtrace_header',
- 'specialize_node_d',
- ],
- 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ],
- #
- # DTrace is supported on linux, solaris, mac, and bsd. There are
- # three object files associated with DTrace support, but they're
- # not all used all the time:
- #
- # node_dtrace.o all configurations
- # node_dtrace_ustack.o not supported on mac and linux
- # node_dtrace_provider.o All except OS X. "dtrace -G" is not
- # used on OS X.
- #
- # Note that node_dtrace_provider.cc and node_dtrace_ustack.cc do not
- # actually exist. They're listed here to trick GYP into linking the
- # corresponding object files into the final "node" executable. These
- # object files are generated by "dtrace -G" using custom actions
- # below, and the GYP-generated Makefiles will properly build them when
- # needed.
- #
- 'sources': [
- 'src/node_dtrace.h',
- 'src/node_dtrace.cc',
- ],
- 'conditions': [
- [ 'OS=="linux"', {
- 'sources': [
- '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o'
- ],
- }],
- [ 'OS!="mac" and OS!="linux"', {
- 'sources': [
- 'src/node_dtrace_ustack.cc',
- 'src/node_dtrace_provider.cc',
- ]
- }
- ] ]
- } ],
[ 'node_use_openssl=="true"', {
'sources': [
'src/crypto/crypto_aes.cc',
@@ -955,164 +877,6 @@
},
],
}, # node_lib_target_name
- {
- # generate ETW header and resource files
- 'target_name': 'node_etw',
- 'type': 'none',
- 'conditions': [
- [ 'node_use_etw=="true"', {
- 'actions': [
- {
- 'action_name': 'node_etw',
- 'inputs': [ 'src/res/node_etw_provider.man' ],
- 'outputs': [
- 'tools/msvs/genfiles/node_etw_provider.rc',
- 'tools/msvs/genfiles/node_etw_provider.h',
- 'tools/msvs/genfiles/node_etw_providerTEMP.BIN',
- ],
- 'action': [ 'mc <@(_inputs) -h tools/msvs/genfiles -r tools/msvs/genfiles' ]
- }
- ]
- } ]
- ]
- }, # node_etw
- {
- 'target_name': 'node_dtrace_header',
- 'type': 'none',
- 'conditions': [
- [ 'node_use_dtrace=="true" and OS!="linux"', {
- 'actions': [
- {
- 'action_name': 'node_dtrace_header',
- 'inputs': [ 'src/node_provider.d' ],
- 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/node_provider.h' ],
- 'action': [ 'dtrace', '-h', '-xnolibs', '-s', '<@(_inputs)',
- '-o', '<@(_outputs)' ]
- }
- ]
- } ],
- [ 'node_use_dtrace=="true" and OS=="linux"', {
- 'actions': [
- {
- 'action_name': 'node_dtrace_header',
- 'inputs': [ 'src/node_provider.d' ],
- 'outputs': [ '<(SHARED_INTERMEDIATE_DIR)/node_provider.h' ],
- 'action': [ 'dtrace', '-h', '-s', '<@(_inputs)',
- '-o', '<@(_outputs)' ]
- }
- ]
- } ],
- ]
- }, # node_dtrace_header
- {
- 'target_name': 'node_dtrace_provider',
- 'type': 'none',
- 'conditions': [
- [ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', {
- 'actions': [
- {
- 'action_name': 'node_dtrace_provider_o',
- 'inputs': [
- '<(obj_dir)/<(node_lib_target_name)/src/node_dtrace.o',
- ],
- 'outputs': [
- '<(obj_dir)/<(node_lib_target_name)/src/node_dtrace_provider.o'
- ],
- 'action': [ 'dtrace', '-G', '-xnolibs', '-s', 'src/node_provider.d',
- '<@(_inputs)', '-o', '<@(_outputs)' ]
- }
- ]
- }],
- [ 'node_use_dtrace=="true" and OS=="linux"', {
- 'actions': [
- {
- 'action_name': 'node_dtrace_provider_o',
- 'inputs': [ 'src/node_provider.d' ],
- 'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o'
- ],
- 'action': [
- 'dtrace', '-C', '-G', '-s', '<@(_inputs)', '-o', '<@(_outputs)'
- ],
- }
- ],
- }],
- ]
- }, # node_dtrace_provider
- {
- 'target_name': 'node_dtrace_ustack',
- 'type': 'none',
- 'conditions': [
- [ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', {
- 'actions': [
- {
- 'action_name': 'node_dtrace_ustack_constants',
- 'inputs': [
- '<(obj_dir)/tools/v8_gypfiles/<(STATIC_LIB_PREFIX)v8_base_without_compiler<(STATIC_LIB_SUFFIX)'
- ],
- 'outputs': [
- '<(SHARED_INTERMEDIATE_DIR)/v8constants.h'
- ],
- 'action': [
- 'tools/genv8constants.py',
- '<@(_outputs)',
- '<@(_inputs)'
- ]
- },
- {
- 'action_name': 'node_dtrace_ustack',
- 'inputs': [
- 'src/v8ustack.d',
- '<(SHARED_INTERMEDIATE_DIR)/v8constants.h'
- ],
- 'outputs': [
- '<(obj_dir)/<(node_lib_target_name)/src/node_dtrace_ustack.o'
- ],
- 'conditions': [
- [ 'target_arch=="ia32" or target_arch=="arm"', {
- 'action': [
- 'dtrace', '-32', '-I<(SHARED_INTERMEDIATE_DIR)', '-Isrc',
- '-C', '-G', '-s', 'src/v8ustack.d', '-o', '<@(_outputs)',
- ]
- } ],
- [ 'target_arch=="x64"', {
- 'action': [
- 'dtrace', '-64', '-I<(SHARED_INTERMEDIATE_DIR)', '-Isrc',
- '-C', '-G', '-s', 'src/v8ustack.d', '-o', '<@(_outputs)',
- ]
- } ],
- ]
- },
- ]
- } ],
- ]
- }, # node_dtrace_ustack
- {
- 'target_name': 'specialize_node_d',
- 'type': 'none',
- 'conditions': [
- [ 'node_use_dtrace=="true"', {
- 'actions': [
- {
- 'action_name': 'specialize_node_d',
- 'inputs': [
- 'src/node.d'
- ],
- 'outputs': [
- '<(PRODUCT_DIR)/node.d',
- ],
- 'action': [
- 'tools/specialize_node_d.py',
- '<@(_outputs)',
- '<@(_inputs)',
- '<@(OS)',
- '<@(target_arch)',
- ],
- },
- ],
- } ],
- ]
- }, # specialize_node_d
{ # fuzz_url
'target_name': 'fuzz_url',
'type': 'executable',
@@ -1151,9 +915,6 @@
'<(node_lib_target_name)',
'deps/histogram/histogram.gyp:histogram',
'deps/uvwasi/uvwasi.gyp:uvwasi',
- 'node_dtrace_header',
- 'node_dtrace_ustack',
- 'node_dtrace_provider',
],
'includes': [
'node.gypi'
@@ -1197,9 +958,6 @@
'deps/googletest/googletest.gyp:gtest_main',
'deps/histogram/histogram.gyp:histogram',
'deps/uvwasi/uvwasi.gyp:uvwasi',
- 'node_dtrace_header',
- 'node_dtrace_ustack',
- 'node_dtrace_provider',
],
'includes': [
@@ -1295,9 +1053,6 @@
'<(node_lib_target_name)',
'deps/histogram/histogram.gyp:histogram',
'deps/uvwasi/uvwasi.gyp:uvwasi',
- 'node_dtrace_header',
- 'node_dtrace_ustack',
- 'node_dtrace_provider',
],
'includes': [
diff --git a/src/node.cc b/src/node.cc
index b54abb3af8..9f9dbb214c 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -55,10 +55,6 @@
#include "inspector_io.h"
#endif
-#if defined HAVE_DTRACE || defined HAVE_ETW
-#include "node_dtrace.h"
-#endif
-
#if NODE_USE_V8_PLATFORM
#include "libplatform/libplatform.h"
#endif // NODE_USE_V8_PLATFORM
@@ -292,10 +288,6 @@ void Environment::InitializeDiagnostics() {
env->isolate()->SetAtomicsWaitCallback(nullptr, nullptr);
}, this);
}
-
-#if defined HAVE_DTRACE || defined HAVE_ETW
- InitDTrace(this);
-#endif
}
MaybeLocal<Value> Environment::BootstrapInternalLoaders() {
diff --git a/src/node.d b/src/node.d
deleted file mode 100644
index fae2378437..0000000000
--- a/src/node.d
+++ /dev/null
@@ -1,315 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to permit
- * persons to whom the Software is furnished to do so, subject to the
- * following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
- * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * This is the DTrace library file for the node provider, which includes
- * the necessary translators to get from the args[] to something useful.
- * Be warned: the mechanics here are seriously ugly -- and one must always
- * keep in mind that clean abstractions often require filthy systems.
- */
-#pragma D depends_on library procfs.d
-
-typedef struct {
- int32_t fd;
- int32_t port;
- uint32_t remote;
- uint32_t buffered;
-} node_dtrace_connection_t;
-
-typedef struct {
- int32_t fd;
- int32_t port;
- uint64_t remote;
- uint32_t buffered;
-} node_dtrace_connection64_t;
-
-typedef struct {
- int fd;
- string remoteAddress;
- int remotePort;
- int bufferSize;
-} node_connection_t;
-
-translator node_connection_t <node_dtrace_connection_t *nc> {
- fd = *(int32_t *)copyin((uintptr_t)&nc->fd, sizeof (int32_t));
- remotePort =
- *(int32_t *)copyin((uintptr_t)&nc->port, sizeof (int32_t));
- remoteAddress = curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr((uintptr_t)*(uint32_t *)copyin((uintptr_t)&nc->remote,
- sizeof (int32_t))) :
- copyinstr((uintptr_t)*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_connection64_t *)nc)->remote, sizeof (int64_t)));
- bufferSize = curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- *(uint32_t *)copyin((uintptr_t)&nc->buffered, sizeof (int32_t)) :
- *(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_connection64_t *)nc)->buffered, sizeof (int32_t));
-};
-
-/*
- * 32-bit and 64-bit structures received from node for HTTP client request
- * probe.
- */
-typedef struct {
- uint32_t url;
- uint32_t method;
-} node_dtrace_http_client_request_t;
-
-typedef struct {
- uint64_t url;
- uint64_t method;
-} node_dtrace_http_client_request64_t;
-
-/*
- * The following structures are never used directly, but must exist to bind the
- * types specified in the provider to the translators defined here.
- * Ultimately, they always get cast to a more specific type inside the
- * translator. To add to the confusion, the DTrace compiler does not allow
- * declaring two translators with the same destination type if the source types
- * are structures with the same size (because libctf says they're compatible,
- * so dtrace considers them equivalent). Since we must define translators from
- * node_dtrace_http_client_request_t (above), node_dtrace_http_request_t, and
- * node_dtrace_http_server_request_t (both below), each of these three structs
- * must be declared with a different size.
- */
-typedef struct {
- uint32_t version;
- uint64_t dummy1;
-} node_dtrace_http_request_t;
-
-typedef struct {
- uint32_t version;
- uint64_t dummy2;
- uint64_t dummy3;
-} node_dtrace_http_server_request_t;
-
-/*
- * Actual 32-bit and 64-bit, v0 and v1 structures received from node for the
- * HTTP server request probe.
- */
-typedef struct {
- uint32_t url;
- uint32_t method;
-} node_dtrace_http_server_request_v0_t;
-
-typedef struct {
- uint32_t version;
- uint32_t url;
- uint32_t method;
- uint32_t forwardedFor;
-} node_dtrace_http_server_request_v1_t;
-
-typedef struct {
- uint64_t url;
- uint64_t method;
-} node_dtrace_http_server_request64_v0_t;
-
-typedef struct {
- uint32_t version;
- uint32_t pad;
- uint64_t url;
- uint64_t method;
- uint64_t forwardedFor;
-} node_dtrace_http_server_request64_v1_t;
-
-/*
- * In the end, both client and server request probes from both old and new
- * binaries translate their arguments to node_http_request_t, which is what the
- * user's D script ultimately sees.
- */
-typedef struct {
- string url;
- string method;
- string forwardedFor;
-} node_http_request_t;
-
-/*
- * The following translators are particularly filthy for reasons of backwards
- * compatibility. Stable versions of node prior to 0.6 used a single
- * http_request struct with fields for "url" and "method" for both client and
- * server probes. 0.6 added a "forwardedFor" field intended for the server
- * probe only, and the http_request struct passed by the application was split
- * first into client_http_request and server_http_request and the latter was
- * again split for v0 (the old struct) and v1.
- *
- * To distinguish the binary representations of the two versions of these
- * structs, the new version prepends a "version" member (where the old one has
- * a "url" pointer). Each field that we're translating below first switches on
- * the value of this "version" field: if it's larger than 4096, we know we must
- * be looking at the "url" pointer of the older structure version. Otherwise,
- * we must be looking at the new version. Besides this, we have the usual
- * switch based on the userland process data model. This would all be simpler
- * with macros, but those aren't available in D library files since we cannot
- * rely on cpp being present at runtime.
- *
- * In retrospect, the versioning bit might have been unnecessary since the type
- * of the object passed in should allow DTrace to select which translator to
- * use. However, DTrace does sometimes use translators whose source types
- * don't quite match, and since we know this versioning logic works, we just
- * leave it alone. Each of the translators below is functionally identical
- * (except that the client -> client translator doesn't bother translating
- * forwardedFor) and should actually work with any version of any of the client
- * or server structs transmitted by the application up to this point.
- */
-
-/*
- * Translate from node_dtrace_http_server_request_t (received from node 0.6 and
- * later versions) to node_http_request_t.
- */
-translator node_http_request_t <node_dtrace_http_server_request_t *nd> {
- url = (*(uint32_t *)copyin((uintptr_t)(uint32_t *)nd,
- sizeof (uint32_t))) >= 4096 ?
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v0_t *)nd)->url,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v0_t *)nd)->url,
- sizeof (uint64_t)))) :
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v1_t *)nd)->url,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v1_t *)nd)->url,
- sizeof (uint64_t))));
-
- method = (*(uint32_t *)copyin((uintptr_t)(uint32_t *)nd,
- sizeof (uint32_t))) >= 4096 ?
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v0_t *)nd)->method,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v0_t *)nd)->method,
- sizeof (uint64_t)))) :
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v1_t *)nd)->method,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v1_t *)nd)->method,
- sizeof (uint64_t))));
-
- forwardedFor = (*(uint32_t *)copyin((uintptr_t)(uint32_t *)nd,
- sizeof (uint32_t))) >= 4096 ? "" :
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v1_t *)nd)->forwardedFor,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v1_t *)nd)->
- forwardedFor, sizeof (uint64_t))));
-};
-
-/*
- * Translate from node_dtrace_http_client_request_t (received from node 0.6 and
- * later versions) to node_http_request_t.
- */
-translator node_http_request_t <node_dtrace_http_client_request_t *nd> {
- url = (*(uint32_t *)copyin((uintptr_t)(uint32_t *)nd,
- sizeof (uint32_t))) >= 4096 ?
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v0_t *)nd)->url,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v0_t *)nd)->url,
- sizeof (uint64_t)))) :
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v1_t *)nd)->url,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v1_t *)nd)->url,
- sizeof (uint64_t))));
-
- method = (*(uint32_t *)copyin((uintptr_t)(uint32_t *)nd,
- sizeof (uint32_t))) >= 4096 ?
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v0_t *)nd)->method,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v0_t *)nd)->method,
- sizeof (uint64_t)))) :
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v1_t *)nd)->method,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v1_t *)nd)->method,
- sizeof (uint64_t))));
-
- forwardedFor = "";
-};
-
-/*
- * Translate from node_dtrace_http_request_t (received from versions of node
- * prior to 0.6) to node_http_request_t. This is used for both the server and
- * client probes since these versions of node didn't distinguish between the
- * types used in these probes.
- */
-translator node_http_request_t <node_dtrace_http_request_t *nd> {
- url = (*(uint32_t *)copyin((uintptr_t)(uint32_t *)nd,
- sizeof (uint32_t))) >= 4096 ?
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v0_t *)nd)->url,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v0_t *)nd)->url,
- sizeof (uint64_t)))) :
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v1_t *)nd)->url,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v1_t *)nd)->url,
- sizeof (uint64_t))));
-
- method = (*(uint32_t *)copyin((uintptr_t)(uint32_t *)nd,
- sizeof (uint32_t))) >= 4096 ?
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v0_t *)nd)->method,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v0_t *)nd)->method,
- sizeof (uint64_t)))) :
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v1_t *)nd)->method,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v1_t *)nd)->method,
- sizeof (uint64_t))));
-
- forwardedFor = (*(uint32_t *) copyin((uintptr_t)(uint32_t *)nd,
- sizeof (uint32_t))) >= 4096 ? "" :
- (curpsinfo->pr_dmodel == PR_MODEL_ILP32 ?
- copyinstr(*(uint32_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request_v1_t *)nd)->forwardedFor,
- sizeof (uint32_t))) :
- copyinstr(*(uint64_t *)copyin((uintptr_t)
- &((node_dtrace_http_server_request64_v1_t *)nd)->
- forwardedFor, sizeof (uint64_t))));
-};
diff --git a/src/node_binding.cc b/src/node_binding.cc
index 2991ee3474..2bf98af6d0 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -26,12 +26,6 @@
#define NODE_BUILTIN_PROFILER_MODULES(V)
#endif
-#if HAVE_DTRACE || HAVE_ETW
-#define NODE_BUILTIN_DTRACE_MODULES(V) V(dtrace)
-#else
-#define NODE_BUILTIN_DTRACE_MODULES(V)
-#endif
-
// A list of built-in modules. In order to do module registration
// in node::Init(), need to add built-in modules in the following list.
// Then in binding::RegisterBuiltinModules(), it calls modules' registration
@@ -96,8 +90,7 @@
NODE_BUILTIN_STANDARD_MODULES(V) \
NODE_BUILTIN_OPENSSL_MODULES(V) \
NODE_BUILTIN_ICU_MODULES(V) \
- NODE_BUILTIN_PROFILER_MODULES(V) \
- NODE_BUILTIN_DTRACE_MODULES(V)
+ NODE_BUILTIN_PROFILER_MODULES(V)
// This is used to load built-in modules. Instead of using
// __attribute__((constructor)), we call the _register_<modname>
diff --git a/src/node_config.cc b/src/node_config.cc
index 176daa88b0..5ad1dbae7c 100644
--- a/src/node_config.cc
+++ b/src/node_config.cc
@@ -75,13 +75,7 @@ static void Initialize(Local<Object> target,
READONLY_FALSE_PROPERTY(target, "noBrowserGlobals");
#endif // NODE_NO_BROWSER_GLOBALS
- READONLY_PROPERTY(target,
- "bits",
- Number::New(isolate, 8 * sizeof(intptr_t)));
-
-#if defined HAVE_DTRACE || defined HAVE_ETW
- READONLY_TRUE_PROPERTY(target, "hasDtrace");
-#endif
+ READONLY_PROPERTY(target, "bits", Number::New(isolate, 8 * sizeof(intptr_t)));
} // InitConfig
} // namespace node
diff --git a/src/node_dtrace.cc b/src/node_dtrace.cc
deleted file mode 100644
index 52e6399283..0000000000
--- a/src/node_dtrace.cc
+++ /dev/null
@@ -1,323 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#include "node_dtrace.h"
-
-#ifdef HAVE_DTRACE
-#include "node_provider.h"
-#elif HAVE_ETW
-#include "node_win32_etw_provider-inl.h"
-#else
-#define NODE_HTTP_SERVER_REQUEST(arg0, arg1)
-#define NODE_HTTP_SERVER_REQUEST_ENABLED() (0)
-#define NODE_HTTP_SERVER_RESPONSE(arg0)
-#define NODE_HTTP_SERVER_RESPONSE_ENABLED() (0)
-#define NODE_HTTP_CLIENT_REQUEST(arg0, arg1)
-#define NODE_HTTP_CLIENT_REQUEST_ENABLED() (0)
-#define NODE_HTTP_CLIENT_RESPONSE(arg0)
-#define NODE_HTTP_CLIENT_RESPONSE_ENABLED() (0)
-#define NODE_NET_SERVER_CONNECTION(arg0)
-#define NODE_NET_SERVER_CONNECTION_ENABLED() (0)
-#define NODE_NET_STREAM_END(arg0)
-#define NODE_NET_STREAM_END_ENABLED() (0)
-#define NODE_GC_START(arg0, arg1, arg2)
-#define NODE_GC_DONE(arg0, arg1, arg2)
-#endif
-
-#include "env-inl.h"
-#include "node_errors.h"
-#include "node_external_reference.h"
-
-#include <cstring>
-
-namespace node {
-
-using v8::Context;
-using v8::FunctionCallbackInfo;
-using v8::GCCallbackFlags;
-using v8::GCType;
-using v8::HandleScope;
-using v8::Isolate;
-using v8::Local;
-using v8::Object;
-using v8::Value;
-
-#define SLURP_STRING(obj, member, valp) \
- if (!(obj)->IsObject()) { \
- return node::THROW_ERR_INVALID_ARG_TYPE(env, \
- "expected object for " #obj " to contain string member " #member); \
- } \
- node::Utf8Value _##member(env->isolate(), \
- obj->Get(env->context(), \
- OneByteString(env->isolate(), #member)).ToLocalChecked()); \
- if ((*(const char **)valp = *_##member) == nullptr) \
- *(const char **)valp = "<unknown>";
-
-#define SLURP_INT(obj, member, valp) \
- if (!(obj)->IsObject()) { \
- return node::THROW_ERR_INVALID_ARG_TYPE( \
- env, \
- "expected object for " #obj " to contain integer member " #member); \
- } \
- *valp = obj->Get(env->context(), \
- OneByteString(env->isolate(), #member)).ToLocalChecked() \
- ->Int32Value(env->context()) \
- .FromJust();
-
-#define SLURP_OBJECT(obj, member, valp) \
- if (!(obj)->IsObject()) { \
- return node::THROW_ERR_INVALID_ARG_TYPE(env, \
- "expected object for " #obj " to contain object member " #member); \
- } \
- *valp = obj->Get(env->context(), \
- OneByteString(env->isolate(), #member)).ToLocalChecked().As<Object>();
-
-#define SLURP_CONNECTION(arg, conn) \
- if (!(arg)->IsObject()) { \
- return node::THROW_ERR_INVALID_ARG_TYPE(env, \
- "expected argument " #arg " to be a connection object"); \
- } \
- node_dtrace_connection_t conn; \
- Local<Object> _##conn = arg.As<Object>(); \
- Local<Value> _handle = \
- (_##conn)->Get(env->context(), \
- FIXED_ONE_BYTE_STRING(env->isolate(), "_handle")) \
- .ToLocalChecked(); \
- if (_handle->IsObject()) { \
- SLURP_INT(_handle.As<Object>(), fd, &conn.fd); \
- } else { \
- conn.fd = -1; \
- } \
- SLURP_STRING(_##conn, remoteAddress, &conn.remote); \
- SLURP_INT(_##conn, remotePort, &conn.port); \
- SLURP_INT(_##conn, bufferSize, &conn.buffered);
-
-#define SLURP_CONNECTION_HTTP_CLIENT(arg, conn) \
- if (!(arg)->IsObject()) { \
- return node::THROW_ERR_INVALID_ARG_TYPE(env, \
- "expected argument " #arg " to be a connection object"); \
- } \
- node_dtrace_connection_t conn; \
- Local<Object> _##conn = arg.As<Object>(); \
- SLURP_INT(_##conn, fd, &conn.fd); \
- SLURP_STRING(_##conn, host, &conn.remote); \
- SLURP_INT(_##conn, port, &conn.port); \
- SLURP_INT(_##conn, bufferSize, &conn.buffered);
-
-#define SLURP_CONNECTION_HTTP_CLIENT_RESPONSE(arg0, arg1, conn) \
- if (!(arg0)->IsObject()) { \
- return node::THROW_ERR_INVALID_ARG_TYPE(env, \
- "expected argument " #arg0 " to be a connection object"); \
- } \
- if (!(arg1)->IsObject()) { \
- return node::THROW_ERR_INVALID_ARG_TYPE(env, \
- "expected argument " #arg1 " to be a connection object"); \
- } \
- node_dtrace_connection_t conn; \
- Local<Object> _##conn = arg0.As<Object>(); \
- SLURP_INT(_##conn, fd, &conn.fd); \
- SLURP_INT(_##conn, bufferSize, &conn.buffered); \
- _##conn = arg1.As<Object>(); \
- SLURP_STRING(_##conn, host, &conn.remote); \
- SLURP_INT(_##conn, port, &conn.port);
-
-
-void DTRACE_NET_SERVER_CONNECTION(const FunctionCallbackInfo<Value>& args) {
- if (!NODE_NET_SERVER_CONNECTION_ENABLED())
- return;
- Environment* env = Environment::GetCurrent(args);
- SLURP_CONNECTION(args[0], conn);
- NODE_NET_SERVER_CONNECTION(&conn, conn.remote, conn.port, conn.fd);
-}
-
-
-void DTRACE_NET_STREAM_END(const FunctionCallbackInfo<Value>& args) {
- if (!NODE_NET_STREAM_END_ENABLED())
- return;
- Environment* env = Environment::GetCurrent(args);
- SLURP_CONNECTION(args[0], conn);
- NODE_NET_STREAM_END(&conn, conn.remote, conn.port, conn.fd);
-}
-
-void DTRACE_HTTP_SERVER_REQUEST(const FunctionCallbackInfo<Value>& args) {
- node_dtrace_http_server_request_t req;
-
- if (!NODE_HTTP_SERVER_REQUEST_ENABLED())
- return;
-
- Environment* env = Environment::GetCurrent(args);
- HandleScope scope(env->isolate());
- Local<Object> arg0 = args[0].As<Object>();
- Local<Object> headers;
-
- memset(&req, 0, sizeof(req));
- req._un.version = 1;
- SLURP_STRING(arg0, url, &req.url);
- SLURP_STRING(arg0, method, &req.method);
- SLURP_OBJECT(arg0, headers, &headers);
-
- if (!(headers)->IsObject()) {
- return node::THROW_ERR_INVALID_ARG_TYPE(env,
- "expected object for request to contain string member headers");
- }
-
- Local<Value> strfwdfor = headers->Get(
- env->context(), env->x_forwarded_string()).ToLocalChecked();
- node::Utf8Value fwdfor(env->isolate(), strfwdfor);
-
- if (!strfwdfor->IsString() || (req.forwardedFor = *fwdfor) == nullptr)
- req.forwardedFor = const_cast<char*>("");
-
- SLURP_CONNECTION(args[1], conn);
- NODE_HTTP_SERVER_REQUEST(&req, &conn, conn.remote, conn.port, req.method, \
- req.url, conn.fd);
-}
-
-
-void DTRACE_HTTP_SERVER_RESPONSE(const FunctionCallbackInfo<Value>& args) {
- if (!NODE_HTTP_SERVER_RESPONSE_ENABLED())
- return;
- Environment* env = Environment::GetCurrent(args);
- SLURP_CONNECTION(args[0], conn);
- NODE_HTTP_SERVER_RESPONSE(&conn, conn.remote, conn.port, conn.fd);
-}
-
-
-void DTRACE_HTTP_CLIENT_REQUEST(const FunctionCallbackInfo<Value>& args) {
- node_dtrace_http_client_request_t req;
- char* header;
-
- if (!NODE_HTTP_CLIENT_REQUEST_ENABLED())
- return;
-
- Environment* env = Environment::GetCurrent(args);
- HandleScope scope(env->isolate());
-
- /*
- * For the method and URL, we're going to dig them out of the header. This
- * is not as efficient as it could be, but we would rather not force the
- * caller here to retain their method and URL until the time at which
- * DTRACE_HTTP_CLIENT_REQUEST can be called.
- */
- Local<Object> arg0 = args[0].As<Object>();
- SLURP_STRING(arg0, _header, &header);
-
- req.method = header;
-
- while (*header != '\0' && *header != ' ')
- header++;
-
- if (*header != '\0')
- *header++ = '\0';
-
- req.url = header;
-
- while (*header != '\0' && *header != ' ')
- header++;
-
- *header = '\0';
-
- SLURP_CONNECTION_HTTP_CLIENT(args[1], conn);
- NODE_HTTP_CLIENT_REQUEST(&req, &conn, conn.remote, conn.port, req.method, \
- req.url, conn.fd);
-}
-
-
-void DTRACE_HTTP_CLIENT_RESPONSE(const FunctionCallbackInfo<Value>& args) {
- if (!NODE_HTTP_CLIENT_RESPONSE_ENABLED())
- return;
- Environment* env = Environment::GetCurrent(args);
- SLURP_CONNECTION_HTTP_CLIENT_RESPONSE(args[0], args[1], conn);
- NODE_HTTP_CLIENT_RESPONSE(&conn, conn.remote, conn.port, conn.fd);
-}
-
-void dtrace_gc_start(Isolate* isolate,
- GCType type,
- GCCallbackFlags flags,
- void* data) {
- // Previous versions of this probe point only logged type and flags.
- // That's why for reasons of backwards compatibility the isolate goes last.
- NODE_GC_START(type, flags, isolate);
-}
-
-void dtrace_gc_done(Isolate* isolate,
- GCType type,
- GCCallbackFlags flags,
- void* data) {
- // Previous versions of this probe point only logged type and flags.
- // That's why for reasons of backwards compatibility the isolate goes last.
- NODE_GC_DONE(type, flags, isolate);
-}
-
-
-void InitDTrace(Environment* env) {
-#ifdef HAVE_ETW
- // ETW is neither thread-safe nor does it clean up resources on exit,
- // so we can use it only on the main thread.
- if (env->is_main_thread()) {
- init_etw();
- }
-#endif
-
- // We need to use the variant of GC callbacks that takes data to
- // avoid running into DCHECKs when multiple Environments try to add
- // the same callback to the same isolate multiple times.
- env->isolate()->AddGCPrologueCallback(dtrace_gc_start, env);
- env->isolate()->AddGCEpilogueCallback(dtrace_gc_done, env);
- env->AddCleanupHook([](void* data) {
- Environment* env = static_cast<Environment*>(data);
- env->isolate()->RemoveGCPrologueCallback(dtrace_gc_start, env);
- env->isolate()->RemoveGCEpilogueCallback(dtrace_gc_done, env);
- }, env);
-}
-
-#define NODE_PROBES(V) \
- V(DTRACE_NET_SERVER_CONNECTION) \
- V(DTRACE_NET_STREAM_END) \
- V(DTRACE_HTTP_SERVER_REQUEST) \
- V(DTRACE_HTTP_SERVER_RESPONSE) \
- V(DTRACE_HTTP_CLIENT_REQUEST) \
- V(DTRACE_HTTP_CLIENT_RESPONSE)
-
-void InitializeDTrace(Local<Object> target,
- Local<Value> unused,
- Local<Context> context,
- void* priv) {
- Environment* env = Environment::GetCurrent(context);
-
-#if defined HAVE_DTRACE || defined HAVE_ETW
-#define V(name) env->SetMethod(target, #name, name);
- NODE_PROBES(V)
-#undef V
-#endif // defined HAVE_DTRACE || defined HAVE_ETW
-}
-
-void RegisterDtraceExternalReferences(ExternalReferenceRegistry* registry) {
-#if defined HAVE_DTRACE || defined HAVE_ETW
-#define V(name) registry->Register(name);
- NODE_PROBES(V)
-#undef V
-#endif // defined HAVE_DTRACE || defined HAVE_ETW
-}
-
-} // namespace node
-NODE_MODULE_CONTEXT_AWARE_INTERNAL(dtrace, node::InitializeDTrace)
-NODE_MODULE_EXTERNAL_REFERENCE(dtrace, node::RegisterDtraceExternalReferences)
diff --git a/src/node_dtrace.h b/src/node_dtrace.h
deleted file mode 100644
index b887542abf..0000000000
--- a/src/node_dtrace.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#ifndef SRC_NODE_DTRACE_H_
-#define SRC_NODE_DTRACE_H_
-
-#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
-
-#include "v8.h"
-
-extern "C" {
-/*
- * The following structures are passed directly to DTrace when probes are fired.
- * Translators in node.d translate these structures into the corresponding D
- * structures, taking care of dealing with the user process data model (32-bit
- * or 64-bit) and structure versions (see node_dtrace_http_server_request_t
- * below).
- */
-
-typedef struct {
- int32_t fd;
- int32_t port;
- char* remote;
- int32_t buffered;
-} node_dtrace_connection_t;
-
-typedef struct {
- char* url;
- char* method;
-} node_dtrace_http_client_request_t;
-
-/*
- * The original version of this structure contained only a url and method, just
- * like the client request above. To add the new forwardedFor field, the
- * structure layout was changed to begin with an integer version. The
- * translator knows whether it's looking at an old- or new-version structure
- * based on whether the version field's value is a reasonable pointer (i.e.
- * address greater than 4K). No doubt this is filthy, but there's not much else
- * we can do, and it works reliably.
- *
- * This version of the structure also contains padding that should be zeroed out
- * by the consumer so that future versions of the translator can simply check if
- * a field is present by checking it against nullptr.
- */
-typedef struct {
- union {
- uint32_t version;
- uintptr_t unused; /* for compat. with old 64-bit struct */
- } _un;
- char* url;
- char* method;
- char* forwardedFor;
- char* _pad[8];
-} node_dtrace_http_server_request_t;
-
-} // extern "C"
-
-namespace node {
-
-class Environment;
-
-void InitDTrace(Environment* env);
-
-} // namespace node
-
-#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
-
-#endif // SRC_NODE_DTRACE_H_
diff --git a/src/node_external_reference.h b/src/node_external_reference.h
index 58b8f4bed2..0a90220c76 100644
--- a/src/node_external_reference.h
+++ b/src/node_external_reference.h
@@ -107,12 +107,6 @@ class ExternalReferenceRegistry {
#define EXTERNAL_REFERENCE_BINDING_LIST_INSPECTOR(V)
#endif // HAVE_INSPECTOR
-#if HAVE_DTRACE || HAVE_ETW
-#define EXTERNAL_REFERENCE_BINDING_LIST_DTRACE(V) V(dtrace)
-#else
-#define EXTERNAL_REFERENCE_BINDING_LIST_DTRACE(V)
-#endif
-
#if HAVE_OPENSSL
#define EXTERNAL_REFERENCE_BINDING_LIST_CRYPTO(V) V(crypto) V(tls_wrap)
#else
@@ -123,7 +117,6 @@ class ExternalReferenceRegistry {
EXTERNAL_REFERENCE_BINDING_LIST_BASE(V) \
EXTERNAL_REFERENCE_BINDING_LIST_INSPECTOR(V) \
EXTERNAL_REFERENCE_BINDING_LIST_I18N(V) \
- EXTERNAL_REFERENCE_BINDING_LIST_DTRACE(V) \
EXTERNAL_REFERENCE_BINDING_LIST_CRYPTO(V)
} // namespace node
diff --git a/src/node_provider.d b/src/node_provider.d
deleted file mode 100644
index 90be45e730..0000000000
--- a/src/node_provider.d
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Copyright Joyent, Inc. and other Node contributors.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to permit
- * persons to whom the Software is furnished to do so, subject to the
- * following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
- * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
- * DTrace provider for node.js.
- */
-
-/*
- * In order to have the information we need here to create the provider,
- * we must declare bogus definitions for our depended-upon structures. And
- * yes, the fact that we need to do this represents a shortcoming in DTrace,
- * one that would be resolved by that elusive El Dorado: dynamic translators.
- */
-
-typedef struct {
- int dummy;
-} node_dtrace_connection_t;
-
-typedef struct {
- int dummy;
-} node_connection_t;
-
-typedef struct {
- int dummy;
-} node_dtrace_http_server_request_t;
-
-typedef struct {
- int dummy;
-} node_dtrace_http_client_request_t;
-
-typedef struct {
- int dummy;
-} node_http_request_t;
-
-provider node {
- probe net__server__connection(node_dtrace_connection_t *c,
- const char *a, int p, int fd) : (node_connection_t *c, string a, int p,
- int fd);
- probe net__stream__end(node_dtrace_connection_t *c, const char *a,
- int p, int fd) : (node_connection_t *c, string a, int p, int fd);
- probe http__server__request(node_dtrace_http_server_request_t *h,
- node_dtrace_connection_t *c, const char *a, int p, const char *m,
- const char *u, int fd) : (node_http_request_t *h, node_connection_t *c,
- string a, int p, string m, string u, int fd);
- probe http__server__response(node_dtrace_connection_t *c, const char *a,
- int p, int fd) : (node_connection_t *c, string a, int p, int fd);
- probe http__client__request(node_dtrace_http_client_request_t *h,
- node_dtrace_connection_t *c, const char *a, int p, const char *m,
- const char *u, int fd) : (node_http_request_t *h, node_connection_t *c,
- string a, int p, string m, string u, int fd);
- probe http__client__response(node_dtrace_connection_t *c, const char *a,
- int p, int fd) : (node_connection_t *c, string a, int p, int fd);
- probe gc__start(int t, int f, void *isolate);
- probe gc__done(int t, int f, void *isolate);
-};
-
-#pragma D attributes Evolving/Evolving/ISA provider node provider
-#pragma D attributes Private/Private/Unknown provider node module
-#pragma D attributes Private/Private/Unknown provider node function
-#pragma D attributes Private/Private/ISA provider node name
-#pragma D attributes Evolving/Evolving/ISA provider node args
diff --git a/src/node_win32_etw_provider-inl.h b/src/node_win32_etw_provider-inl.h
deleted file mode 100644
index 9238ea22a3..0000000000
--- a/src/node_win32_etw_provider-inl.h
+++ /dev/null
@@ -1,288 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#ifndef SRC_NODE_WIN32_ETW_PROVIDER_INL_H_
-#define SRC_NODE_WIN32_ETW_PROVIDER_INL_H_
-
-#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
-
-#include "node_win32_etw_provider.h"
-#include "node_etw_provider.h"
-
-namespace node {
-
-// From node_win32_etw_provider.cc
-extern REGHANDLE node_provider;
-extern EventWriteFunc event_write;
-extern int events_enabled;
-
-#define ETW_WRITE_STRING_DATA(data_descriptor, data) \
- EventDataDescCreate(data_descriptor, \
- data, \
- (strlen(data) + 1) * sizeof(*data));
-
-#define ETW_WRITE_INT32_DATA(data_descriptor, data) \
- EventDataDescCreate(data_descriptor, data, sizeof(int32_t));
-
-#define ETW_WRITE_INT64_DATA(data_descriptor, data) \
- EventDataDescCreate(data_descriptor, data, sizeof(int64_t));
-
-#define ETW_WRITE_ADDRESS_DATA(data_descriptor, data) \
- EventDataDescCreate(data_descriptor, data, sizeof(intptr_t));
-
-#define ETW_WRITE_INT16_DATA(data_descriptor, data) \
- EventDataDescCreate(data_descriptor, data, sizeof(int16_t));
-
-#define ETW_WRITE_WSTRING_DATA_LENGTH(data_descriptor, data, data_len_bytes) \
- EventDataDescCreate(data_descriptor, \
- data, \
- data_len_bytes);
-
-#define ETW_WRITE_NET_CONNECTION(descriptors, conn) \
- ETW_WRITE_INT32_DATA(descriptors, &conn->fd); \
- ETW_WRITE_INT32_DATA(descriptors + 1, &conn->port); \
- ETW_WRITE_STRING_DATA(descriptors + 2, conn->remote); \
- ETW_WRITE_INT32_DATA(descriptors + 3, &conn->buffered);
-
-#define ETW_WRITE_HTTP_SERVER_REQUEST(descriptors, req) \
- ETW_WRITE_STRING_DATA(descriptors, req->url); \
- ETW_WRITE_STRING_DATA(descriptors + 1, req->method); \
- ETW_WRITE_STRING_DATA(descriptors + 2, req->forwardedFor);
-
-#define ETW_WRITE_HTTP_CLIENT_REQUEST(descriptors, req) \
- ETW_WRITE_STRING_DATA(descriptors, req->url); \
- ETW_WRITE_STRING_DATA(descriptors + 1, req->method);
-
-#define ETW_WRITE_GC(descriptors, type, flags) \
- ETW_WRITE_INT32_DATA(descriptors, &type); \
- ETW_WRITE_INT32_DATA(descriptors + 1, &flags);
-
-#define ETW_WRITE_V8ADDRESSCHANGE(descriptors, addr1, addr2) \
- ETW_WRITE_ADDRESS_DATA(descriptors, &addr1); \
- ETW_WRITE_ADDRESS_DATA(descriptors + 1, &addr2);
-
-#define ETW_WRITE_JSMETHOD_LOADUNLOAD(descriptors, \
- context, \
- startAddr, \
- size, \
- id, \
- flags, \
- rangeId, \
- sourceId, \
- line, \
- col, \
- name, \
- name_len_bytes) \
- ETW_WRITE_ADDRESS_DATA(descriptors, &context); \
- ETW_WRITE_ADDRESS_DATA(descriptors + 1, &startAddr); \
- ETW_WRITE_INT64_DATA(descriptors + 2, &size); \
- ETW_WRITE_INT32_DATA(descriptors + 3, &id); \
- ETW_WRITE_INT16_DATA(descriptors + 4, &flags); \
- ETW_WRITE_INT16_DATA(descriptors + 5, &rangeId); \
- ETW_WRITE_INT64_DATA(descriptors + 6, &sourceId); \
- ETW_WRITE_INT32_DATA(descriptors + 7, &line); \
- ETW_WRITE_INT32_DATA(descriptors + 8, &col); \
- ETW_WRITE_WSTRING_DATA_LENGTH(descriptors + 9, name, name_len_bytes);
-
-
-#define ETW_WRITE_EVENT(eventDescriptor, dataDescriptors) \
- DWORD status = event_write(node_provider, \
- &eventDescriptor, \
- sizeof(dataDescriptors) / \
- sizeof(*dataDescriptors), \
- dataDescriptors); \
- CHECK_EQ(status, ERROR_SUCCESS);
-
-// NOLINTNEXTLINE (readability/null_usage)
-#define NULL_NOLINT NULL
-
-#define ETW_WRITE_EMPTY_EVENT(eventDescriptor) \
- DWORD status = event_write(node_provider, &eventDescriptor, 0, NULL_NOLINT); \
- CHECK_EQ(status, ERROR_SUCCESS);
-
-void NODE_HTTP_SERVER_REQUEST(node_dtrace_http_server_request_t* req,
- node_dtrace_connection_t* conn, const char* remote, int port,
- const char* method, const char* url, int fd) {
- EVENT_DATA_DESCRIPTOR descriptors[7];
- ETW_WRITE_HTTP_SERVER_REQUEST(descriptors, req);
- ETW_WRITE_NET_CONNECTION(descriptors + 3, conn);
- ETW_WRITE_EVENT(NODE_HTTP_SERVER_REQUEST_EVENT, descriptors);
-}
-
-
-void NODE_HTTP_SERVER_RESPONSE(node_dtrace_connection_t* conn,
- const char* remote, int port, int fd) {
- EVENT_DATA_DESCRIPTOR descriptors[4];
- ETW_WRITE_NET_CONNECTION(descriptors, conn);
- ETW_WRITE_EVENT(NODE_HTTP_SERVER_RESPONSE_EVENT, descriptors);
-}
-
-
-void NODE_HTTP_CLIENT_REQUEST(node_dtrace_http_client_request_t* req,
- node_dtrace_connection_t* conn, const char* remote, int port,
- const char* method, const char* url, int fd) {
- EVENT_DATA_DESCRIPTOR descriptors[6];
- ETW_WRITE_HTTP_CLIENT_REQUEST(descriptors, req);
- ETW_WRITE_NET_CONNECTION(descriptors + 2, conn);
- ETW_WRITE_EVENT(NODE_HTTP_CLIENT_REQUEST_EVENT, descriptors);
-}
-
-
-void NODE_HTTP_CLIENT_RESPONSE(node_dtrace_connection_t* conn,
- const char* remote, int port, int fd) {
- EVENT_DATA_DESCRIPTOR descriptors[4];
- ETW_WRITE_NET_CONNECTION(descriptors, conn);
- ETW_WRITE_EVENT(NODE_HTTP_CLIENT_RESPONSE_EVENT, descriptors);
-}
-
-
-void NODE_NET_SERVER_CONNECTION(node_dtrace_connection_t* conn,
- const char* remote, int port, int fd) {
- EVENT_DATA_DESCRIPTOR descriptors[4];
- ETW_WRITE_NET_CONNECTION(descriptors, conn);
- ETW_WRITE_EVENT(NODE_NET_SERVER_CONNECTION_EVENT, descriptors);
-}
-
-
-void NODE_NET_STREAM_END(node_dtrace_connection_t* conn,
- const char* remote, int port, int fd) {
- EVENT_DATA_DESCRIPTOR descriptors[4];
- ETW_WRITE_NET_CONNECTION(descriptors, conn);
- ETW_WRITE_EVENT(NODE_NET_STREAM_END_EVENT, descriptors);
-}
-
-
-void NODE_GC_START(v8::GCType type,
- v8::GCCallbackFlags flags,
- v8::Isolate* isolate) {
- if (events_enabled > 0) {
- EVENT_DATA_DESCRIPTOR descriptors[2];
- ETW_WRITE_GC(descriptors, type, flags);
- ETW_WRITE_EVENT(NODE_GC_START_EVENT, descriptors);
- }
-}
-
-
-void NODE_GC_DONE(v8::GCType type,
- v8::GCCallbackFlags flags,
- v8::Isolate* isolate) {
- if (events_enabled > 0) {
- EVENT_DATA_DESCRIPTOR descriptors[2];
- ETW_WRITE_GC(descriptors, type, flags);
- ETW_WRITE_EVENT(NODE_GC_DONE_EVENT, descriptors);
- }
-}
-
-
-void NODE_V8SYMBOL_REMOVE(const void* addr1, const void* addr2) {
- if (events_enabled > 0) {
- EVENT_DATA_DESCRIPTOR descriptors[2];
- ETW_WRITE_V8ADDRESSCHANGE(descriptors, addr1, addr2);
- ETW_WRITE_EVENT(NODE_V8SYMBOL_REMOVE_EVENT, descriptors);
- }
-}
-
-
-void NODE_V8SYMBOL_MOVE(const void* addr1, const void* addr2) {
- if (events_enabled > 0) {
- EVENT_DATA_DESCRIPTOR descriptors[2];
- ETW_WRITE_V8ADDRESSCHANGE(descriptors, addr1, addr2);
- ETW_WRITE_EVENT(NODE_V8SYMBOL_MOVE_EVENT, descriptors);
- }
-}
-
-
-void NODE_V8SYMBOL_RESET() {
- if (events_enabled > 0) {
- ETW_WRITE_EMPTY_EVENT(NODE_V8SYMBOL_RESET_EVENT);
- }
-}
-
-#define SETSYMBUF(s) \
- wcscpy(symbuf, s); \
- symbol_len = arraysize(s) - 1;
-
-void NODE_V8SYMBOL_ADD(LPCSTR symbol,
- int symbol_len,
- const void* addr1,
- int len) {
- if (events_enabled > 0) {
- wchar_t symbuf[128];
- if (symbol == nullptr) {
- SETSYMBUF(L"nullptr");
- } else {
- symbol_len = MultiByteToWideChar(CP_ACP,
- 0,
- symbol,
- symbol_len,
- symbuf,
- 128);
- if (symbol_len == 0) {
- SETSYMBUF(L"Invalid");
- } else {
- if (symbol_len > 127) {
- symbol_len = 127;
- }
- symbuf[symbol_len] = L'\0';
- }
- }
- void* context = nullptr;
- INT64 size = (INT64)len;
- INT32 id = (INT32)addr1;
- INT16 flags = 0;
- INT16 rangeid = 1;
- INT32 col = 1;
- INT32 line = 1;
- INT64 sourceid = 0;
- EVENT_DATA_DESCRIPTOR descriptors[10];
- ETW_WRITE_JSMETHOD_LOADUNLOAD(descriptors,
- context,
- addr1,
- size,
- id,
- flags,
- rangeid,
- sourceid,
- line,
- col,
- symbuf,
- (symbol_len + 1) * sizeof(symbuf[0]));
- ETW_WRITE_EVENT(MethodLoad, descriptors);
- }
-}
-#undef SETSYMBUF
-
-#undef NULL_NOLINT
-
-
-bool NODE_HTTP_SERVER_REQUEST_ENABLED() { return events_enabled > 0; }
-bool NODE_HTTP_SERVER_RESPONSE_ENABLED() { return events_enabled > 0; }
-bool NODE_HTTP_CLIENT_REQUEST_ENABLED() { return events_enabled > 0; }
-bool NODE_HTTP_CLIENT_RESPONSE_ENABLED() { return events_enabled > 0; }
-bool NODE_NET_SERVER_CONNECTION_ENABLED() { return events_enabled > 0; }
-bool NODE_NET_STREAM_END_ENABLED() { return events_enabled > 0; }
-bool NODE_V8SYMBOL_ENABLED() { return events_enabled > 0; }
-
-} // namespace node
-
-#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
-
-#endif // SRC_NODE_WIN32_ETW_PROVIDER_INL_H_
diff --git a/src/node_win32_etw_provider.cc b/src/node_win32_etw_provider.cc
deleted file mode 100644
index 7b0c696a9c..0000000000
--- a/src/node_win32_etw_provider.cc
+++ /dev/null
@@ -1,213 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#include "node_win32_etw_provider.h" // NOLINT(build/include_inline)
-#include "node_win32_etw_provider-inl.h"
-
-#include "node_etw_provider.h"
-
-namespace node {
-
-using v8::Isolate;
-using v8::JitCodeEvent;
-using v8::V8;
-
-HMODULE advapi;
-REGHANDLE node_provider;
-EventRegisterFunc event_register;
-EventUnregisterFunc event_unregister;
-EventWriteFunc event_write;
-int events_enabled;
-static uv_async_t dispatch_etw_events_change_async;
-
-struct v8tags {
- char prefix[32 - sizeof(size_t)];
- size_t prelen;
-};
-
-// The v8 CODE_ADDED event name has a prefix indicating the type of event.
-// Many of these are internal to v8.
-// The trace_codes array specifies which types are written.
-struct v8tags trace_codes[] = {
-#define MAKE_V8TAG(s) { s, sizeof(s) - 1 }
- MAKE_V8TAG("LazyCompile:"),
- MAKE_V8TAG("Script:"),
- MAKE_V8TAG("Function:"),
- MAKE_V8TAG("RegExp:"),
- MAKE_V8TAG("Eval:")
-#undef MAKE_V8TAG
-};
-
-/* Below are some code prefixes which are not being written.
- * "Builtin:"
- * "Stub:"
- * "CallIC:"
- * "LoadIC:"
- * "KeyedLoadIC:"
- * "StoreIC:"
- * "KeyedStoreIC:"
- * "CallPreMonomorphic:"
- * "CallInitialize:"
- * "CallMiss:"
- * "CallMegamorphic:"
- */
-
-// v8 sometimes puts a '*' or '~' in front of the name.
-#define V8_MARKER1 '*'
-#define V8_MARKER2 '~'
-
-
-// If prefix is not in filtered list return -1,
-// else return length of prefix and marker.
-int FilterCodeEvents(const char* name, size_t len) {
- for (size_t i = 0; i < arraysize(trace_codes); i++) {
- size_t prelen = trace_codes[i].prelen;
- if (prelen < len) {
- if (strncmp(name, trace_codes[i].prefix, prelen) == 0) {
- if (name[prelen] == V8_MARKER1 || name[prelen] == V8_MARKER2)
- prelen++;
- return prelen;
- }
- }
- }
- return -1;
-}
-
-
-// callback from V8 module passes symbol and address info for stack walk
-void CodeAddressNotification(const JitCodeEvent* jevent) {
- int pre_offset = 0;
- if (NODE_V8SYMBOL_ENABLED()) {
- switch (jevent->type) {
- case JitCodeEvent::CODE_ADDED:
- pre_offset = FilterCodeEvents(jevent->name.str, jevent->name.len);
- if (pre_offset >= 0) {
- // skip over prefix and marker
- NODE_V8SYMBOL_ADD(jevent->name.str + pre_offset,
- jevent->name.len - pre_offset,
- jevent->code_start,
- jevent->code_len);
- }
- break;
- case JitCodeEvent::CODE_REMOVED:
- NODE_V8SYMBOL_REMOVE(jevent->code_start, nullptr);
- break;
- case JitCodeEvent::CODE_MOVED:
- NODE_V8SYMBOL_MOVE(jevent->code_start, jevent->new_code_start);
- break;
- default:
- break;
- }
- }
-}
-
-
-// Call v8 to enable or disable code event callbacks.
-// Must be on default thread to do this.
-// Note: It is possible to call v8 from ETW thread, but then
-// event callbacks are received in the same thread. Attempts
-// to write ETW events in this thread will fail.
-void etw_events_change_async(uv_async_t* handle) {
- if (events_enabled > 0) {
- NODE_V8SYMBOL_RESET();
- Isolate::GetCurrent()->SetJitCodeEventHandler(
- v8::kJitCodeEventEnumExisting,
- CodeAddressNotification);
- } else {
- Isolate::GetCurrent()->SetJitCodeEventHandler(
- v8::kJitCodeEventDefault,
- nullptr);
- }
-}
-
-
-// This callback is called by ETW when consumers of our provider
-// are enabled or disabled.
-// The callback is dispatched on ETW thread.
-// Before calling into V8 to enable code events, switch to default thread.
-void NTAPI etw_events_enable_callback(
- LPCGUID SourceId,
- ULONG IsEnabled,
- UCHAR Level,
- ULONGLONG MatchAnyKeyword,
- ULONGLONG MatchAllKeywords,
- PEVENT_FILTER_DESCRIPTOR FilterData,
- PVOID CallbackContext) {
- if (IsEnabled) {
- events_enabled++;
- if (events_enabled == 1) {
- uv_async_send(&dispatch_etw_events_change_async);
- }
- } else {
- events_enabled--;
- if (events_enabled == 0) {
- uv_async_send(&dispatch_etw_events_change_async);
- }
- }
-}
-
-
-void init_etw() {
- events_enabled = 0;
-
- advapi = LoadLibraryW(L"advapi32.dll");
- if (advapi) {
- event_register = (EventRegisterFunc)
- GetProcAddress(advapi, "EventRegister");
- event_unregister = (EventUnregisterFunc)
- GetProcAddress(advapi, "EventUnregister");
- event_write = (EventWriteFunc)GetProcAddress(advapi, "EventWrite");
-
- // create async object used to invoke main thread from callback
- CHECK_EQ(0, uv_async_init(uv_default_loop(),
- &dispatch_etw_events_change_async,
- etw_events_change_async));
- uv_unref(reinterpret_cast<uv_handle_t*>(&dispatch_etw_events_change_async));
-
- if (event_register) {
- DWORD status = event_register(&NODE_ETW_PROVIDER,
- etw_events_enable_callback,
- nullptr,
- &node_provider);
- CHECK_EQ(status, ERROR_SUCCESS);
- }
- }
-}
-
-
-void shutdown_etw() {
- if (advapi && event_unregister && node_provider) {
- event_unregister(node_provider);
- node_provider = 0;
- }
-
- events_enabled = 0;
- Isolate::GetCurrent()->SetJitCodeEventHandler(
- v8::kJitCodeEventDefault,
- nullptr);
-
- if (advapi) {
- FreeLibrary(advapi);
- advapi = nullptr;
- }
-}
-
-} // namespace node
diff --git a/src/node_win32_etw_provider.h b/src/node_win32_etw_provider.h
deleted file mode 100644
index 0f84a86f0a..0000000000
--- a/src/node_win32_etw_provider.h
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a
-// copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to permit
-// persons to whom the Software is furnished to do so, subject to the
-// following conditions:
-//
-// The above copyright notice and this permission notice shall be included
-// in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
-// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
-// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
-// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-#ifndef SRC_NODE_WIN32_ETW_PROVIDER_H_
-#define SRC_NODE_WIN32_ETW_PROVIDER_H_
-
-#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
-
-#include "node_dtrace.h"
-#include <evntprov.h>
-
-namespace node {
-
-#if defined(_MSC_VER)
-# define INLINE __forceinline
-#else
-# define INLINE inline
-#endif
-
-typedef ULONG (NTAPI* EventRegisterFunc)(
- LPCGUID ProviderId,
- PENABLECALLBACK EnableCallback,
- PVOID CallbackContext,
- PREGHANDLE RegHandle
-);
-
-typedef ULONG (NTAPI* EventUnregisterFunc)(
- REGHANDLE RegHandle
-);
-
-typedef ULONG (NTAPI* EventWriteFunc)(
- REGHANDLE RegHandle,
- PCEVENT_DESCRIPTOR EventDescriptor,
- ULONG UserDataCount,
- PEVENT_DATA_DESCRIPTOR UserData
-);
-
-void init_etw();
-void shutdown_etw();
-
-INLINE void NODE_HTTP_SERVER_REQUEST(node_dtrace_http_server_request_t* req,
- node_dtrace_connection_t* conn, const char* remote, int port,
- const char* method, const char* url, int fd);
-INLINE void NODE_HTTP_SERVER_RESPONSE(node_dtrace_connection_t* conn,
- const char* remote, int port, int fd);
-INLINE void NODE_HTTP_CLIENT_REQUEST(node_dtrace_http_client_request_t* req,
- node_dtrace_connection_t* conn, const char* remote, int port,
- const char* method, const char* url, int fd);
-INLINE void NODE_HTTP_CLIENT_RESPONSE(node_dtrace_connection_t* conn,
- const char* remote, int port, int fd);
-INLINE void NODE_NET_SERVER_CONNECTION(node_dtrace_connection_t* conn,
- const char* remote, int port, int fd);
-INLINE void NODE_NET_STREAM_END(node_dtrace_connection_t* conn,
- const char* remote, int port, int fd);
-INLINE void NODE_GC_START(v8::GCType type,
- v8::GCCallbackFlags flags,
- v8::Isolate* isolate);
-INLINE void NODE_GC_DONE(v8::GCType type,
- v8::GCCallbackFlags flags,
- v8::Isolate* isolate);
-INLINE void NODE_V8SYMBOL_REMOVE(const void* addr1, const void* addr2);
-INLINE void NODE_V8SYMBOL_MOVE(const void* addr1, const void* addr2);
-INLINE void NODE_V8SYMBOL_RESET();
-INLINE void NODE_V8SYMBOL_ADD(LPCSTR symbol,
- int symbol_len,
- const void* addr1,
- int len);
-
-INLINE bool NODE_HTTP_SERVER_REQUEST_ENABLED();
-INLINE bool NODE_HTTP_SERVER_RESPONSE_ENABLED();
-INLINE bool NODE_HTTP_CLIENT_REQUEST_ENABLED();
-INLINE bool NODE_HTTP_CLIENT_RESPONSE_ENABLED();
-INLINE bool NODE_NET_SERVER_CONNECTION_ENABLED();
-INLINE bool NODE_NET_STREAM_END_ENABLED();
-INLINE bool NODE_V8SYMBOL_ENABLED();
-
-} // namespace node
-
-#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
-
-#endif // SRC_NODE_WIN32_ETW_PROVIDER_H_
diff --git a/src/res/node_etw_provider.man b/src/res/node_etw_provider.man
deleted file mode 100644
index 46ad2e38fc..0000000000
--- a/src/res/node_etw_provider.man
+++ /dev/null
@@ -1,185 +0,0 @@
-<instrumentationManifest
- xmlns="http://schemas.microsoft.com/win/2004/08/events"
- xmlns:win="http://manifests.microsoft.com/win/2004/08/windows/events"
- xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <instrumentation>
- <events>
- <provider name="NodeJS-ETW-provider"
- guid="{77754E9B-264B-4D8D-B981-E4135C1ECB0C}"
- symbol="NODE_ETW_PROVIDER"
- message="$(string.NodeJS-ETW-provider.name)"
- resourceFileName="node.exe"
- messageFileName="node.exe">
-
- <tasks>
- <task name="MethodRuntime" value="1"
- symbol="JSCRIPT_METHOD_RUNTIME_TASK">
- <opcodes>
- <opcode name="MethodLoad" value="10"
- symbol="JSCRIPT_METHOD_METHODLOAD_OPCODE"/>
- </opcodes>
- </task>
- </tasks>
-
- <opcodes>
- <opcode name="NODE_HTTP_SERVER_REQUEST" value="10"/>
- <opcode name="NODE_HTTP_SERVER_RESPONSE" value="11"/>
- <opcode name="NODE_HTTP_CLIENT_REQUEST" value="12"/>
- <opcode name="NODE_HTTP_CLIENT_RESPONSE" value="13"/>
- <opcode name="NODE_NET_SERVER_CONNECTION" value="14"/>
- <opcode name="NODE_NET_STREAM_END" value="15"/>
- <opcode name="NODE_GC_START" value="16"/>
- <opcode name="NODE_GC_DONE" value="17"/>
- <opcode name="NODE_V8SYMBOL_REMOVE" value="21"/>
- <opcode name="NODE_V8SYMBOL_MOVE" value="22"/>
- <opcode name="NODE_V8SYMBOL_RESET" value="23"/>
- </opcodes>
-
- <templates>
- <template tid="node_connection">
- <data name="fd" inType="win:UInt32" />
- <data name="port" inType="win:UInt32" />
- <data name="remote" inType="win:AnsiString" />
- <data name="buffered" inType="win:UInt32" />
- </template>
-
- <template tid="node_http_client_request">
- <data name="url" inType="win:AnsiString" />
- <data name="method" inType="win:AnsiString" />
- <data name="fd" inType="win:UInt32" />
- <data name="port" inType="win:UInt32" />
- <data name="remote" inType="win:AnsiString" />
- <data name="buffered" inType="win:UInt32" />
- </template>
-
- <template tid="node_http_server_request">
- <data name="url" inType="win:AnsiString" />
- <data name="method" inType="win:AnsiString" />
- <data name="forwardedFor" inType="win:AnsiString" />
- <data name="fd" inType="win:UInt32" />
- <data name="port" inType="win:UInt32" />
- <data name="remote" inType="win:AnsiString" />
- <data name="buffered" inType="win:UInt32" />
- </template>
-
- <template tid="node_gc">
- <data name="gctype" inType="win:UInt32" />
- <data name="gccallbackflags" inType="win:UInt32" />
- </template>
-
- <template tid="V8AddressChange">
- <data name="addr1" inType="win:Pointer" outType="win:HexInt64"/>
- <data name="addr2" inType="win:Pointer" outType="win:HexInt64"/>
- </template>
-
- <template tid="MethodLoadUnload">
- <data name="ScriptContextID" inType="win:Pointer" outType="win:HexInt64"/>
- <data name="MethodStartAddress" inType="win:Pointer" outType="win:HexInt64" />
- <data name="MethodSize" inType="win:UInt64" />
- <data name="MethodID" inType="win:UInt32" />
- <data name="MethodFlags" inType="win:UInt16" />
- <data name="MethodAddressRangeID" inType="win:UInt16" />
- <data name="SourceID" inType="win:UInt64" />
- <data name="Line" inType="win:UInt32" outType="xs:unsignedInt" />
- <data name="Column" inType="win:UInt32" outType="xs:unsignedInt" />
- <data name="MethodName" inType="win:UnicodeString" outType="xs:string" />
- </template>
- </templates>
-
- <events>
- <event value="1"
- opcode="NODE_HTTP_SERVER_REQUEST"
- template="node_http_server_request"
- symbol="NODE_HTTP_SERVER_REQUEST_EVENT"
- message="$(string.NodeJS-ETW-provider.event.1.message)"
- level="win:Informational"/>
- <event value="2"
- opcode="NODE_HTTP_SERVER_RESPONSE"
- template="node_connection"
- symbol="NODE_HTTP_SERVER_RESPONSE_EVENT"
- message="$(string.NodeJS-ETW-provider.event.2.message)"
- level="win:Informational"/>
- <event value="3"
- opcode="NODE_HTTP_CLIENT_REQUEST"
- template="node_http_client_request"
- symbol="NODE_HTTP_CLIENT_REQUEST_EVENT"
- message="$(string.NodeJS-ETW-provider.event.3.message)"
- level="win:Informational"/>
- <event value="4"
- opcode="NODE_HTTP_CLIENT_RESPONSE"
- template="node_connection"
- symbol="NODE_HTTP_CLIENT_RESPONSE_EVENT"
- message="$(string.NodeJS-ETW-provider.event.4.message)"
- level="win:Informational"/>
- <event value="5"
- opcode="NODE_NET_SERVER_CONNECTION"
- template="node_connection"
- symbol="NODE_NET_SERVER_CONNECTION_EVENT"
- message="$(string.NodeJS-ETW-provider.event.5.message)"
- level="win:Informational"/>
- <event value="6"
- opcode="NODE_NET_STREAM_END"
- template="node_connection"
- symbol="NODE_NET_STREAM_END_EVENT"
- message="$(string.NodeJS-ETW-provider.event.6.message)"
- level="win:Informational"/>
- <event value="7"
- opcode="NODE_GC_START"
- template="node_gc"
- symbol="NODE_GC_START_EVENT"
- message="$(string.NodeJS-ETW-provider.event.7.message)"
- level="win:Informational"/>
- <event value="8"
- opcode="NODE_GC_DONE"
- template="node_gc"
- symbol="NODE_GC_DONE_EVENT"
- message="$(string.NodeJS-ETW-provider.event.8.message)"
- level="win:Informational"/>
- <event value="9"
- level="win:Informational"
- opcode="MethodLoad"
- symbol="MethodLoad"
- message="$(string.NodeJS-ETW-provider.event.9.message)"
- task="MethodRuntime"
- template="MethodLoadUnload"/>
- <event value="21"
- opcode="NODE_V8SYMBOL_REMOVE"
- template="V8AddressChange"
- symbol="NODE_V8SYMBOL_REMOVE_EVENT"
- message="$(string.NodeJS-ETW-provider.event.21.message)"
- level="win:Informational" />
- <event value="22"
- opcode="NODE_V8SYMBOL_MOVE"
- template="V8AddressChange"
- symbol="NODE_V8SYMBOL_MOVE_EVENT"
- message="$(string.NodeJS-ETW-provider.event.22.message)"
- level="win:Informational" />
- <event value="23"
- opcode="NODE_V8SYMBOL_RESET"
- symbol="NODE_V8SYMBOL_RESET_EVENT"
- message="$(string.NodeJS-ETW-provider.event.23.message)"
- level="win:Informational" />
- </events>
- </provider>
- </events>
- </instrumentation>
- <localization>
- <resources culture="en-US">
- <stringTable>
- <string id="NodeJS-ETW-provider.name" value="Node.js ETW Provider"/>
- <string id="NodeJS-ETW-provider.event.1.message" value="Node.js HTTP Server Request%nMethod: %2%nRemote: %6%nPort: %5%nURL: %1"/>
- <string id="NodeJS-ETW-provider.event.2.message" value="Node.js HTTP Server Response%nRemote: %3%nPort: %2"/>
- <string id="NodeJS-ETW-provider.event.3.message" value="Node.js HTTP Client Request%nMethod: %2%nRemote: %5%nPort: %4%nURL: %1"/>
- <string id="NodeJS-ETW-provider.event.4.message" value="Node.js HTTP Client Response%nRemote: %3%nPort: %2"/>
- <string id="NodeJS-ETW-provider.event.5.message" value="Node.js Net Server Connection%nRemote: %3%nPort: %2"/>
- <string id="NodeJS-ETW-provider.event.6.message" value="Node.js Net Stream End%nRemote: %3%nPort: %2"/>
- <string id="NodeJS-ETW-provider.event.7.message" value="Node.js Garbage Collection Start"/>
- <string id="NodeJS-ETW-provider.event.8.message" value="Node.js Garbage Collection Done"/>
- <string id="NodeJS-ETW-provider.event.9.message" value="Node.js Function Compiled: %10"/>
- <string id="NodeJS-ETW-provider.event.21.message" value="Node.js V8 Symbol Remove"/>
- <string id="NodeJS-ETW-provider.event.22.message" value="Node.js V8 Symbol Move"/>
- <string id="NodeJS-ETW-provider.event.23.message" value="Node.js V8 Symbol Reset"/>
- </stringTable>
- </resources>
- </localization>
-</instrumentationManifest>
diff --git a/src/v8ustack.d b/src/v8ustack.d
deleted file mode 100644
index 2fe40714c0..0000000000
--- a/src/v8ustack.d
+++ /dev/null
@@ -1,695 +0,0 @@
-/*
- * V8 DTrace ustack helper for annotating native stack traces with JavaScript
- * function names. We start with a frame pointer (arg1) and emit a string
- * describing the current function. We do this by chasing pointers to extract
- * the function's name (if any) and the filename and line number where the
- * function is defined.
- *
- * To use the helper, run node, then use the jstack() DTrace action to capture
- * a JavaScript stacktrace. You may need to tune the dtrace_helper_actions_max
- * kernel variable to 128.
- */
-
-#include <v8constants.h>
-#include <v8abbr.h>
-
-/*
- * V8 represents small integers (SMI) using the upper 31 bits of a 32/64-bit
- * value. To extract the actual integer value, we must shift it over.
- */
-#define IS_SMI(value) \
- ((value & V8_SmiTagMask) == V8_SmiTag)
-#define SMI_VALUE(value) \
- ((uint32_t) ((value) >> V8_SmiValueShift))
-#define NO_SHARED_FUNCTION_NAME_SENTINEL NULL
-
-/*
- * Heap objects usually start off with a Map pointer, itself another heap
- * object. However, during garbage collection, the low order bits of the
- * pointer (which are normally 01) are used to record GC state. Of course, we
- * have no idea if we're in GC or not, so we must always normalize the pointer.
- */
-#define V8_MAP_PTR(ptr) \
- ((ptr & ~V8_HeapObjectTagMask) | V8_HeapObjectTag)
-
-#define V8_TYPE_SCRIPT(type) \
- ((type) == V8_IT_SCRIPT)
-
-/*
- * Determine the encoding and representation of a V8 string.
- */
-#define V8_TYPE_STRING(type) \
- (((type) & V8_IsNotStringMask) == V8_StringTag)
-
-#define V8_STRENC_ASCII(type) \
- (((type) & V8_StringEncodingMask) == V8_AsciiStringTag)
-
-#define V8_STRREP_SEQ(type) \
- (((type) & V8_StringRepresentationMask) == V8_SeqStringTag)
-#define V8_STRREP_CONS(type) \
- (((type) & V8_StringRepresentationMask) == V8_ConsStringTag)
-#define V8_STRREP_EXT(type) \
- (((type) & V8_StringRepresentationMask) == V8_ExternalStringTag)
-
-/*
- * String type predicates
- */
-#define ASCII_SEQSTR(value) \
- (V8_TYPE_STRING(value) && V8_STRENC_ASCII(value) && V8_STRREP_SEQ(value))
-
-#define TWOBYTE_SEQSTR(value) \
- (V8_TYPE_STRING(value) && !V8_STRENC_ASCII(value) && V8_STRREP_SEQ(value))
-
-#define IS_CONSSTR(value) \
- (V8_TYPE_STRING(value) && V8_STRREP_CONS(value))
-
-#define ASCII_EXTSTR(value) \
- (V8_TYPE_STRING(value) && V8_STRENC_ASCII(value) && V8_STRREP_EXT(value))
-
-/*
- * General helper macros
- */
-#define COPYIN_UINT8(addr) (*(uint8_t*) copyin((addr), sizeof(uint8_t)))
-#define COPYIN_UINT32(addr) (*(uint32_t*) copyin((addr), sizeof(uint32_t)))
-#define COPYIN_UINT64(addr) (*(uint64_t*) copyin((addr), sizeof(uint64_t)))
-
-#if defined(__i386)
-# define COPYIN_PTR(addr) COPYIN_UINT32(addr)
-# define off_t uint32_t
-# define APPEND_PTR(p) APPEND_PTR_32(p)
-#else
-# define COPYIN_PTR(addr) COPYIN_UINT64(addr)
-# define off_t uint64_t
-# define APPEND_PTR(p) APPEND_PTR_64(p)
-#endif
-
-#define APPEND_CHR(c) (this->buf[this->off++] = (c))
-#define APPEND_CHR4(s0, s1, s2, s3) \
- APPEND_CHR(s0); \
- APPEND_CHR(s1); \
- APPEND_CHR(s2); \
- APPEND_CHR(s3);
-#define APPEND_CHR8(s0, s1, s2, s3, s4, s5, s6, s7) \
- APPEND_CHR4(s0, s1, s2, s3) \
- APPEND_CHR4(s4, s5, s6, s7)
-
-#define APPEND_DGT(i, d) \
- (((i) / (d)) ? APPEND_CHR('0' + ((i)/(d) % 10)) : 0)
-
-#define APPEND_NUM(i) \
- APPEND_DGT((i), 100000); \
- APPEND_DGT((i), 10000); \
- APPEND_DGT((i), 1000); \
- APPEND_DGT((i), 100); \
- APPEND_DGT((i), 10); \
- APPEND_DGT((i), 1);
-
-#define APPEND_HEX(d) \
- APPEND_CHR((d) < 10 ? '0' + (d) : 'a' - 10 + (d))
-
-#define APPEND_PTR_32(p) \
- APPEND_HEX((p >> 28) & 0xf); \
- APPEND_HEX((p >> 24) & 0xf); \
- APPEND_HEX((p >> 20) & 0xf); \
- APPEND_HEX((p >> 16) & 0xf); \
- APPEND_HEX((p >> 12) & 0xf); \
- APPEND_HEX((p >> 8) & 0xf); \
- APPEND_HEX((p >> 4) & 0xf); \
- APPEND_HEX((p) & 0xf);
-
-#define APPEND_PTR_64(p) \
- APPEND_PTR_32(p >> 32) \
- APPEND_PTR_32(p)
-
-/*
- * The following macros are used to output ASCII SeqStrings, ConsStrings, and
- * Node.js ExternalStrings. To represent each string, we use three fields:
- *
- * "str": a pointer to the string itself
- *
- * "len": the string length
- *
- * "attrs": the type identifier for the string, which indicates the
- * encoding and representation. We're only interested in strings
- * whose representation is one of:
- *
- * SeqOneByteString stored directly as a char array inside the object
- *
- * SeqTwoByteString stored as a UTF-16 char array inside the object
- *
- * ConsString pointer to two strings that should be concatenated
- *
- * ExternalString pointer to a char* outside the V8 heap
- */
-
-/*
- * Load "len" and "attrs" for the given "str".
- */
-#define LOAD_STRFIELDS(str, len, attrs) \
- len = SMI_VALUE(COPYIN_PTR(str + V8_OFF_STR_LENGTH)); \
- this->map = V8_MAP_PTR(COPYIN_PTR(str + V8_OFF_HEAPOBJ_MAP)); \
- attrs = COPYIN_UINT8(this->map + V8_OFF_MAP_ATTRS);
-
-#define APPEND_SEQSTR(str, len, attrs) \
- APPEND_SEQONEBYTESTR(str, len, attrs) \
- APPEND_SEQTWOBYTESTR(str, len, attrs)
-
-/*
- * Print out the given SeqOneByteString, or do nothing if the string is not an ASCII
- * SeqOneByteString.
- */
-#define APPEND_SEQONEBYTESTR(str, len, attrs) \
- dtrace:helper:ustack: \
- /!this->done && len > 0 && ASCII_SEQSTR(attrs)/ \
- { \
- copyinto(str + V8_OFF_STR_CHARS, len, this->buf + this->off); \
- this->off += len; \
- }
-
-/*
- * LOOP_ITER: macro to paste "block" while "ivar" is less than "dynmax" and
- * "statmax". The subsequent LOOP_{4,8} macros facilitate pasting the same
- * thing 4 and 8 times, respectively. Like much of the rest of the code in this
- * file, this is regrettably necessary given the constraints under which we're
- * expected to run.
- */
-#define LOOP_ITER(ivar, dynmax, statmax, block) \
- ((ivar) < (dynmax)) && ((ivar) < (statmax)) && (block); (ivar)++;
-
-#define LOOP_4(block) \
- block \
- block \
- block \
- block \
-
-#define LOOP_8(block) \
- LOOP_4(block) \
- LOOP_4(block)
-
-/*
- * Print out the given SeqTwoByteString, or do nothing if the string is not an ASCII
- * SeqTwoByteString. NOTE: if you bump MAX_TWOBYTESTR_CHARS, you'll also need
- * to modify the LOOP_* macro calls below to match.
- */
-#define MAX_TWOBYTESTR_CHARS 128
-#define MAX_TWOBYTESTR_BYTES (2 * MAX_TWOBYTESTR_CHARS)
-#define TO_ASCII(c) ((c) < 128 ? (c) : '?')
-
-#define APPEND_SEQTWOBYTESTR(str, len, attrs) \
- dtrace:helper:ustack: \
- /!this->done && len > 0 && TWOBYTE_SEQSTR(attrs)/ \
- { \
- this->i = 0; \
- this->stbuf = (uint16_t *)alloca(MAX_TWOBYTESTR_BYTES + 2); \
- copyinto(str + V8_OFF_TWOBYTESTR_CHARS, \
- MAX_TWOBYTESTR_BYTES, this->stbuf); \
- this->stbuf[MAX_TWOBYTESTR_BYTES - 1] = '\0'; \
- this->stbuf[MAX_TWOBYTESTR_BYTES] = '\0'; \
- \
- LOOP_8(LOOP_8(LOOP_4(LOOP_ITER(this->i, len, \
- MAX_TWOBYTESTR_CHARS, \
- APPEND_CHR(TO_ASCII(this->stbuf[this->i])))))) \
- \
- this->i = 0; \
- this->stbuf = 0; \
- }
-
-/*
- * Print out the given Node.js ExternalString, or do nothing if the string is
- * not an ASCII ExternalString.
- */
-#define APPEND_NODESTR(str, len, attrs) \
- dtrace:helper:ustack: \
- /!this->done && len > 0 && ASCII_EXTSTR(attrs)/ \
- { \
- this->resource = COPYIN_PTR(str + V8_OFF_EXTSTR_RSRC); \
- this->dataptr = COPYIN_PTR(this->resource + NODE_OFF_EXTSTR_DATA); \
- copyinto(this->dataptr, len, this->buf + this->off); \
- this->off += len; \
- }
-
-/*
- * Recall that each ConsString points to two other strings which are
- * semantically concatenated. Of course, these strings may themselves by
- * ConsStrings, but in D we can only expand this recursion to a finite level.
- * Thankfully, function and script names are generally not more than a few
- * levels deep, so we unroll the expansion up to three levels. Even this is
- * pretty hairy: we use strings "s0", ..., "s13", (each with "str", "len", and
- * "attr" fields -- see above) to store the expanded strings. We expand the
- * original string into s0 and s7, then s0 into s1 and s4, etc:
- *
- *
- * +---- str ----+
- * / \ <-- 1st expansion
- * / \
- * s0 s7
- * / \ / \
- * / \ / \ <-- 2nd expansion
- * / \ / \
- * s1 s4 s8 s11
- * / \ / \ / \ / \ <-- 3rd expansion
- * s2 s3 s5 s6 s9 s10 s12 s13
- *
- * Of course, for a given string, any of these expansions may not be needed.
- * For example, we may expand str and find that s0 is already a SeqString,
- * while s7 requires further expansion. So when we expand a ConsString, we
- * zero the length of the string itself, and then at the end we print out
- * all non-zero-length strings in order (including both internal nodes and
- * leafs in the tree above) to get the final output.
- */
-#define EXPAND_START() \
- dtrace:helper:ustack: \
- /!this->done/ \
- { \
- this->s0str = this->s1str = this->s2str = (off_t) 0; \
- this->s3str = this->s4str = this->s5str = (off_t) 0; \
- this->s6str = this->s7str = this->s8str = (off_t) 0; \
- this->s9str = this->s10str = this->s11str = (off_t) 0; \
- this->s12str = this->s13str = (off_t) 0; \
- \
- this->s0len = this->s1len = this->s2len = (off_t) 0; \
- this->s3len = this->s4len = this->s5len = (off_t) 0; \
- this->s6len = this->s7len = this->s8len = (off_t) 0; \
- this->s9len = this->s10len = this->s11len = (off_t) 0; \
- this->s12len = this->s13len = (off_t) 0; \
- \
- this->s0attrs = this->s1attrs = this->s2attrs = 0; \
- this->s3attrs = this->s4attrs = this->s5attrs = 0; \
- this->s6attrs = this->s7attrs = this->s8attrs = 0; \
- this->s9attrs = this->s10attrs = this->s11attrs = 0; \
- this->s12attrs = this->s13attrs = 0; \
- }
-
-/*
- * Expand the ConsString "str" (represented by "str", "len", and "attrs") into
- * strings "s1" (represented by "s1s", "s1l", and "s1a") and "s2" (represented
- * by "s2s", "s2l", "s2a"). If "str" is not a ConsString, do nothing.
- */
-#define EXPAND_STR(str, len, attrs, s1s, s1l, s1a, s2s, s2l, s2a) \
- dtrace:helper:ustack: \
- /!this->done && len > 0 && IS_CONSSTR(attrs)/ \
- { \
- len = 0; \
- \
- s1s = COPYIN_PTR(str + V8_OFF_CONSSTR_CAR); \
- LOAD_STRFIELDS(s1s, s1l, s1a) \
- \
- s2s = COPYIN_PTR(str + V8_OFF_CONSSTR_CDR); \
- LOAD_STRFIELDS(s2s, s2l, s2a) \
- }
-
-/*
- * Print out a ConsString by expanding it up to three levels and printing out
- * the resulting SeqStrings.
- */
-#define APPEND_CONSSTR(str, len, attrs) \
- EXPAND_START() \
- EXPAND_STR(str, len, attrs, \
- this->s0str, this->s0len, this->s0attrs, \
- this->s7str, this->s7len, this->s7attrs) \
- EXPAND_STR(this->s0str, this->s0len, this->s0attrs, \
- this->s1str, this->s1len, this->s1attrs, \
- this->s4str, this->s4len, this->s4attrs) \
- EXPAND_STR(this->s1str, this->s1len, this->s1attrs, \
- this->s2str, this->s2len, this->s2attrs, \
- this->s3str, this->s3len, this->s3attrs) \
- EXPAND_STR(this->s4str, this->s4len, this->s4attrs, \
- this->s5str, this->s5len, this->s5attrs, \
- this->s6str, this->s6len, this->s6attrs) \
- EXPAND_STR(this->s7str, this->s7len, this->s7attrs, \
- this->s8str, this->s8len, this->s8attrs, \
- this->s11str, this->s11len, this->s11attrs) \
- EXPAND_STR(this->s8str, this->s8len, this->s8attrs, \
- this->s9str, this->s9len, this->s9attrs, \
- this->s10str, this->s10len, this->s10attrs) \
- EXPAND_STR(this->s11str, this->s11len, this->s11attrs, \
- this->s12str, this->s12len, this->s12attrs, \
- this->s13str, this->s13len, this->s13attrs) \
- \
- APPEND_SEQSTR(str, len, attrs) \
- APPEND_SEQSTR(this->s0str, this->s0len, this->s0attrs) \
- APPEND_SEQSTR(this->s1str, this->s1len, this->s1attrs) \
- APPEND_SEQSTR(this->s2str, this->s2len, this->s2attrs) \
- APPEND_SEQSTR(this->s3str, this->s3len, this->s3attrs) \
- APPEND_SEQSTR(this->s4str, this->s4len, this->s4attrs) \
- APPEND_SEQSTR(this->s5str, this->s5len, this->s5attrs) \
- APPEND_SEQSTR(this->s6str, this->s6len, this->s6attrs) \
- APPEND_SEQSTR(this->s7str, this->s7len, this->s7attrs) \
- APPEND_SEQSTR(this->s8str, this->s8len, this->s8attrs) \
- APPEND_SEQSTR(this->s9str, this->s9len, this->s9attrs) \
- APPEND_SEQSTR(this->s10str, this->s10len, this->s10attrs) \
- APPEND_SEQSTR(this->s11str, this->s11len, this->s11attrs) \
- APPEND_SEQSTR(this->s12str, this->s12len, this->s12attrs) \
- APPEND_SEQSTR(this->s13str, this->s13len, this->s13attrs) \
-
-
-/*
- * Print out the given SeqString, ConsString, or ExternalString.
- * APPEND_CONSSTR implicitly handles SeqStrings as the degenerate case of an
- * expanded ConsString.
- */
-#define APPEND_V8STR(str, len, attrs) \
- APPEND_CONSSTR(str, len, attrs) \
- APPEND_NODESTR(str, len, attrs)
-
-/*
- * In this first clause we initialize all variables. We must explicitly clear
- * them because they may contain values left over from previous iterations.
- */
-dtrace:helper:ustack:
-{
- /* input */
- this->fp = arg1;
-
- /* output/flow control */
- this->buf = (char*) alloca(128);
- this->off = 0;
- this->done = 0;
-
- /* program state */
- this->ctx = (off_t) 0;
- this->marker = (off_t) 0;
- this->func = (off_t) 0;
- this->shared = (off_t) 0;
- this->map = (off_t) 0;
- this->attrs = 0;
- this->funcrawnamestr = (off_t) 0;
- this->hassharedname = 0;
- this->funcnamelen = 0;
- this->funcnameattrs = 0;
- this->script = (off_t) 0;
- this->scriptattrs = 0;
- this->scriptnamestr = (off_t) 0;
- this->scriptnamelen = 0;
- this->scriptnameattrs = 0;
- this->position = 0;
- this->line_ends = (off_t) 0;
- this->le_attrs = 0;
-
- /* binary search fields */
- this->bsearch_min = 0;
- this->bsearch_max = 0;
- this->ii = 0;
-}
-
-/*
- * Check for other common frame types for which we also have nothing to add.
- */
-dtrace:helper:ustack:
-/!this->done/
-{
- this->marker = COPYIN_PTR(this->fp + V8_OFF_FP_CONTEXT);
-}
-
-dtrace:helper:ustack:
-/!this->done && IS_SMI(this->marker) &&
- SMI_VALUE(this->marker) == V8_FT_ENTRY/
-{
- this->done = 1;
- APPEND_CHR8('<','<',' ','e','n','t','r','y');
- APPEND_CHR4(' ','>','>','\0');
- stringof(this->buf);
-}
-
-dtrace:helper:ustack:
-/!this->done && IS_SMI(this->marker) &&
- SMI_VALUE(this->marker) == V8_FT_ENTRYCONSTRUCT/
-{
- this->done = 1;
- APPEND_CHR8('<','<',' ','e','n','t','r','y');
- APPEND_CHR8('_','c','o','n','s','t','r','u');
- APPEND_CHR4('t',' ','>','>');
- APPEND_CHR('\0');
- stringof(this->buf);
-}
-
-dtrace:helper:ustack:
-/!this->done && IS_SMI(this->marker) &&
- SMI_VALUE(this->marker) == V8_FT_EXIT/
-{
- this->done = 1;
- APPEND_CHR8('<','<',' ','e','x','i','t',' ');
- APPEND_CHR4('>','>','\0','\0');
- stringof(this->buf);
-}
-
-dtrace:helper:ustack:
-/!this->done && IS_SMI(this->marker) &&
- SMI_VALUE(this->marker) == V8_FT_INTERNAL/
-{
- this->done = 1;
- APPEND_CHR8('<','<',' ','i','n','t','e','r');
- APPEND_CHR8('n','a','l',' ','>','>','\0','\0');
- stringof(this->buf);
-}
-
-dtrace:helper:ustack:
-/!this->done && IS_SMI(this->marker) &&
- SMI_VALUE(this->marker) == V8_FT_CONSTRUCT/
-{
- this->done = 1;
- APPEND_CHR8('<','<',' ','c','o','n','s','t');
- APPEND_CHR8('r','u','c','t','o','r',' ','>');
- APPEND_CHR4('>','\0','\0','\0');
- stringof(this->buf);
-}
-
-dtrace:helper:ustack:
-/!this->done && IS_SMI(this->marker) &&
- SMI_VALUE(this->marker) == V8_FT_STUB/
-{
- this->done = 1;
- APPEND_CHR8('<','<',' ','s','t','u','b',' ');
- APPEND_CHR4('>','>','\0','\0');
- stringof(this->buf);
-}
-
-/*
- * Now check for internal frames that we can only identify by seeing that
- * there's a Code object where there would be a JSFunction object for a
- * JavaScriptFrame.
- */
-dtrace:helper:ustack:
-/!this->done/
-{
- this->func = COPYIN_PTR(this->fp + V8_OFF_FP_FUNC);
- this->map = V8_MAP_PTR(COPYIN_PTR(this->func + V8_OFF_HEAPOBJ_MAP));
- this->attrs = COPYIN_UINT8(this->map + V8_OFF_MAP_ATTRS);
-}
-
-dtrace:helper:ustack:
-/!this->done && this->attrs == V8_IT_CODE/
-{
- this->done = 1;
- APPEND_CHR8('<','<',' ','i','n','t','e','r');
- APPEND_CHR8('n','a','l',' ','c','o','d','e');
- APPEND_CHR4(' ','>','>','\0');
- stringof(this->buf);
-}
-
-/*
- * At this point, we're either looking at a JavaScriptFrame or an
- * OptimizedFrame. For now, we assume JavaScript and start by grabbing the
- * function name.
- */
-dtrace:helper:ustack:
-/!this->done/
-{
- this->map = 0;
- this->attrs = 0;
-
- this->shared = COPYIN_PTR(this->func + V8_OFF_FUNC_SHARED);
- this->funcrawnamestr = COPYIN_PTR(this->shared + V8_OFF_RAW_NAME);
- this->hassharedname = this->funcrawnamestr !=
- NO_SHARED_FUNCTION_NAME_SENTINEL;
-}
-
-dtrace:helper:ustack:
-/!this->done && this->hassharedname/
-{
- LOAD_STRFIELDS(this->funcrawnamestr, this->funcnamelen,
- this->funcnameattrs);
-}
-
-dtrace:helper:ustack:
-/!this->done && this->funcnamelen == 0/
-{
- /*
- * This is an anonymous function, but if it was invoked as a method of
- * some object then V8 will have computed an inferred name that we can
- * include in the stack trace.
- */
- APPEND_CHR8('(','a','n','o','n',')',' ','a');
- APPEND_CHR('s');
- APPEND_CHR(' ');
-
- this->funcrawnamestr = COPYIN_PTR(this->shared + V8_OFF_SHARED_IDENT);
- LOAD_STRFIELDS(this->funcrawnamestr, this->funcnamelen,
- this->funcnameattrs);
-}
-
-dtrace:helper:ustack:
-/!this->done && this->funcnamelen == 0/
-{
- APPEND_CHR('(');
- APPEND_CHR4('a','n','o','n');
- APPEND_CHR(')');
-}
-
-APPEND_V8STR(this->funcrawnamestr, this->funcnamelen, this->funcnameattrs)
-
-/*
- * Now look for the name of the script where the function was defined. The
- * "script" itself may be undefined for special functions like "RegExp".
- */
-dtrace:helper:ustack:
-/!this->done/
-{
- this->script = COPYIN_PTR(this->shared + V8_OFF_SHARED_SCRIPT);
- this->map = V8_MAP_PTR(COPYIN_PTR(this->script + V8_OFF_HEAPOBJ_MAP));
- this->scriptattrs = COPYIN_UINT8(this->map + V8_OFF_MAP_ATTRS);
-}
-
-dtrace:helper:ustack:
-/!this->done && !V8_TYPE_SCRIPT(this->scriptattrs)/
-{
- APPEND_CHR('\0');
- this->done = 1;
- stringof(this->buf);
-}
-
-
-dtrace:helper:ustack:
-/!this->done/
-{
- this->scriptnamestr = COPYIN_PTR(this->script + V8_OFF_SCRIPT_NAME);
- LOAD_STRFIELDS(this->scriptnamestr, this->scriptnamelen,
- this->scriptnameattrs);
-}
-
-dtrace:helper:ustack:
-/!this->done && this->scriptnamelen != 0/
-{
- APPEND_CHR4(' ','a','t',' ');
-}
-
-APPEND_V8STR(this->scriptnamestr, this->scriptnamelen, this->scriptnameattrs)
-
-/*
- * Now look for file position and line number information.
- */
-dtrace:helper:ustack:
-/!this->done/
-{
- this->position = COPYIN_UINT32(this->shared + V8_OFF_SHARED_FUNIDENT);
- this->line_ends = COPYIN_PTR(this->script + V8_OFF_SCRIPT_LENDS);
- this->map = V8_MAP_PTR(COPYIN_PTR(this->line_ends + V8_OFF_HEAPOBJ_MAP));
- this->le_attrs = COPYIN_UINT8(this->map + V8_OFF_MAP_ATTRS);
-}
-
-dtrace:helper:ustack:
-/!this->done && this->le_attrs != V8_IT_FIXEDARRAY && this->position == 0/
-{
- APPEND_CHR('\0');
- this->done = 1;
- stringof(this->buf);
-}
-
-dtrace:helper:ustack:
-/!this->done && this->le_attrs != V8_IT_FIXEDARRAY/
-{
- /*
- * If the line number array was not a valid FixedArray, it's probably
- * undefined because V8 has not had to compute it yet. In this case we
- * just show the raw position and call it a day.
- */
- APPEND_CHR4(' ','p','o','s');
- APPEND_CHR(' ');
- APPEND_NUM(SMI_VALUE(this->position));
- APPEND_CHR('\0');
- this->done = 1;
- stringof(this->buf);
-}
-
-/*
- * At this point, we've got both a position in the script and an array
- * describing where each line of the file ends. We can use this to compute the
- * line number by binary searching the array. (This is also what V8 does when
- * computing stack traces.)
- */
-dtrace:helper:ustack:
-/!this->done/
-{
- /* initialize binary search */
- this->bsearch_line = this->position <
- SMI_VALUE(COPYIN_PTR(this->line_ends + V8_OFF_FA_DATA)) ? 1 : 0;
- this->bsearch_min = 0;
- this->bsearch_max = this->bsearch_line != 0 ? 0 :
- SMI_VALUE(COPYIN_PTR(this->line_ends + V8_OFF_FA_SIZE)) - 1;
-}
-
-/*
- * Of course, we can't iterate the binary search indefinitely, so we hardcode 15
- * iterations. That's enough to precisely identify the line number in files up
- * to 32768 lines of code.
- */
-#define BSEARCH_LOOP \
- dtrace:helper:ustack: \
- /!this->done && this->bsearch_max >= 1/ \
- { \
- this->ii = (this->bsearch_min + this->bsearch_max) >> 1; \
- } \
- \
- dtrace:helper:ustack: \
- /!this->done && this->bsearch_max >= 1 && \
- this->position > SMI_VALUE( \
- COPYIN_PTR(this->line_ends + V8_OFF_FA_DATA + \
- this->ii * sizeof (uint32_t)))/ \
- { \
- this->bsearch_min = this->ii + 1; \
- } \
- \
- dtrace:helper:ustack: \
- /!this->done && this->bsearch_max >= 1 && \
- this->position <= SMI_VALUE( \
- COPYIN_PTR(this->line_ends + V8_OFF_FA_DATA + \
- (this->ii - 1) * sizeof (uint32_t)))/ \
- { \
- this->bsearch_max = this->ii - 1; \
- }
-
-BSEARCH_LOOP
-BSEARCH_LOOP
-BSEARCH_LOOP
-BSEARCH_LOOP
-BSEARCH_LOOP
-BSEARCH_LOOP
-BSEARCH_LOOP
-BSEARCH_LOOP
-BSEARCH_LOOP
-BSEARCH_LOOP
-BSEARCH_LOOP
-BSEARCH_LOOP
-BSEARCH_LOOP
-BSEARCH_LOOP
-BSEARCH_LOOP
-
-dtrace:helper:ustack:
-/!this->done && !this->bsearch_line/
-{
- this->bsearch_line = this->ii + 1;
-}
-
-dtrace:helper:ustack:
-/!this->done/
-{
- APPEND_CHR(' ');
- APPEND_CHR4('l','i','n','e');
- APPEND_CHR(' ');
- APPEND_NUM(this->bsearch_line);
- APPEND_CHR('\0');
- this->done = 1;
- stringof(this->buf);
-}
-
-/* vim: set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
diff --git a/test/parallel/test-bootstrap-modules.js b/test/parallel/test-bootstrap-modules.js
index 495f08f716..bd7221529c 100644
--- a/test/parallel/test-bootstrap-modules.js
+++ b/test/parallel/test-bootstrap-modules.js
@@ -57,7 +57,6 @@ const expectedModules = new Set([
'NativeModule internal/console/constructor',
'NativeModule internal/console/global',
'NativeModule internal/constants',
- 'NativeModule internal/dtrace',
'NativeModule internal/encoding',
'NativeModule internal/errors',
'NativeModule internal/event_target',
@@ -235,11 +234,6 @@ if (common.hasCrypto) {
expectedModules.add('NativeModule internal/streams/lazy_transform');
}
-const { internalBinding } = require('internal/test/binding');
-if (internalBinding('config').hasDtrace) {
- expectedModules.add('Internal Binding dtrace');
-}
-
const difference = (setA, setB) => {
return new Set([...setA].filter((x) => !setB.has(x)));
};
diff --git a/test/parallel/test-internal-dtrace.js b/test/parallel/test-internal-dtrace.js
deleted file mode 100644
index 68991d739a..0000000000
--- a/test/parallel/test-internal-dtrace.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// Flags: --expose-internals
-'use strict';
-
-require('../common');
-const assert = require('assert');
-
-const {
- DTRACE_HTTP_CLIENT_REQUEST,
- DTRACE_HTTP_CLIENT_RESPONSE,
- DTRACE_HTTP_SERVER_REQUEST,
- DTRACE_HTTP_SERVER_RESPONSE,
- DTRACE_NET_SERVER_CONNECTION,
- DTRACE_NET_STREAM_END
-} = require('internal/dtrace');
-
-// We're just testing to make sure these are always defined and
-// callable. We don't actually test their function here.
-
-assert.strictEqual(typeof DTRACE_HTTP_CLIENT_REQUEST, 'function');
-assert.strictEqual(typeof DTRACE_HTTP_CLIENT_RESPONSE, 'function');
-assert.strictEqual(typeof DTRACE_HTTP_SERVER_REQUEST, 'function');
-assert.strictEqual(typeof DTRACE_HTTP_SERVER_RESPONSE, 'function');
-assert.strictEqual(typeof DTRACE_NET_SERVER_CONNECTION, 'function');
-assert.strictEqual(typeof DTRACE_NET_STREAM_END, 'function');
diff --git a/tools/install.py b/tools/install.py
index 2a41a286f4..bf8f5673fa 100755
--- a/tools/install.py
+++ b/tools/install.py
@@ -144,8 +144,6 @@ def files(action):
else:
output_lib = 'libnode.' + variables.get('shlib_suffix')
action([output_prefix + output_lib], 'lib/' + output_lib)
- if 'true' == variables.get('node_use_dtrace'):
- action(['out/Release/node.d'], 'lib/dtrace/node.d')
action(['deps/v8/tools/gdbinit'], 'share/doc/node/')
action(['deps/v8/tools/lldb_commands.py'], 'share/doc/node/')
diff --git a/tools/msvs/msi/i18n/de-de.wxl b/tools/msvs/msi/i18n/de-de.wxl
index 8ce814b2db..646d9c5564 100644
--- a/tools/msvs/msi/i18n/de-de.wxl
+++ b/tools/msvs/msi/i18n/de-de.wxl
@@ -12,9 +12,6 @@
<String Id="NodeRuntime_Title">Node.js-Laufzeitumgebung</String>
<String Id="NodeRuntime_Description">Installation der [ProductName]-Laufzeitumgebung (node.exe).</String>
- <String Id="NodeEtwSupport_Title">Event Tracing (ETW)</String>
- <String Id="NodeEtwSupport_Description">Installiert Unterstützung für Event Tracing (ETW)-Events, generiert von [ProductName].</String>
-
<String Id="npm_Title">npm-Paketmanager</String>
<String Id="npm_Description">Installiert npm, den empfohlenen Paketmanager für [ProductName].</String>
diff --git a/tools/msvs/msi/i18n/en-us.wxl b/tools/msvs/msi/i18n/en-us.wxl
index c47dabf1da..dc69f21824 100644
--- a/tools/msvs/msi/i18n/en-us.wxl
+++ b/tools/msvs/msi/i18n/en-us.wxl
@@ -20,9 +20,6 @@
<String Id="NodeRuntime_Title">Node.js runtime</String>
<String Id="NodeRuntime_Description">Install the core [ProductName] runtime (node.exe).</String>
- <String Id="NodeEtwSupport_Title">Event tracing (ETW)</String>
- <String Id="NodeEtwSupport_Description">Installs support for event tracing (ETW) events generated by [ProductName].</String>
-
<String Id="npm_Title">npm package manager</String>
<String Id="npm_Description">Install npm, the recommended package manager for [ProductName].</String>
diff --git a/tools/msvs/msi/i18n/it-it.wxl b/tools/msvs/msi/i18n/it-it.wxl
index 369074c642..26c02be0db 100644
--- a/tools/msvs/msi/i18n/it-it.wxl
+++ b/tools/msvs/msi/i18n/it-it.wxl
@@ -12,9 +12,6 @@
<String Id="NodeRuntime_Title">Node.js runtime</String>
<String Id="NodeRuntime_Description">Installa [ProductName] runtime (node.exe).</String>
- <String Id="NodeEtwSupport_Title">Event tracing (ETW)</String>
- <String Id="NodeEtwSupport_Description">Installa il supporto per gli eventi "event tracing" (ETW) generati da [ProductName].</String>
-
<String Id="npm_Title">npm package manager</String>
<String Id="npm_Description">Installa npm, il package manager raccomandato per [ProductName].</String>
diff --git a/tools/msvs/msi/i18n/zh-cn.wxl b/tools/msvs/msi/i18n/zh-cn.wxl
index c2c1f51262..b0f6b195f3 100644
--- a/tools/msvs/msi/i18n/zh-cn.wxl
+++ b/tools/msvs/msi/i18n/zh-cn.wxl
@@ -12,9 +12,6 @@
<String Id="NodeRuntime_Title">Node.js 运行时</String>
<String Id="NodeRuntime_Description">安装核心 [ProductName] 运行时(node.exe)。</String>
- <String Id="NodeEtwSupport_Title">事件追踪(ETW)</String>
- <String Id="NodeEtwSupport_Description">为 [ProductName] 生成的事件安装事件追踪(ETW)的支持。</String>
-
<String Id="npm_Title">npm 包管理器</String>
<String Id="npm_Description">安装 npm, [ProductName] 的推荐包管理器。</String>
diff --git a/tools/msvs/msi/nodemsi.wixproj b/tools/msvs/msi/nodemsi.wixproj
index f01ca4d772..41ee3b3c0b 100644
--- a/tools/msvs/msi/nodemsi.wixproj
+++ b/tools/msvs/msi/nodemsi.wixproj
@@ -16,33 +16,33 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>..\..\..\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
- <DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFilesFolder</DefineConstants>
+ <DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFilesFolder</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>..\..\..\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
- <DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFilesFolder</DefineConstants>
+ <DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFilesFolder</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<OutputPath>..\..\..\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
- <DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder</DefineConstants>
+ <DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder</DefineConstants>
<Cultures>en-US</Cultures>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>..\..\..\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
- <DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder</DefineConstants>
+ <DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|arm64' ">
<OutputPath>..\..\..\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
- <DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder</DefineConstants>
+ <DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|arm64' ">
<OutputPath>..\..\..\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
- <DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NoETW=$(NoETW);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder</DefineConstants>
+ <DefineConstants>Debug;ProductVersion=$(NodeVersion);FullVersion=$(FullVersion);DistTypeDir=$(DistTypeDir);NpmSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\npm\;CorepackSourceDir=..\..\..\Release\node-v$(FullVersion)-win-$(Platform)\node_modules\corepack\;ProgramFilesFolderId=ProgramFiles64Folder</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<EnableProjectHarvesting>True</EnableProjectHarvesting>
diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs
index 0c9c09e5b0..c6984777fa 100755
--- a/tools/msvs/msi/product.wxs
+++ b/tools/msvs/msi/product.wxs
@@ -80,13 +80,6 @@
<ComponentRef Id="InstallToolsBat" />
<ComponentRef Id="SetInstallDirPermission" />
<ComponentGroupRef Id="Product.Generated"/>
-
- <Feature Id="NodeEtwSupport"
- Level="1"
- Title="!(loc.NodeEtwSupport_Title)"
- Description="!(loc.NodeEtwSupport_Description)">
- <ComponentRef Id="NodeEtwSupport"/>
- </Feature>
</Feature>
<Feature Id="corepack"
@@ -175,14 +168,6 @@
<Component Id="InstallToolsBat">
<File Id="InstallToolsBat" KeyPath="yes" Source="$(var.RepoDir)\tools\msvs\install_tools\install_tools.bat"/>
</Component>
-
- <?if $(var.NoETW) != 1 ?>
- <Component Id="NodeEtwSupport">
- <File Id="node_etw_provider.man" Source="$(var.RepoDir)\src\res\node_etw_provider.man">
- <util:EventManifest MessageFile="[INSTALLDIR]node.exe" ResourceFile="[INSTALLDIR]node.exe"/>
- </File>
- </Component>
- <?endif?>
</DirectoryRef>
<DirectoryRef Id="INSTALLDIR">
diff --git a/vcbuild.bat b/vcbuild.bat
index eb2fc28628..62334130f9 100644
--- a/vcbuild.bat
+++ b/vcbuild.bat
@@ -48,8 +48,6 @@ set lint_js=
set lint_cpp=
set lint_md=
set lint_md_build=
-set noetw=
-set noetw_msi_arg=
set i18n_arg=
set download_arg=
set build_release=
@@ -93,7 +91,6 @@ if /i "%1"=="sign" set sign=1&goto arg-ok
if /i "%1"=="nosnapshot" set nosnapshot=1&goto arg-ok
if /i "%1"=="nonpm" set nonpm=1&goto arg-ok
if /i "%1"=="nocorepack" set nocorepack=1&goto arg-ok
-if /i "%1"=="noetw" set noetw=1&goto arg-ok
if /i "%1"=="ltcg" set ltcg=1&goto arg-ok
if /i "%1"=="licensertf" set licensertf=1&goto arg-ok
if /i "%1"=="test" set test_args=%test_args% %common_test_suites%&set lint_cpp=1&set lint_js=1&set lint_md=1&goto arg-ok
@@ -190,7 +187,6 @@ if "%config%"=="Debug" set configure_flags=%configure_flags% --debug
if defined nosnapshot set configure_flags=%configure_flags% --without-snapshot
if defined nonpm set configure_flags=%configure_flags% --without-npm
if defined nocorepack set configure_flags=%configure_flags% --without-corepack
-if defined noetw set configure_flags=%configure_flags% --without-etw& set noetw_msi_arg=/p:NoETW=1
if defined ltcg set configure_flags=%configure_flags% --with-ltcg
if defined release_urlbase set configure_flags=%configure_flags% --release-urlbase=%release_urlbase%
if defined download_arg set configure_flags=%configure_flags% %download_arg%
@@ -477,10 +473,6 @@ copy /Y ..\tools\msvs\nodevars.bat %TARGET_NAME%\ > nul
if errorlevel 1 echo Cannot copy nodevars.bat && goto package_error
copy /Y ..\tools\msvs\install_tools\*.* %TARGET_NAME%\ > nul
if errorlevel 1 echo Cannot copy install_tools scripts && goto package_error
-if not defined noetw (
- copy /Y ..\src\res\node_etw_provider.man %TARGET_NAME%\ > nul
- if errorlevel 1 echo Cannot copy node_etw_provider.man && goto package_error
-)
if defined dll (
copy /Y libnode.dll %TARGET_NAME%\ > nul
if errorlevel 1 echo Cannot copy libnode.dll && goto package_error
@@ -533,7 +525,7 @@ if not defined msi goto install-doctools
echo Building node-v%FULLVERSION%-%target_arch%.msi
set "msbsdk="
if defined WindowsSDKVersion set "msbsdk=/p:WindowsTargetPlatformVersion=%WindowsSDKVersion:~0,-1%"
-msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build %msbsdk% /p:PlatformToolset=%PLATFORM_TOOLSET% /p:WixSdkDir="%WIXSDKDIR%" /p:Configuration=%config% /p:Platform=%target_arch% /p:NodeVersion=%NODE_VERSION% /p:FullVersion=%FULLVERSION% /p:DistTypeDir=%DISTTYPEDIR% %noetw_msi_arg% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
+msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /m /t:Clean,Build %msbsdk% /p:PlatformToolset=%PLATFORM_TOOLSET% /p:WixSdkDir="%WIXSDKDIR%" /p:Configuration=%config% /p:Platform=%target_arch% /p:NodeVersion=%NODE_VERSION% /p:FullVersion=%FULLVERSION% /p:DistTypeDir=%DISTTYPEDIR% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo
if errorlevel 1 goto exit
if not defined sign goto upload
@@ -772,7 +764,7 @@ set exit_code=1
goto exit
:help
-echo vcbuild.bat [debug/release] [msi] [doc] [test/test-all/test-addons/test-doc/test-js-native-api/test-node-api/test-benchmark/test-internet/test-pummel/test-simple/test-message/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-async-hooks/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [projgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [nonpm] [nocorepack] [noetw] [ltcg] [licensetf] [sign] [ia32/x86/x64/arm64] [vs2019/vs2022] [download-all] [lint/lint-ci/lint-js/lint-md] [lint-md-build] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [cctest] [no-cctest] [openssl-no-asm]
+echo vcbuild.bat [debug/release] [msi] [doc] [test/test-all/test-addons/test-doc/test-js-native-api/test-node-api/test-benchmark/test-internet/test-pummel/test-simple/test-message/test-tick-processor/test-known-issues/test-node-inspect/test-check-deopts/test-npm/test-async-hooks/test-v8/test-v8-intl/test-v8-benchmarks/test-v8-all] [ignore-flaky] [static/dll] [noprojgen] [projgen] [small-icu/full-icu/without-intl] [nobuild] [nosnapshot] [nonpm] [nocorepack] [ltcg] [licensetf] [sign] [ia32/x86/x64/arm64] [vs2019/vs2022] [download-all] [lint/lint-ci/lint-js/lint-md] [lint-md-build] [package] [build-release] [upload] [no-NODE-OPTIONS] [link-module path-to-module] [debug-http2] [debug-nghttp2] [clean] [cctest] [no-cctest] [openssl-no-asm]
echo Examples:
echo vcbuild.bat : builds release build
echo vcbuild.bat debug : builds debug build