Skip to content

Commit

Permalink
build: remove dtrace & etw support
Browse files Browse the repository at this point in the history
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: #43649
  • Loading branch information
bnoordhuis committed Jul 1, 2022
1 parent 5de16e0 commit e2189e8
Show file tree
Hide file tree
Showing 31 changed files with 8 additions and 2,719 deletions.
3 changes: 0 additions & 3 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,6 @@
}],
],
}],
['OS=="freebsd" and node_use_dtrace=="true"', {
'libraries': [ '-lelf' ],
}],
['OS=="freebsd"', {
'ldflags': [
'-Wl,--export-dynamic',
Expand Down
44 changes: 0 additions & 44 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,6 @@
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',
Expand Down Expand Up @@ -628,18 +616,6 @@

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',
Expand Down Expand Up @@ -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
Expand All @@ -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.')
Expand Down
1 change: 0 additions & 1 deletion doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
7 changes: 0 additions & 7 deletions lib/_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ const {
validateInteger,
} = require('internal/validators');
const { getTimerDuration } = require('internal/timers');
const {
DTRACE_HTTP_CLIENT_REQUEST,
DTRACE_HTTP_CLIENT_RESPONSE
} = require('internal/dtrace');

const {
hasObserver,
startPerf,
Expand Down Expand Up @@ -352,7 +347,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, {
Expand Down Expand Up @@ -633,7 +627,6 @@ function parserOnIncomingClient(res, shouldKeepAlive) {
req.shouldKeepAlive = false;
}

DTRACE_HTTP_CLIENT_RESPONSE(socket, req);
if (req[kClientRequestStatistics] && hasObserver('http')) {
stopPerf(req, kClientRequestStatistics, {
detail: {
Expand Down
6 changes: 0 additions & 6 deletions lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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({
Expand Down
21 changes: 0 additions & 21 deletions lib/internal/dtrace.js

This file was deleted.

6 changes: 0 additions & 6 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,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;
Expand Down Expand Up @@ -653,7 +649,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;
};

Expand Down Expand Up @@ -1682,7 +1677,6 @@ function onconnection(err, clientHandle) {
socket.server = self;
socket._server = self;

DTRACE_NET_SERVER_CONNECTION(socket);
self.emit('connection', socket);
}

Expand Down
Loading

0 comments on commit e2189e8

Please sign in to comment.