src: Remove lttng support.
This cleans up and removes lttng support completely. Recent discussion on a PR to deprecate lttng suggested that we remove it completely pending feedback from the TSC. This should be considered a non breaking change, as a recent PR reveals that compiling with this system has been broken for nearly two years. Refs: https://github.com/nodejs/node/issues/18971 Refs: https://github.com/nodejs/node/pull/18975 Refs: https://github.com/nodejs/node/pull/18945 PR-URL: https://github.com/nodejs/node/pull/18982 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jackson Tian <shyvo1987@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
38eb0fa737
commit
30fd3d25df
@ -263,12 +263,6 @@ module.exports = {
|
|||||||
DTRACE_HTTP_SERVER_RESPONSE: false,
|
DTRACE_HTTP_SERVER_RESPONSE: false,
|
||||||
DTRACE_NET_SERVER_CONNECTION: false,
|
DTRACE_NET_SERVER_CONNECTION: false,
|
||||||
DTRACE_NET_STREAM_END: false,
|
DTRACE_NET_STREAM_END: false,
|
||||||
LTTNG_HTTP_CLIENT_REQUEST: false,
|
|
||||||
LTTNG_HTTP_CLIENT_RESPONSE: false,
|
|
||||||
LTTNG_HTTP_SERVER_REQUEST: false,
|
|
||||||
LTTNG_HTTP_SERVER_RESPONSE: false,
|
|
||||||
LTTNG_NET_SERVER_CONNECTION: false,
|
|
||||||
LTTNG_NET_STREAM_END: false,
|
|
||||||
internalBinding: false,
|
internalBinding: false,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
14
configure
vendored
14
configure
vendored
@ -383,11 +383,6 @@ parser.add_option('--with-dtrace',
|
|||||||
dest='with_dtrace',
|
dest='with_dtrace',
|
||||||
help='build with DTrace (default is true on sunos and darwin)')
|
help='build with DTrace (default is true on sunos and darwin)')
|
||||||
|
|
||||||
parser.add_option('--with-lttng',
|
|
||||||
action='store_true',
|
|
||||||
dest='with_lttng',
|
|
||||||
help='build with Lttng (Only supported on Linux)')
|
|
||||||
|
|
||||||
parser.add_option('--with-etw',
|
parser.add_option('--with-etw',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
dest='with_etw',
|
dest='with_etw',
|
||||||
@ -908,15 +903,6 @@ def configure_node(o):
|
|||||||
else:
|
else:
|
||||||
o['variables']['node_use_dtrace'] = 'false'
|
o['variables']['node_use_dtrace'] = 'false'
|
||||||
|
|
||||||
# Enable Lttng if --with-lttng was defined. Use logic similar to
|
|
||||||
# ETW for windows. Lttng is only available on the Linux platform.
|
|
||||||
if flavor == 'linux':
|
|
||||||
o['variables']['node_use_lttng'] = b(options.with_lttng)
|
|
||||||
elif options.with_lttng:
|
|
||||||
raise Exception('lttng is only supported on Linux.')
|
|
||||||
else:
|
|
||||||
o['variables']['node_use_lttng'] = 'false'
|
|
||||||
|
|
||||||
if options.no_ifaddrs:
|
if options.no_ifaddrs:
|
||||||
o['defines'] += ['SUNOS_NO_IFADDRS']
|
o['defines'] += ['SUNOS_NO_IFADDRS']
|
||||||
|
|
||||||
|
6
deps/node-inspect/.eslintrc
vendored
6
deps/node-inspect/.eslintrc
vendored
@ -139,9 +139,3 @@ globals:
|
|||||||
DTRACE_HTTP_SERVER_RESPONSE: false
|
DTRACE_HTTP_SERVER_RESPONSE: false
|
||||||
DTRACE_NET_SERVER_CONNECTION: false
|
DTRACE_NET_SERVER_CONNECTION: false
|
||||||
DTRACE_NET_STREAM_END: false
|
DTRACE_NET_STREAM_END: false
|
||||||
LTTNG_HTTP_CLIENT_REQUEST: false
|
|
||||||
LTTNG_HTTP_CLIENT_RESPONSE: false
|
|
||||||
LTTNG_HTTP_SERVER_REQUEST: false
|
|
||||||
LTTNG_HTTP_SERVER_RESPONSE: false
|
|
||||||
LTTNG_NET_SERVER_CONNECTION: false
|
|
||||||
LTTNG_NET_STREAM_END: false
|
|
||||||
|
@ -146,7 +146,7 @@ A good commit message should describe what changed and why.
|
|||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
- `net: add localAddress and localPort to Socket`
|
- `net: add localAddress and localPort to Socket`
|
||||||
- `src: fix typos in node_lttng_provider.h`
|
- `src: fix typos in async_wrap.h`
|
||||||
|
|
||||||
|
|
||||||
2. Keep the second line blank.
|
2. Keep the second line blank.
|
||||||
|
@ -254,7 +254,6 @@ util.inherits(ClientRequest, OutgoingMessage);
|
|||||||
|
|
||||||
ClientRequest.prototype._finish = function _finish() {
|
ClientRequest.prototype._finish = function _finish() {
|
||||||
DTRACE_HTTP_CLIENT_REQUEST(this, this.connection);
|
DTRACE_HTTP_CLIENT_REQUEST(this, this.connection);
|
||||||
LTTNG_HTTP_CLIENT_REQUEST(this, this.connection);
|
|
||||||
COUNTER_HTTP_CLIENT_REQUEST();
|
COUNTER_HTTP_CLIENT_REQUEST();
|
||||||
OutgoingMessage.prototype._finish.call(this);
|
OutgoingMessage.prototype._finish.call(this);
|
||||||
};
|
};
|
||||||
@ -511,7 +510,6 @@ function parserOnIncomingClient(res, shouldKeepAlive) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DTRACE_HTTP_CLIENT_RESPONSE(socket, req);
|
DTRACE_HTTP_CLIENT_RESPONSE(socket, req);
|
||||||
LTTNG_HTTP_CLIENT_RESPONSE(socket, req);
|
|
||||||
COUNTER_HTTP_CLIENT_RESPONSE();
|
COUNTER_HTTP_CLIENT_RESPONSE();
|
||||||
req.res = res;
|
req.res = res;
|
||||||
res.req = req;
|
res.req = req;
|
||||||
|
@ -135,7 +135,6 @@ util.inherits(ServerResponse, OutgoingMessage);
|
|||||||
|
|
||||||
ServerResponse.prototype._finish = function _finish() {
|
ServerResponse.prototype._finish = function _finish() {
|
||||||
DTRACE_HTTP_SERVER_RESPONSE(this.connection);
|
DTRACE_HTTP_SERVER_RESPONSE(this.connection);
|
||||||
LTTNG_HTTP_SERVER_RESPONSE(this.connection);
|
|
||||||
COUNTER_HTTP_SERVER_RESPONSE();
|
COUNTER_HTTP_SERVER_RESPONSE();
|
||||||
OutgoingMessage.prototype._finish.call(this);
|
OutgoingMessage.prototype._finish.call(this);
|
||||||
};
|
};
|
||||||
@ -611,7 +610,6 @@ function parserOnIncoming(server, socket, state, req, keepAlive) {
|
|||||||
|
|
||||||
res.shouldKeepAlive = keepAlive;
|
res.shouldKeepAlive = keepAlive;
|
||||||
DTRACE_HTTP_SERVER_REQUEST(req, socket);
|
DTRACE_HTTP_SERVER_REQUEST(req, socket);
|
||||||
LTTNG_HTTP_SERVER_REQUEST(req, socket);
|
|
||||||
COUNTER_HTTP_SERVER_REQUEST();
|
COUNTER_HTTP_SERVER_REQUEST();
|
||||||
|
|
||||||
if (socket._httpMessage) {
|
if (socket._httpMessage) {
|
||||||
|
@ -506,7 +506,6 @@ Socket.prototype._read = function(n) {
|
|||||||
Socket.prototype.end = function(data, encoding, callback) {
|
Socket.prototype.end = function(data, encoding, callback) {
|
||||||
stream.Duplex.prototype.end.call(this, data, encoding, callback);
|
stream.Duplex.prototype.end.call(this, data, encoding, callback);
|
||||||
DTRACE_NET_STREAM_END(this);
|
DTRACE_NET_STREAM_END(this);
|
||||||
LTTNG_NET_STREAM_END(this);
|
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1579,7 +1578,6 @@ function onconnection(err, clientHandle) {
|
|||||||
socket._server = self;
|
socket._server = self;
|
||||||
|
|
||||||
DTRACE_NET_SERVER_CONNECTION(socket);
|
DTRACE_NET_SERVER_CONNECTION(socket);
|
||||||
LTTNG_NET_SERVER_CONNECTION(socket);
|
|
||||||
COUNTER_NET_SERVER_CONNECTION(socket);
|
COUNTER_NET_SERVER_CONNECTION(socket);
|
||||||
self.emit('connection', socket);
|
self.emit('connection', socket);
|
||||||
}
|
}
|
||||||
|
17
node.gyp
17
node.gyp
@ -3,7 +3,6 @@
|
|||||||
'v8_use_snapshot%': 'false',
|
'v8_use_snapshot%': 'false',
|
||||||
'v8_trace_maps%': 0,
|
'v8_trace_maps%': 0,
|
||||||
'node_use_dtrace%': 'false',
|
'node_use_dtrace%': 'false',
|
||||||
'node_use_lttng%': 'false',
|
|
||||||
'node_use_etw%': 'false',
|
'node_use_etw%': 'false',
|
||||||
'node_use_perfctr%': 'false',
|
'node_use_perfctr%': 'false',
|
||||||
'node_no_browser_globals%': 'false',
|
'node_no_browser_globals%': 'false',
|
||||||
@ -530,19 +529,6 @@
|
|||||||
}],
|
}],
|
||||||
],
|
],
|
||||||
}],
|
}],
|
||||||
[ 'node_use_lttng=="true"', {
|
|
||||||
'defines': [ 'HAVE_LTTNG=1' ],
|
|
||||||
'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ],
|
|
||||||
'libraries': [ '-llttng-ust' ],
|
|
||||||
'include_dirs': [
|
|
||||||
'src',
|
|
||||||
'tools/msvs/genfiles',
|
|
||||||
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
|
|
||||||
],
|
|
||||||
'sources': [
|
|
||||||
'src/node_lttng.cc'
|
|
||||||
],
|
|
||||||
}],
|
|
||||||
[ 'node_use_dtrace=="true"', {
|
[ 'node_use_dtrace=="true"', {
|
||||||
'defines': [ 'HAVE_DTRACE=1' ],
|
'defines': [ 'HAVE_DTRACE=1' ],
|
||||||
'dependencies': [
|
'dependencies': [
|
||||||
@ -736,9 +722,6 @@
|
|||||||
[ 'node_use_dtrace=="false" and node_use_etw=="false"', {
|
[ 'node_use_dtrace=="false" and node_use_etw=="false"', {
|
||||||
'inputs': [ 'src/notrace_macros.py' ]
|
'inputs': [ 'src/notrace_macros.py' ]
|
||||||
}],
|
}],
|
||||||
[ 'node_use_lttng=="false"', {
|
|
||||||
'inputs': [ 'src/nolttng_macros.py' ]
|
|
||||||
}],
|
|
||||||
[ 'node_use_perfctr=="false"', {
|
[ 'node_use_perfctr=="false"', {
|
||||||
'inputs': [ 'src/noperfctr_macros.py' ]
|
'inputs': [ 'src/noperfctr_macros.py' ]
|
||||||
}]
|
}]
|
||||||
|
@ -49,10 +49,6 @@
|
|||||||
#include "node_dtrace.h"
|
#include "node_dtrace.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined HAVE_LTTNG
|
|
||||||
#include "node_lttng.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "ares.h"
|
#include "ares.h"
|
||||||
#include "async_wrap-inl.h"
|
#include "async_wrap-inl.h"
|
||||||
#include "env-inl.h"
|
#include "env-inl.h"
|
||||||
@ -3340,10 +3336,6 @@ void LoadEnvironment(Environment* env) {
|
|||||||
InitDTrace(env, global);
|
InitDTrace(env, global);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined HAVE_LTTNG
|
|
||||||
InitLTTNG(env, global);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined HAVE_PERFCTR
|
#if defined HAVE_PERFCTR
|
||||||
InitPerfCounters(env, global);
|
InitPerfCounters(env, global);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,262 +0,0 @@
|
|||||||
#include "util.h"
|
|
||||||
|
|
||||||
#ifdef HAVE_LTTNG
|
|
||||||
#include "node_lttng.h"
|
|
||||||
#include "node_lttng_provider.h"
|
|
||||||
#include <string.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"
|
|
||||||
|
|
||||||
namespace node {
|
|
||||||
|
|
||||||
using v8::FunctionCallbackInfo;
|
|
||||||
using v8::FunctionTemplate;
|
|
||||||
using v8::GCCallbackFlags;
|
|
||||||
using v8::GCType;
|
|
||||||
using v8::HandleScope;
|
|
||||||
using v8::Isolate;
|
|
||||||
using v8::Local;
|
|
||||||
using v8::Object;
|
|
||||||
using v8::String;
|
|
||||||
using v8::Value;
|
|
||||||
|
|
||||||
#define SLURP_STRING(obj, member, valp) \
|
|
||||||
if (!(obj)->IsObject()) { \
|
|
||||||
return env->ThrowError( \
|
|
||||||
"expected object for " #obj " to contain string member " #member); \
|
|
||||||
} \
|
|
||||||
node::Utf8Value _##member(env->isolate(), \
|
|
||||||
obj->Get(OneByteString(env->isolate(), #member))); \
|
|
||||||
if ((*(const char **)valp = *_##member) == nullptr) \
|
|
||||||
*(const char **)valp = "<unknown>";
|
|
||||||
|
|
||||||
#define SLURP_INT(obj, member, valp) \
|
|
||||||
if (!(obj)->IsObject()) { \
|
|
||||||
return env->ThrowError( \
|
|
||||||
"expected object for " #obj " to contain integer member " #member); \
|
|
||||||
} \
|
|
||||||
*valp = obj->Get(OneByteString(env->isolate(), #member)) \
|
|
||||||
->ToInteger(env->isolate())->Value();
|
|
||||||
|
|
||||||
#define SLURP_OBJECT(obj, member, valp) \
|
|
||||||
if (!(obj)->IsObject()) { \
|
|
||||||
return env->ThrowError( \
|
|
||||||
"expected object for " #obj " to contain object member " #member); \
|
|
||||||
} \
|
|
||||||
*valp = Local<Object>::Cast(obj->Get(OneByteString(env->isolate(), #member)));
|
|
||||||
|
|
||||||
#define SLURP_CONNECTION(arg, conn) \
|
|
||||||
if (!(arg)->IsObject()) { \
|
|
||||||
return env->ThrowError( \
|
|
||||||
"expected argument " #arg " to be a connection object"); \
|
|
||||||
} \
|
|
||||||
node_lttng_connection_t conn; \
|
|
||||||
Local<Object> _##conn = Local<Object>::Cast(arg); \
|
|
||||||
Local<Value> _handle = \
|
|
||||||
(_##conn)->Get(FIXED_ONE_BYTE_STRING(env->isolate(), "_handle")); \
|
|
||||||
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 env->ThrowError( \
|
|
||||||
"expected argument " #arg " to be a connection object"); \
|
|
||||||
} \
|
|
||||||
node_lttng_connection_t conn; \
|
|
||||||
Local<Object> _##conn = Local<Object>::Cast(arg); \
|
|
||||||
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 env->ThrowError( \
|
|
||||||
"expected argument " #arg0 " to be a connection object"); \
|
|
||||||
} \
|
|
||||||
if (!(arg1)->IsObject()) { \
|
|
||||||
return env->ThrowError( \
|
|
||||||
"expected argument " #arg1 " to be a connection object"); \
|
|
||||||
} \
|
|
||||||
node_lttng_connection_t conn; \
|
|
||||||
Local<Object> _##conn = Local<Object>::Cast(arg0); \
|
|
||||||
SLURP_INT(_##conn, fd, &conn.fd); \
|
|
||||||
SLURP_INT(_##conn, bufferSize, &conn.buffered); \
|
|
||||||
_##conn = Local<Object>::Cast(arg1); \
|
|
||||||
SLURP_STRING(_##conn, host, &conn.remote); \
|
|
||||||
SLURP_INT(_##conn, port, &conn.port);
|
|
||||||
|
|
||||||
|
|
||||||
void LTTNG_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 LTTNG_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 LTTNG_HTTP_SERVER_REQUEST(const FunctionCallbackInfo<Value>& args) {
|
|
||||||
node_lttng_http_server_request_t req;
|
|
||||||
|
|
||||||
if (!NODE_HTTP_SERVER_REQUEST_ENABLED())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!args[0]->IsObject())
|
|
||||||
return;
|
|
||||||
|
|
||||||
Environment* env = Environment::GetCurrent(args);
|
|
||||||
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 env->ThrowError(
|
|
||||||
"expected object for request to contain string member headers");
|
|
||||||
}
|
|
||||||
|
|
||||||
Local<Value> strfwdfor = headers->Get(env->x_forwarded_string());
|
|
||||||
node::Utf8Value fwdfor(env->isolate(), strfwdfor);
|
|
||||||
req.forwarded_for = *fwdfor;
|
|
||||||
|
|
||||||
if (!strfwdfor->IsString() || req.forwarded_for == nullptr)
|
|
||||||
req.forwarded_for = "";
|
|
||||||
|
|
||||||
SLURP_CONNECTION(args[1], conn);
|
|
||||||
NODE_HTTP_SERVER_REQUEST(&req, &conn, conn.remote, conn.port, req.method, \
|
|
||||||
req.url, conn.fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LTTNG_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 LTTNG_HTTP_CLIENT_REQUEST(const FunctionCallbackInfo<Value>& args) {
|
|
||||||
node_lttng_http_client_request_t req;
|
|
||||||
char* header;
|
|
||||||
|
|
||||||
if (!NODE_HTTP_CLIENT_REQUEST_ENABLED())
|
|
||||||
return;
|
|
||||||
|
|
||||||
Environment* env = Environment::GetCurrent(args);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 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
|
|
||||||
* LTTNG_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 LTTNG_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 lttng_gc_start(Isolate* isolate, GCType type, GCCallbackFlags flags) {
|
|
||||||
NODE_GC_START(type, flags, isolate);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void lttng_gc_done(Isolate* isolate, GCType type, GCCallbackFlags flags) {
|
|
||||||
NODE_GC_DONE(type, flags, isolate);
|
|
||||||
}
|
|
||||||
|
|
||||||
void InitLTTNG(Environment* env, Local<Object> target) {
|
|
||||||
HandleScope scope(env->isolate());
|
|
||||||
|
|
||||||
static struct {
|
|
||||||
const char *name;
|
|
||||||
void (*func)(const FunctionCallbackInfo<Value>&);
|
|
||||||
} tab[] = {
|
|
||||||
#define NODE_PROBE(name) #name, name
|
|
||||||
{ NODE_PROBE(LTTNG_NET_SERVER_CONNECTION) },
|
|
||||||
{ NODE_PROBE(LTTNG_NET_STREAM_END) },
|
|
||||||
{ NODE_PROBE(LTTNG_HTTP_SERVER_REQUEST) },
|
|
||||||
{ NODE_PROBE(LTTNG_HTTP_SERVER_RESPONSE) },
|
|
||||||
{ NODE_PROBE(LTTNG_HTTP_CLIENT_REQUEST) },
|
|
||||||
{ NODE_PROBE(LTTNG_HTTP_CLIENT_RESPONSE) }
|
|
||||||
#undef NODE_PROBE
|
|
||||||
};
|
|
||||||
|
|
||||||
for (size_t i = 0; i < arraysize(tab); i++) {
|
|
||||||
Local<String> key = OneByteString(env->isolate(), tab[i].name);
|
|
||||||
Local<Value> val = env->NewFunctionTemplate(tab[i].func)->GetFunction();
|
|
||||||
target->Set(key, val);
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined HAVE_LTTNG
|
|
||||||
env->isolate()->AddGCPrologueCallback(lttng_gc_start);
|
|
||||||
env->isolate()->AddGCEpilogueCallback(lttng_gc_done);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace node
|
|
@ -1,44 +0,0 @@
|
|||||||
#ifndef SRC_NODE_LTTNG_H_
|
|
||||||
#define SRC_NODE_LTTNG_H_
|
|
||||||
|
|
||||||
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
||||||
|
|
||||||
#include "node.h"
|
|
||||||
#include "v8.h"
|
|
||||||
#include "env.h"
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
typedef struct {
|
|
||||||
int32_t fd;
|
|
||||||
int32_t port;
|
|
||||||
const char* remote;
|
|
||||||
int32_t buffered;
|
|
||||||
} node_lttng_connection_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
const char* url;
|
|
||||||
const char* method;
|
|
||||||
} node_lttng_http_client_request_t;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
union {
|
|
||||||
uint32_t version;
|
|
||||||
uintptr_t unused; /* for compat. with old 64-bit struct */
|
|
||||||
} _un;
|
|
||||||
const char* url;
|
|
||||||
const char* method;
|
|
||||||
const char* forwarded_for;
|
|
||||||
const char* _pad[8];
|
|
||||||
} node_lttng_http_server_request_t;
|
|
||||||
|
|
||||||
} // extern "C"
|
|
||||||
|
|
||||||
namespace node {
|
|
||||||
|
|
||||||
void InitLTTNG(Environment* env, v8::Local<v8::Object> target);
|
|
||||||
|
|
||||||
} // namespace node
|
|
||||||
|
|
||||||
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
||||||
|
|
||||||
#endif // SRC_NODE_LTTNG_H_
|
|
@ -1,106 +0,0 @@
|
|||||||
#ifndef SRC_NODE_LTTNG_PROVIDER_H_
|
|
||||||
#define SRC_NODE_LTTNG_PROVIDER_H_
|
|
||||||
|
|
||||||
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
||||||
|
|
||||||
#define TRACEPOINT_CREATE_PROBES
|
|
||||||
#define TRACEPOINT_DEFINE
|
|
||||||
#include "node_lttng_tp.h"
|
|
||||||
|
|
||||||
namespace node {
|
|
||||||
|
|
||||||
#define FOR_ALL_GC_TYPES(APPLY) \
|
|
||||||
APPLY(kGCTypeScavenge) \
|
|
||||||
APPLY(kGCTypeMarkSweepCompact) \
|
|
||||||
APPLY(kGCTypeAll)
|
|
||||||
|
|
||||||
#define FOR_ALL_GC_CALLBACK_FLAGS(APPLY) \
|
|
||||||
APPLY(kNoGCCallbackFlags) \
|
|
||||||
APPLY(kGCCallbackFlagConstructRetainedObjectInfos) \
|
|
||||||
APPLY(kGCCallbackFlagForced) \
|
|
||||||
APPLY(kGCCallbackFlagSynchronousPhantomCallbackProcessing)
|
|
||||||
|
|
||||||
void NODE_HTTP_SERVER_REQUEST(node_lttng_http_server_request_t* req,
|
|
||||||
node_lttng_connection_t* conn,
|
|
||||||
const char *remote, int port,
|
|
||||||
const char *method, const char *url,
|
|
||||||
int fd) {
|
|
||||||
tracepoint(node, http_server_request, req->url, req->method, \
|
|
||||||
req->forwarded_for);
|
|
||||||
}
|
|
||||||
|
|
||||||
void NODE_HTTP_SERVER_RESPONSE(node_lttng_connection_t* conn,
|
|
||||||
const char *remote, int port, int fd) {
|
|
||||||
tracepoint(node, http_server_response, port, conn->remote, fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
void NODE_HTTP_CLIENT_REQUEST(node_lttng_http_client_request_t* req,
|
|
||||||
node_lttng_connection_t* conn,
|
|
||||||
const char *remote, int port,
|
|
||||||
const char *method, const char *url,
|
|
||||||
int fd) {
|
|
||||||
tracepoint(node, http_client_request, req->url, req->method);
|
|
||||||
}
|
|
||||||
|
|
||||||
void NODE_HTTP_CLIENT_RESPONSE(node_lttng_connection_t* conn,
|
|
||||||
const char *remote, int port, int fd) {
|
|
||||||
tracepoint(node, http_client_response, port, conn->remote, fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
void NODE_NET_SERVER_CONNECTION(node_lttng_connection_t* conn,
|
|
||||||
const char *remote, int port, int fd) {
|
|
||||||
tracepoint(node, net_server_connection, conn->remote, port, fd, \
|
|
||||||
conn->buffered);
|
|
||||||
}
|
|
||||||
|
|
||||||
void NODE_NET_STREAM_END(node_lttng_connection_t* conn,
|
|
||||||
const char *remote, int port, int fd) {
|
|
||||||
tracepoint(node, net_stream_end, conn->remote, port, fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
void NODE_GC_START(v8::GCType type,
|
|
||||||
v8::GCCallbackFlags flags,
|
|
||||||
v8::Isolate* isolate) {
|
|
||||||
const char* typeStr = "Unknown GC Type";
|
|
||||||
const char* flagsStr = "Unknown GC Flag";
|
|
||||||
|
|
||||||
#define BUILD_IF(f) if (type == v8::GCType::f) { typeStr = #f; }
|
|
||||||
FOR_ALL_GC_TYPES(BUILD_IF);
|
|
||||||
#undef BUILD_IF
|
|
||||||
|
|
||||||
#define BUILD_IF(f) if (flags == v8::GCCallbackFlags::f) { flagsStr = #f; }
|
|
||||||
FOR_ALL_GC_CALLBACK_FLAGS(BUILD_IF);
|
|
||||||
#undef BUILD_IF
|
|
||||||
|
|
||||||
tracepoint(node, gc_start, typeStr, flagsStr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void NODE_GC_DONE(v8::GCType type,
|
|
||||||
v8::GCCallbackFlags flags,
|
|
||||||
v8::Isolate* isolate) {
|
|
||||||
const char* typeStr = "Unknown GC Type";
|
|
||||||
const char* flagsStr = "Unknown GC Flag";
|
|
||||||
|
|
||||||
#define BUILD_IF(f) if (type == v8::GCType::f) { typeStr = #f; }
|
|
||||||
FOR_ALL_GC_TYPES(BUILD_IF);
|
|
||||||
#undef BUILD_IF
|
|
||||||
|
|
||||||
#define BUILD_IF(f) if (flags == v8::GCCallbackFlags::f) { flagsStr = #f; }
|
|
||||||
FOR_ALL_GC_CALLBACK_FLAGS(BUILD_IF);
|
|
||||||
#undef BUILD_IF
|
|
||||||
|
|
||||||
tracepoint(node, gc_done, typeStr, flagsStr);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool NODE_HTTP_SERVER_REQUEST_ENABLED() { return true; }
|
|
||||||
bool NODE_HTTP_SERVER_RESPONSE_ENABLED() { return true; }
|
|
||||||
bool NODE_HTTP_CLIENT_REQUEST_ENABLED() { return true; }
|
|
||||||
bool NODE_HTTP_CLIENT_RESPONSE_ENABLED() { return true; }
|
|
||||||
bool NODE_NET_SERVER_CONNECTION_ENABLED() { return true; }
|
|
||||||
bool NODE_NET_STREAM_END_ENABLED() { return true; }
|
|
||||||
|
|
||||||
} // namespace node
|
|
||||||
|
|
||||||
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
||||||
|
|
||||||
#endif // SRC_NODE_LTTNG_PROVIDER_H_
|
|
@ -1,116 +0,0 @@
|
|||||||
#ifndef SRC_NODE_LTTNG_TP_H_
|
|
||||||
#define SRC_NODE_LTTNG_TP_H_
|
|
||||||
|
|
||||||
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
||||||
|
|
||||||
#undef TRACEPOINT_PROVIDER
|
|
||||||
#define TRACEPOINT_PROVIDER node
|
|
||||||
|
|
||||||
#undef TRACEPOINT_INCLUDE
|
|
||||||
#define TRACEPOINT_INCLUDE "./node_lttng_tp.h"
|
|
||||||
|
|
||||||
#if !defined(__NODE_LTTNG_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
|
|
||||||
#define __NODE_LTTNG_TP_H
|
|
||||||
|
|
||||||
#include <lttng/tracepoint.h>
|
|
||||||
|
|
||||||
TRACEPOINT_EVENT(
|
|
||||||
node,
|
|
||||||
http_server_request,
|
|
||||||
TP_ARGS(
|
|
||||||
const char*, url,
|
|
||||||
const char*, method,
|
|
||||||
const char*, forwardedFor),
|
|
||||||
TP_FIELDS(
|
|
||||||
ctf_string(url, url)
|
|
||||||
ctf_string(method, method)
|
|
||||||
ctf_string(forwardedFor, forwardedFor))
|
|
||||||
|
|
||||||
TRACEPOINT_EVENT(
|
|
||||||
node,
|
|
||||||
http_server_response,
|
|
||||||
TP_ARGS(
|
|
||||||
int, port,
|
|
||||||
const char*, remote,
|
|
||||||
int, fd),
|
|
||||||
TP_FIELDS(
|
|
||||||
ctf_integer(int, port, port)
|
|
||||||
ctf_string(remote, remote)
|
|
||||||
ctf_integer(int, fd, fd))
|
|
||||||
|
|
||||||
TRACEPOINT_EVENT(
|
|
||||||
node,
|
|
||||||
http_client_request,
|
|
||||||
TP_ARGS(
|
|
||||||
const char*, url,
|
|
||||||
const char*, method),
|
|
||||||
TP_FIELDS(
|
|
||||||
ctf_string(url, url)
|
|
||||||
ctf_string(method, method))
|
|
||||||
|
|
||||||
TRACEPOINT_EVENT(
|
|
||||||
node,
|
|
||||||
http_client_response,
|
|
||||||
TP_ARGS(
|
|
||||||
int, port,
|
|
||||||
const char*, remote,
|
|
||||||
int, fd),
|
|
||||||
TP_FIELDS(
|
|
||||||
ctf_integer(int, port, port)
|
|
||||||
ctf_string(remote, remote)
|
|
||||||
ctf_integer(int, fd, fd))
|
|
||||||
|
|
||||||
TRACEPOINT_EVENT(
|
|
||||||
node,
|
|
||||||
net_server_connection,
|
|
||||||
TP_ARGS(
|
|
||||||
const char*, remote,
|
|
||||||
int, port,
|
|
||||||
int, fd,
|
|
||||||
int, buffered),
|
|
||||||
TP_FIELDS(
|
|
||||||
ctf_string(remote, remote)
|
|
||||||
ctf_integer(int, port, port)
|
|
||||||
ctf_integer(int, fd, fd)
|
|
||||||
ctf_integer(int, buffered, buffered))
|
|
||||||
|
|
||||||
TRACEPOINT_EVENT(
|
|
||||||
node,
|
|
||||||
net_stream_end,
|
|
||||||
TP_ARGS(
|
|
||||||
const char*, remote,
|
|
||||||
int, port,
|
|
||||||
int, fd),
|
|
||||||
TP_FIELDS(
|
|
||||||
ctf_string(remote, remote)
|
|
||||||
ctf_integer(int, port, port)
|
|
||||||
ctf_integer(int, fd, fd))
|
|
||||||
|
|
||||||
TRACEPOINT_EVENT(
|
|
||||||
node,
|
|
||||||
gc_start,
|
|
||||||
TP_ARGS(
|
|
||||||
const char*, gctype,
|
|
||||||
const char*, gcflags),
|
|
||||||
TP_FIELDS(
|
|
||||||
ctf_string(gctype, gctype)
|
|
||||||
ctf_string(gcflags, gcflags))
|
|
||||||
)
|
|
||||||
|
|
||||||
TRACEPOINT_EVENT(
|
|
||||||
node,
|
|
||||||
gc_done,
|
|
||||||
TP_ARGS(
|
|
||||||
const char*, gctype,
|
|
||||||
const char*, gcflags),
|
|
||||||
TP_FIELDS(
|
|
||||||
ctf_string(gctype, gctype)
|
|
||||||
ctf_string(gcflags, gcflags))
|
|
||||||
|
|
||||||
#endif /* __NODE_LTTNG_TP_H */
|
|
||||||
|
|
||||||
#include <lttng/tracepoint-event.h>
|
|
||||||
|
|
||||||
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
||||||
|
|
||||||
#endif // SRC_NODE_LTTNG_TP_H_
|
|
@ -1,9 +0,0 @@
|
|||||||
# This file is used by tools/js2c.py to preprocess out the LTTNG symbols in
|
|
||||||
# builds that don't support LTTNG. This is not used in builds that support
|
|
||||||
# LTTNG.
|
|
||||||
macro LTTNG_HTTP_CLIENT_REQUEST(x) = ;
|
|
||||||
macro LTTNG_HTTP_CLIENT_RESPONSE(x) = ;
|
|
||||||
macro LTTNG_HTTP_SERVER_REQUEST(x) = ;
|
|
||||||
macro LTTNG_HTTP_SERVER_RESPONSE(x) = ;
|
|
||||||
macro LTTNG_NET_SERVER_CONNECTION(x) = ;
|
|
||||||
macro LTTNG_NET_STREAM_END(x) = ;
|
|
@ -334,15 +334,6 @@ if (global.COUNTER_NET_SERVER_CONNECTION) {
|
|||||||
knownGlobals.push(COUNTER_HTTP_CLIENT_RESPONSE);
|
knownGlobals.push(COUNTER_HTTP_CLIENT_RESPONSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global.LTTNG_HTTP_SERVER_RESPONSE) {
|
|
||||||
knownGlobals.push(LTTNG_HTTP_SERVER_RESPONSE);
|
|
||||||
knownGlobals.push(LTTNG_HTTP_SERVER_REQUEST);
|
|
||||||
knownGlobals.push(LTTNG_HTTP_CLIENT_RESPONSE);
|
|
||||||
knownGlobals.push(LTTNG_HTTP_CLIENT_REQUEST);
|
|
||||||
knownGlobals.push(LTTNG_NET_STREAM_END);
|
|
||||||
knownGlobals.push(LTTNG_NET_SERVER_CONNECTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (global.ArrayBuffer) {
|
if (global.ArrayBuffer) {
|
||||||
knownGlobals.push(ArrayBuffer);
|
knownGlobals.push(ArrayBuffer);
|
||||||
knownGlobals.push(Int8Array);
|
knownGlobals.push(Int8Array);
|
||||||
|
@ -50,15 +50,6 @@ export function leakedGlobals() {
|
|||||||
knownGlobals.push(COUNTER_HTTP_CLIENT_RESPONSE);
|
knownGlobals.push(COUNTER_HTTP_CLIENT_RESPONSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global.LTTNG_HTTP_SERVER_RESPONSE) {
|
|
||||||
knownGlobals.push(LTTNG_HTTP_SERVER_RESPONSE);
|
|
||||||
knownGlobals.push(LTTNG_HTTP_SERVER_REQUEST);
|
|
||||||
knownGlobals.push(LTTNG_HTTP_CLIENT_RESPONSE);
|
|
||||||
knownGlobals.push(LTTNG_HTTP_CLIENT_REQUEST);
|
|
||||||
knownGlobals.push(LTTNG_NET_STREAM_END);
|
|
||||||
knownGlobals.push(LTTNG_NET_SERVER_CONNECTION);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (global.ArrayBuffer) {
|
if (global.ArrayBuffer) {
|
||||||
knownGlobals.push(ArrayBuffer);
|
knownGlobals.push(ArrayBuffer);
|
||||||
knownGlobals.push(Int8Array);
|
knownGlobals.push(Int8Array);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user