Browse Source

src: remove unused dtrace probes

Removed DTRACE_NET_SOCKET_READ and DTRACE_NET_SOCKET_WRITE
as they were never called from within the source code.

PR-URL: https://github.com/iojs/io.js/pull/694
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
v1.8.0-commit
Glen Keane 10 years ago
committed by Ben Noordhuis
parent
commit
d75fecf6fd
  1. 30
      src/node.stp
  2. 37
      src/node_dtrace.cc
  3. 6
      src/node_provider.d
  4. 5
      src/node_win32_etw_provider.h
  5. 2
      src/notrace_macros.py
  6. 2
      test/common.js

30
src/node.stp

@ -24,36 +24,6 @@ probe node_net_stream_end = process("node").mark("net__stream__end")
fd); fd);
} }
probe node_net_socket_write = process("node").mark("net__socket__write")
{
bytes = $arg2;
remote = user_string($arg3);
port = $arg4;
fd = $arg5;
probestr = sprintf("%s(bytes=%d, remote=%s, port=%d, fd=%d)",
$$name,
bytes,
remote,
port,
fd);
}
probe node_net_socket_read = process("node").mark("net__socket__read")
{
bytes = $arg2;
remote = user_string($arg3);
port = $arg4;
fd = $arg5;
probestr = sprintf("%s(bytes=%d, remote=%s, port=%d, fd=%d)",
$$name,
bytes,
remote,
port,
fd);
}
probe node_http_server_request = process("node").mark("http__server__request") probe node_http_server_request = process("node").mark("http__server__request")
{ {
remote = user_string($arg3); remote = user_string($arg3);

37
src/node_dtrace.cc

@ -22,10 +22,6 @@
#define NODE_NET_SERVER_CONNECTION_ENABLED() (0) #define NODE_NET_SERVER_CONNECTION_ENABLED() (0)
#define NODE_NET_STREAM_END(arg0) #define NODE_NET_STREAM_END(arg0)
#define NODE_NET_STREAM_END_ENABLED() (0) #define NODE_NET_STREAM_END_ENABLED() (0)
#define NODE_NET_SOCKET_READ(arg0, arg1, arg2, arg3, arg4)
#define NODE_NET_SOCKET_READ_ENABLED() (0)
#define NODE_NET_SOCKET_WRITE(arg0, arg1, arg2, arg3, arg4)
#define NODE_NET_SOCKET_WRITE_ENABLED() (0)
#define NODE_GC_START(arg0, arg1, arg2) #define NODE_GC_START(arg0, arg1, arg2)
#define NODE_GC_DONE(arg0, arg1, arg2) #define NODE_GC_DONE(arg0, arg1, arg2)
#endif #endif
@ -139,37 +135,6 @@ void DTRACE_NET_STREAM_END(const FunctionCallbackInfo<Value>& args) {
NODE_NET_STREAM_END(&conn, conn.remote, conn.port, conn.fd); NODE_NET_STREAM_END(&conn, conn.remote, conn.port, conn.fd);
} }
void DTRACE_NET_SOCKET_READ(const FunctionCallbackInfo<Value>& args) {
if (!NODE_NET_SOCKET_READ_ENABLED())
return;
Environment* env = Environment::GetCurrent(args);
SLURP_CONNECTION(args[0], conn);
if (!args[1]->IsNumber()) {
return env->ThrowError("expected argument 1 to be number of bytes");
}
int nbytes = args[1]->Int32Value();
NODE_NET_SOCKET_READ(&conn, nbytes, conn.remote, conn.port, conn.fd);
}
void DTRACE_NET_SOCKET_WRITE(const FunctionCallbackInfo<Value>& args) {
if (!NODE_NET_SOCKET_WRITE_ENABLED())
return;
Environment* env = Environment::GetCurrent(args);
SLURP_CONNECTION(args[0], conn);
if (!args[1]->IsNumber()) {
return env->ThrowError("expected argument 1 to be number of bytes");
}
int nbytes = args[1]->Int32Value();
NODE_NET_SOCKET_WRITE(&conn, nbytes, conn.remote, conn.port, conn.fd);
}
void DTRACE_HTTP_SERVER_REQUEST(const FunctionCallbackInfo<Value>& args) { void DTRACE_HTTP_SERVER_REQUEST(const FunctionCallbackInfo<Value>& args) {
node_dtrace_http_server_request_t req; node_dtrace_http_server_request_t req;
@ -286,8 +251,6 @@ void InitDTrace(Environment* env, Handle<Object> target) {
#define NODE_PROBE(name) #name, name #define NODE_PROBE(name) #name, name
{ NODE_PROBE(DTRACE_NET_SERVER_CONNECTION) }, { NODE_PROBE(DTRACE_NET_SERVER_CONNECTION) },
{ NODE_PROBE(DTRACE_NET_STREAM_END) }, { NODE_PROBE(DTRACE_NET_STREAM_END) },
{ NODE_PROBE(DTRACE_NET_SOCKET_READ) },
{ NODE_PROBE(DTRACE_NET_SOCKET_WRITE) },
{ NODE_PROBE(DTRACE_HTTP_SERVER_REQUEST) }, { NODE_PROBE(DTRACE_HTTP_SERVER_REQUEST) },
{ NODE_PROBE(DTRACE_HTTP_SERVER_RESPONSE) }, { NODE_PROBE(DTRACE_HTTP_SERVER_RESPONSE) },
{ NODE_PROBE(DTRACE_HTTP_CLIENT_REQUEST) }, { NODE_PROBE(DTRACE_HTTP_CLIENT_REQUEST) },

6
src/node_provider.d

@ -57,12 +57,6 @@ provider node {
int fd); int fd);
probe net__stream__end(node_dtrace_connection_t *c, const char *a, 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); int p, int fd) : (node_connection_t *c, string a, int p, int fd);
probe net__socket__read(node_dtrace_connection_t *c, int b,
const char *a, int p, int fd) : (node_connection_t *c, int b, string a,
int p, int fd);
probe net__socket__write(node_dtrace_connection_t *c, int b,
const char *a, int p, int fd) : (node_connection_t *c, int b, string a,
int p, int fd);
probe http__server__request(node_dtrace_http_server_request_t *h, probe http__server__request(node_dtrace_http_server_request_t *h,
node_dtrace_connection_t *c, const char *a, int p, const char *m, 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, const char *u, int fd) : (node_http_request_t *h, node_connection_t *c,

5
src/node_win32_etw_provider.h

@ -67,13 +67,8 @@ INLINE bool NODE_HTTP_CLIENT_REQUEST_ENABLED();
INLINE bool NODE_HTTP_CLIENT_RESPONSE_ENABLED(); INLINE bool NODE_HTTP_CLIENT_RESPONSE_ENABLED();
INLINE bool NODE_NET_SERVER_CONNECTION_ENABLED(); INLINE bool NODE_NET_SERVER_CONNECTION_ENABLED();
INLINE bool NODE_NET_STREAM_END_ENABLED(); INLINE bool NODE_NET_STREAM_END_ENABLED();
INLINE bool NODE_NET_SOCKET_READ_ENABLED();
INLINE bool NODE_NET_SOCKET_WRITE_ENABLED();
INLINE bool NODE_V8SYMBOL_ENABLED(); INLINE bool NODE_V8SYMBOL_ENABLED();
#define NODE_NET_SOCKET_READ(...) /* no-op */
#define NODE_NET_SOCKET_WRITE(...) /* no-op */
} // namespace node } // namespace node
#endif // SRC_NODE_WIN32_ETW_PROVIDER_H_ #endif // SRC_NODE_WIN32_ETW_PROVIDER_H_

2
src/notrace_macros.py

@ -7,5 +7,3 @@ macro DTRACE_HTTP_SERVER_REQUEST(x) = ;
macro DTRACE_HTTP_SERVER_RESPONSE(x) = ; macro DTRACE_HTTP_SERVER_RESPONSE(x) = ;
macro DTRACE_NET_SERVER_CONNECTION(x) = ; macro DTRACE_NET_SERVER_CONNECTION(x) = ;
macro DTRACE_NET_STREAM_END(x) = ; macro DTRACE_NET_STREAM_END(x) = ;
macro DTRACE_NET_SOCKET_READ(x) = ;
macro DTRACE_NET_SOCKET_WRITE(x) = ;

2
test/common.js

@ -141,8 +141,6 @@ if (global.DTRACE_HTTP_SERVER_RESPONSE) {
knownGlobals.push(DTRACE_HTTP_CLIENT_REQUEST); knownGlobals.push(DTRACE_HTTP_CLIENT_REQUEST);
knownGlobals.push(DTRACE_NET_STREAM_END); knownGlobals.push(DTRACE_NET_STREAM_END);
knownGlobals.push(DTRACE_NET_SERVER_CONNECTION); knownGlobals.push(DTRACE_NET_SERVER_CONNECTION);
knownGlobals.push(DTRACE_NET_SOCKET_READ);
knownGlobals.push(DTRACE_NET_SOCKET_WRITE);
} }
if (global.COUNTER_NET_SERVER_CONNECTION) { if (global.COUNTER_NET_SERVER_CONNECTION) {

Loading…
Cancel
Save