3434#include < node.h>
3535#include < v8.h>
3636#include < sys/sdt.h>
37- #include " node_systemtap .h"
37+ #include " node_provider .h"
3838#include " node_dtrace.h"
3939#else
4040#define NODE_HTTP_SERVER_REQUEST (arg0, arg1 )
@@ -140,12 +140,8 @@ Handle<Value> DTRACE_NET_SERVER_CONNECTION(const Arguments& args) {
140140 HandleScope scope (node_isolate);
141141
142142 SLURP_CONNECTION (args[0 ], conn);
143- #ifdef HAVE_SYSTEMTAP
144- NODE_NET_SERVER_CONNECTION (conn.fd , conn.remote , conn.port , \
145- conn.buffered );
146- #else
143+
147144 NODE_NET_SERVER_CONNECTION (&conn, conn.remote , conn.port , conn.fd );
148- #endif
149145
150146 return Undefined (node_isolate);
151147}
@@ -159,11 +155,8 @@ Handle<Value> DTRACE_NET_STREAM_END(const Arguments& args) {
159155 HandleScope scope (node_isolate);
160156
161157 SLURP_CONNECTION (args[0 ], conn);
162- #ifdef HAVE_SYSTEMTAP
163- NODE_NET_STREAM_END (conn.fd , conn.remote , conn.port , conn.buffered );
164- #else
158+
165159 NODE_NET_STREAM_END (&conn, conn.remote , conn.port , conn.fd );
166- #endif
167160
168161 return Undefined (node_isolate);
169162}
@@ -178,16 +171,12 @@ Handle<Value> DTRACE_NET_SOCKET_READ(const Arguments& args) {
178171
179172 SLURP_CONNECTION (args[0 ], conn);
180173
181- #ifdef HAVE_SYSTEMTAP
182- NODE_NET_SOCKET_READ (conn.fd , conn.remote , conn.port , conn.buffered );
183- #else
184174 if (!args[1 ]->IsNumber ()) {
185175 return (ThrowException (Exception::Error (String::New (" expected "
186176 " argument 1 to be number of bytes" ))));
187177 }
188178 int nbytes = args[1 ]->Int32Value ();
189179 NODE_NET_SOCKET_READ (&conn, nbytes, conn.remote , conn.port , conn.fd );
190- #endif
191180
192181 return Undefined (node_isolate);
193182}
@@ -202,16 +191,12 @@ Handle<Value> DTRACE_NET_SOCKET_WRITE(const Arguments& args) {
202191
203192 SLURP_CONNECTION (args[0 ], conn);
204193
205- #ifdef HAVE_SYSTEMTAP
206- NODE_NET_SOCKET_WRITE (conn.fd , conn.remote , conn.port , conn.buffered );
207- #else
208194 if (!args[1 ]->IsNumber ()) {
209195 return (ThrowException (Exception::Error (String::New (" expected "
210196 " argument 1 to be number of bytes" ))));
211197 }
212198 int nbytes = args[1 ]->Int32Value ();
213199 NODE_NET_SOCKET_WRITE (&conn, nbytes, conn.remote , conn.port , conn.fd );
214- #endif
215200
216201 return Undefined (node_isolate);
217202}
@@ -248,13 +233,9 @@ Handle<Value> DTRACE_HTTP_SERVER_REQUEST(const Arguments& args) {
248233
249234 SLURP_CONNECTION (args[1 ], conn);
250235
251- #ifdef HAVE_SYSTEMTAP
252- NODE_HTTP_SERVER_REQUEST (&req, conn.fd , conn.remote , conn.port , \
253- conn.buffered );
254- #else
255236 NODE_HTTP_SERVER_REQUEST (&req, &conn, conn.remote , conn.port , req.method , \
256237 req.url , conn.fd );
257- # endif
238+
258239 return Undefined (node_isolate);
259240}
260241
@@ -267,11 +248,8 @@ Handle<Value> DTRACE_HTTP_SERVER_RESPONSE(const Arguments& args) {
267248 HandleScope scope (node_isolate);
268249
269250 SLURP_CONNECTION (args[0 ], conn);
270- #ifdef HAVE_SYSTEMTAP
271- NODE_HTTP_SERVER_RESPONSE (conn.fd , conn.remote , conn.port , conn.buffered );
272- #else
251+
273252 NODE_HTTP_SERVER_RESPONSE (&conn, conn.remote , conn.port , conn.fd );
274- #endif
275253
276254 return Undefined (node_isolate);
277255}
@@ -312,13 +290,10 @@ Handle<Value> DTRACE_HTTP_CLIENT_REQUEST(const Arguments& args) {
312290 *header = ' \0 ' ;
313291
314292 SLURP_CONNECTION_HTTP_CLIENT (args[1 ], conn);
315- #ifdef HAVE_SYSTEMTAP
316- NODE_HTTP_CLIENT_REQUEST (&req, conn.fd , conn.remote , conn.port , \
317- conn.buffered );
318- #else
293+
319294 NODE_HTTP_CLIENT_REQUEST (&req, &conn, conn.remote , conn.port , req.method , \
320295 req.url , conn.fd );
321- # endif
296+
322297 return Undefined (node_isolate);
323298}
324299
@@ -330,23 +305,16 @@ Handle<Value> DTRACE_HTTP_CLIENT_RESPONSE(const Arguments& args) {
330305 HandleScope scope (node_isolate);
331306
332307 SLURP_CONNECTION_HTTP_CLIENT_RESPONSE (args[0 ], args[1 ], conn);
333- #ifdef HAVE_SYSTEMTAP
334- NODE_HTTP_CLIENT_RESPONSE (conn.fd , conn.remote , conn.port , conn.buffered );
335- #else
308+
336309 NODE_HTTP_CLIENT_RESPONSE (&conn, conn.remote , conn.port , conn.fd );
337- #endif
338310
339311 return Undefined (node_isolate);
340312}
341313
342314#define NODE_PROBE (name ) #name, name, Persistent<FunctionTemplate>()
343315
344316static int dtrace_gc_start (GCType type, GCCallbackFlags flags) {
345- #ifdef HAVE_SYSTEMTAP
346- NODE_GC_START ();
347- #else
348317 NODE_GC_START (type, flags);
349- #endif
350318 /*
351319 * We avoid the tail-call elimination of the USDT probe (which screws up
352320 * args) by forcing a return of 0.
@@ -355,11 +323,7 @@ static int dtrace_gc_start(GCType type, GCCallbackFlags flags) {
355323}
356324
357325static int dtrace_gc_done (GCType type, GCCallbackFlags flags) {
358- #ifdef HAVE_SYSTEMTAP
359- NODE_GC_DONE ();
360- #else
361326 NODE_GC_DONE (type, flags);
362- #endif
363327 return 0 ;
364328}
365329
0 commit comments