summaryrefslogtreecommitdiff
path: root/src/node_dtrace.cc
diff options
context:
space:
mode:
authorTimothy J Fontaine <tjfontaine@gmail.com>2013-03-28 16:51:52 -0700
committerBen Noordhuis <info@bnoordhuis.nl>2013-03-30 01:30:16 +0100
commitaa5da48594c1634de9f439bcf223acff3fb1fcd8 (patch)
tree74d3c611c1cc014ca7307b660c87a97058309217 /src/node_dtrace.cc
parent7634069614ea38e38458e4c3a3c3e17d8bc4137e (diff)
downloadnode-new-aa5da48594c1634de9f439bcf223acff3fb1fcd8.tar.gz
dtrace: actually use the _handle.fd value
When using the DTrace/systemtap subsystems it would be helpful to actually have an fd associated with the requests and responses.
Diffstat (limited to 'src/node_dtrace.cc')
-rw-r--r--src/node_dtrace.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/node_dtrace.cc b/src/node_dtrace.cc
index 3e531644dc..49ebf07cf8 100644
--- a/src/node_dtrace.cc
+++ b/src/node_dtrace.cc
@@ -91,7 +91,8 @@ using namespace v8;
} \
node_dtrace_connection_t conn; \
Local<Object> _##conn = Local<Object>::Cast(arg); \
- SLURP_INT(_##conn, fd, &conn.fd); \
+ Local<Object> _handle = (_##conn)->Get(String::New("_handle"))->ToObject(); \
+ SLURP_INT(_handle, fd, &conn.fd); \
SLURP_STRING(_##conn, remoteAddress, &conn.remote); \
SLURP_INT(_##conn, remotePort, &conn.port); \
SLURP_INT(_##conn, bufferSize, &conn.buffered);
@@ -139,7 +140,7 @@ Handle<Value> DTRACE_NET_SERVER_CONNECTION(const Arguments& args) {
NODE_NET_SERVER_CONNECTION(conn.fd, conn.remote, conn.port, \
conn.buffered);
#else
- NODE_NET_SERVER_CONNECTION(&conn, conn.remote, conn.port);
+ NODE_NET_SERVER_CONNECTION(&conn, conn.remote, conn.port, conn.fd);
#endif
return Undefined(node_isolate);
@@ -157,7 +158,7 @@ Handle<Value> DTRACE_NET_STREAM_END(const Arguments& args) {
#ifdef HAVE_SYSTEMTAP
NODE_NET_STREAM_END(conn.fd, conn.remote, conn.port, conn.buffered);
#else
- NODE_NET_STREAM_END(&conn, conn.remote, conn.port);
+ NODE_NET_STREAM_END(&conn, conn.remote, conn.port, conn.fd);
#endif
return Undefined(node_isolate);
@@ -181,7 +182,7 @@ Handle<Value> DTRACE_NET_SOCKET_READ(const Arguments& args) {
"argument 1 to be number of bytes"))));
}
int nbytes = args[1]->Int32Value();
- NODE_NET_SOCKET_READ(&conn, nbytes, conn.remote, conn.port);
+ NODE_NET_SOCKET_READ(&conn, nbytes, conn.remote, conn.port, conn.fd);
#endif
return Undefined(node_isolate);
@@ -205,7 +206,7 @@ Handle<Value> DTRACE_NET_SOCKET_WRITE(const Arguments& args) {
"argument 1 to be number of bytes"))));
}
int nbytes = args[1]->Int32Value();
- NODE_NET_SOCKET_WRITE(&conn, nbytes, conn.remote, conn.port);
+ NODE_NET_SOCKET_WRITE(&conn, nbytes, conn.remote, conn.port, conn.fd);
#endif
return Undefined(node_isolate);
@@ -248,7 +249,7 @@ Handle<Value> DTRACE_HTTP_SERVER_REQUEST(const Arguments& args) {
conn.buffered);
#else
NODE_HTTP_SERVER_REQUEST(&req, &conn, conn.remote, conn.port, req.method, \
- req.url);
+ req.url, conn.fd);
#endif
return Undefined(node_isolate);
}
@@ -265,7 +266,7 @@ Handle<Value> DTRACE_HTTP_SERVER_RESPONSE(const Arguments& args) {
#ifdef HAVE_SYSTEMTAP
NODE_HTTP_SERVER_RESPONSE(conn.fd, conn.remote, conn.port, conn.buffered);
#else
- NODE_HTTP_SERVER_RESPONSE(&conn, conn.remote, conn.port);
+ NODE_HTTP_SERVER_RESPONSE(&conn, conn.remote, conn.port, conn.fd);
#endif
return Undefined(node_isolate);
@@ -312,7 +313,7 @@ Handle<Value> DTRACE_HTTP_CLIENT_REQUEST(const Arguments& args) {
conn.buffered);
#else
NODE_HTTP_CLIENT_REQUEST(&req, &conn, conn.remote, conn.port, req.method, \
- req.url);
+ req.url, conn.fd);
#endif
return Undefined(node_isolate);
}
@@ -328,7 +329,7 @@ Handle<Value> DTRACE_HTTP_CLIENT_RESPONSE(const Arguments& args) {
#ifdef HAVE_SYSTEMTAP
NODE_HTTP_CLIENT_RESPONSE(conn.fd, conn.remote, conn.port, conn.buffered);
#else
- NODE_HTTP_CLIENT_RESPONSE(&conn, conn.remote, conn.port);
+ NODE_HTTP_CLIENT_RESPONSE(&conn, conn.remote, conn.port, conn.fd);
#endif
return Undefined(node_isolate);