Skip to content

Commit d75fecf

Browse files
GlenTikibnoordhuis
authored andcommitted
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: #694 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 8c0742f commit d75fecf

File tree

6 files changed

+0
-82
lines changed

6 files changed

+0
-82
lines changed

src/node.stp

-30
Original file line numberDiff line numberDiff line change
@@ -24,36 +24,6 @@ probe node_net_stream_end = process("node").mark("net__stream__end")
2424
fd);
2525
}
2626

27-
probe node_net_socket_write = process("node").mark("net__socket__write")
28-
{
29-
bytes = $arg2;
30-
remote = user_string($arg3);
31-
port = $arg4;
32-
fd = $arg5;
33-
34-
probestr = sprintf("%s(bytes=%d, remote=%s, port=%d, fd=%d)",
35-
$$name,
36-
bytes,
37-
remote,
38-
port,
39-
fd);
40-
}
41-
42-
probe node_net_socket_read = process("node").mark("net__socket__read")
43-
{
44-
bytes = $arg2;
45-
remote = user_string($arg3);
46-
port = $arg4;
47-
fd = $arg5;
48-
49-
probestr = sprintf("%s(bytes=%d, remote=%s, port=%d, fd=%d)",
50-
$$name,
51-
bytes,
52-
remote,
53-
port,
54-
fd);
55-
}
56-
5727
probe node_http_server_request = process("node").mark("http__server__request")
5828
{
5929
remote = user_string($arg3);

src/node_dtrace.cc

-37
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
#define NODE_NET_SERVER_CONNECTION_ENABLED() (0)
2323
#define NODE_NET_STREAM_END(arg0)
2424
#define NODE_NET_STREAM_END_ENABLED() (0)
25-
#define NODE_NET_SOCKET_READ(arg0, arg1, arg2, arg3, arg4)
26-
#define NODE_NET_SOCKET_READ_ENABLED() (0)
27-
#define NODE_NET_SOCKET_WRITE(arg0, arg1, arg2, arg3, arg4)
28-
#define NODE_NET_SOCKET_WRITE_ENABLED() (0)
2925
#define NODE_GC_START(arg0, arg1, arg2)
3026
#define NODE_GC_DONE(arg0, arg1, arg2)
3127
#endif
@@ -139,37 +135,6 @@ void DTRACE_NET_STREAM_END(const FunctionCallbackInfo<Value>& args) {
139135
NODE_NET_STREAM_END(&conn, conn.remote, conn.port, conn.fd);
140136
}
141137

142-
143-
void DTRACE_NET_SOCKET_READ(const FunctionCallbackInfo<Value>& args) {
144-
if (!NODE_NET_SOCKET_READ_ENABLED())
145-
return;
146-
Environment* env = Environment::GetCurrent(args);
147-
SLURP_CONNECTION(args[0], conn);
148-
149-
if (!args[1]->IsNumber()) {
150-
return env->ThrowError("expected argument 1 to be number of bytes");
151-
}
152-
153-
int nbytes = args[1]->Int32Value();
154-
NODE_NET_SOCKET_READ(&conn, nbytes, conn.remote, conn.port, conn.fd);
155-
}
156-
157-
158-
void DTRACE_NET_SOCKET_WRITE(const FunctionCallbackInfo<Value>& args) {
159-
if (!NODE_NET_SOCKET_WRITE_ENABLED())
160-
return;
161-
Environment* env = Environment::GetCurrent(args);
162-
SLURP_CONNECTION(args[0], conn);
163-
164-
if (!args[1]->IsNumber()) {
165-
return env->ThrowError("expected argument 1 to be number of bytes");
166-
}
167-
168-
int nbytes = args[1]->Int32Value();
169-
NODE_NET_SOCKET_WRITE(&conn, nbytes, conn.remote, conn.port, conn.fd);
170-
}
171-
172-
173138
void DTRACE_HTTP_SERVER_REQUEST(const FunctionCallbackInfo<Value>& args) {
174139
node_dtrace_http_server_request_t req;
175140

@@ -286,8 +251,6 @@ void InitDTrace(Environment* env, Handle<Object> target) {
286251
#define NODE_PROBE(name) #name, name
287252
{ NODE_PROBE(DTRACE_NET_SERVER_CONNECTION) },
288253
{ NODE_PROBE(DTRACE_NET_STREAM_END) },
289-
{ NODE_PROBE(DTRACE_NET_SOCKET_READ) },
290-
{ NODE_PROBE(DTRACE_NET_SOCKET_WRITE) },
291254
{ NODE_PROBE(DTRACE_HTTP_SERVER_REQUEST) },
292255
{ NODE_PROBE(DTRACE_HTTP_SERVER_RESPONSE) },
293256
{ NODE_PROBE(DTRACE_HTTP_CLIENT_REQUEST) },

src/node_provider.d

-6
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@ provider node {
5757
int fd);
5858
probe net__stream__end(node_dtrace_connection_t *c, const char *a,
5959
int p, int fd) : (node_connection_t *c, string a, int p, int fd);
60-
probe net__socket__read(node_dtrace_connection_t *c, int b,
61-
const char *a, int p, int fd) : (node_connection_t *c, int b, string a,
62-
int p, int fd);
63-
probe net__socket__write(node_dtrace_connection_t *c, int b,
64-
const char *a, int p, int fd) : (node_connection_t *c, int b, string a,
65-
int p, int fd);
6660
probe http__server__request(node_dtrace_http_server_request_t *h,
6761
node_dtrace_connection_t *c, const char *a, int p, const char *m,
6862
const char *u, int fd) : (node_http_request_t *h, node_connection_t *c,

src/node_win32_etw_provider.h

-5
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,8 @@ INLINE bool NODE_HTTP_CLIENT_REQUEST_ENABLED();
6767
INLINE bool NODE_HTTP_CLIENT_RESPONSE_ENABLED();
6868
INLINE bool NODE_NET_SERVER_CONNECTION_ENABLED();
6969
INLINE bool NODE_NET_STREAM_END_ENABLED();
70-
INLINE bool NODE_NET_SOCKET_READ_ENABLED();
71-
INLINE bool NODE_NET_SOCKET_WRITE_ENABLED();
7270
INLINE bool NODE_V8SYMBOL_ENABLED();
7371

74-
#define NODE_NET_SOCKET_READ(...) /* no-op */
75-
#define NODE_NET_SOCKET_WRITE(...) /* no-op */
76-
7772
} // namespace node
7873

7974
#endif // SRC_NODE_WIN32_ETW_PROVIDER_H_

src/notrace_macros.py

-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@
77
macro DTRACE_HTTP_SERVER_RESPONSE(x) = ;
88
macro DTRACE_NET_SERVER_CONNECTION(x) = ;
99
macro DTRACE_NET_STREAM_END(x) = ;
10-
macro DTRACE_NET_SOCKET_READ(x) = ;
11-
macro DTRACE_NET_SOCKET_WRITE(x) = ;

test/common.js

-2
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ if (global.DTRACE_HTTP_SERVER_RESPONSE) {
141141
knownGlobals.push(DTRACE_HTTP_CLIENT_REQUEST);
142142
knownGlobals.push(DTRACE_NET_STREAM_END);
143143
knownGlobals.push(DTRACE_NET_SERVER_CONNECTION);
144-
knownGlobals.push(DTRACE_NET_SOCKET_READ);
145-
knownGlobals.push(DTRACE_NET_SOCKET_WRITE);
146144
}
147145

148146
if (global.COUNTER_NET_SERVER_CONNECTION) {

0 commit comments

Comments
 (0)