From: mmason Date: Tue, 24 Apr 2007 20:12:29 +0000 (+0000) Subject: Adapt socket tapset to changes in 2.6.19. X-Git-Tag: release-0.5.14~126 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=eb4cafc4c2e58edece1657dd1a6d25040acb3aed;p=systemtap.git Adapt socket tapset to changes in 2.6.19. --- diff --git a/ChangeLog b/ChangeLog index 54744ecf6..f47574131 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-04-24 Mike Mason + + * man/stapprobes.socket.5.in: Removed do_write and do_read probes, + added aio_write, aio_read, writev and readv probes. + 2007-04-24 David Smith * tapsets.cxx (common_probe_entryfn_epilogue): Increment diff --git a/man/stapprobes.socket.5.in b/man/stapprobes.socket.5.in index 3fa1ae52b..6c939fd20 100644 --- a/man/stapprobes.socket.5.in +++ b/man/stapprobes.socket.5.in @@ -27,10 +27,11 @@ It contains the following probe points: Fires at the conclusion of sending a message on a socket. This probe alias includes the -.B socket.sendmsg.return +.B socket.sendmsg.return, +.B socket.aio_write.return and -.B socket.do_write.return -probes (these two probes should +.B socket.writev.return +probes (these probes should catch all messages sent on sockets). The arguments supplied at the beginning of the send are cached and made available in this probe. @@ -127,28 +128,6 @@ The message sender. 6 - DCCP (datagram congestion control protocol socket) 10 - PACKET (Linux-specific way of getting packets at device level) -.I mflags - Message type bitmap. Use msg_flags_num2str(flags) to convert - to a string. - - Possible bit settings are: - 0x01 - OOB - 0x02 - PEEK - 0x04 - DONTROUTE - 0x08 - CTRUNC - 0x10 - PROBE (Do not send. Only probe path f.e. for MTU) - 0x20 - TRUNC - 0x40 - DONTWAIT (Nonblocking IO) - 0x80 - EOR (End of record) - 0x100 - WAITALL (Wait for a full request) - 0x200 - FIN - 0x400 - SYN - 0x800 - CONFIRM (Confirm path validity) - 0x1000 - RST - 0x2000 - ERRQUEUE (Fetch message from error queue) - 0x4000 - NOSIGNAL (Do not generate SIGPIPE) - 0x8000 - MORE (Sender will send more) - .I success Was send successful? @@ -161,10 +140,11 @@ The message sender. Fires at the conclusion of receiving a message on a socket. This probe alias includes the -.B socket.recvmsg.return +.B socket.recvmsg.return, +.B socket.aio_read.return and -.B socket.do_read.return -probes (these two probes should +.B socket.readv.return +probes (these probes should catch all messages received on sockets). The arguments supplied at the beginning of the receive are cached and made available in this probe. @@ -251,10 +231,89 @@ The message receiver. Same as .B socket.receive. + + + + + +.TP +.B socket.aio_write + +Fires when the sock_aio_write() kernel function is entered. + +.B Context: + +The message sender. + +.B Arguments: + +Same as +.B socket.send, +with the following exceptions: + +.I size + + Size of message being sent (in bytes). + +.I success + + Not used. + +.TP +.B socket.aio_write.return + +Fires when the sock_aio_write() kernel function returns. + +.B Context: + +The message sender. + +.B Arguments: + +Same as +.B socket.send. + +.TP +.B socket.aio_read + +Fires when the sock_aio_read() kernel function is entered. + +.B Context: + +The message receiver. + +.B Arguments: + +Same as +.B socket.receive, +with the following exceptions: + +.I size + + Size of message being received (in bytes). + +.I success + + Not used. + +.TP +.B socket.aio_read.return + +Fires when the sock_aio_read() kernel function returns. + +.B Context: + +The message receiver. + +.B Arguments: + +Same as +.B socket.receive. + .TP -.B socket.do_write +.B socket.writev -Fires when the do_sock_write() kernel function is entered. +Fires when the sock_writev() kernel function is entered. .B Context: @@ -275,9 +334,9 @@ with the following exceptions: Not used. .TP -.B socket.do_write.return +.B socket.writev.return -Fires when the do_sock_write() kernel function returns. +Fires when the sock_writev() kernel function returns. .B Context: @@ -289,9 +348,9 @@ Same as .B socket.send. .TP -.B socket.do_read +.B socket.readv -Fires when the do_sock_read() kernel function is entered. +Fires when the sock_readv() kernel function is entered. .B Context: @@ -312,9 +371,9 @@ with the following exceptions: Not used. .TP -.B socket.do_read.return +.B socket.readv.return -Fires when the do_sock_read() kernel function returns. +Fires when the sock_readv() kernel function returns. .B Context: @@ -423,4 +482,4 @@ The socket closer. .SH SEE ALSO .IR stap (1), .IR stapprobes (5), -.IR stapfuncs (5) \ No newline at end of file +.IR stapfuncs (5) diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 346fae0f2..fcb2e3848 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,7 @@ +2007-04-24 Mike Mason + + * socket.stp: adapted to changes in 2.6.19 socket routines + 2007-04-24 Will Cohen * memory.stp: Add matching vm.pagefault.return diff --git a/tapset/socket.stp b/tapset/socket.stp index 587321854..aa30f09d3 100644 --- a/tapset/socket.stp +++ b/tapset/socket.stp @@ -34,11 +34,13 @@ * state Socket state value * flags Socket flags value * type Socket type value - * mflags Message type value * success Was send successful? (1 = yes, 0 = no) */ probe socket.send = socket.sendmsg.return, - socket.do_write.return +%( kernel_v < "2.6.19" %? + socket.writev.return, +%) + socket.aio_write.return { name = "socket.send" } @@ -60,11 +62,13 @@ probe socket.send = socket.sendmsg.return, * state Socket state value * flags Socket flags value * type Socket type value - * mflags Message type value * success Was send successful? (1 = yes, 0 = no) */ probe socket.receive = socket.recvmsg.return, - socket.do_read.return +%( kernel_v < "2.6.19" %? + socket.readv.return, +%) + socket.aio_read.return { name = "socket.receive" } @@ -88,7 +92,6 @@ probe socket.receive = socket.recvmsg.return, * state Socket state value * flags Socket flags value * type Socket type value - * mflags Message type value */ probe socket.sendmsg = kernel.function ("sock_sendmsg") { @@ -99,7 +102,6 @@ probe socket.sendmsg = kernel.function ("sock_sendmsg") state = $sock->state flags = $sock->flags type = $sock->type - mflags = $msg->msg_flags } /* @@ -120,7 +122,6 @@ probe socket.sendmsg = kernel.function ("sock_sendmsg") * state Socket state value * flags Socket flags value * type Socket type value - * mflags Message type value * success Was send successful? (1 = yes, 0 = no) */ probe socket.sendmsg.return = kernel.function ("sock_sendmsg").return @@ -132,7 +133,6 @@ probe socket.sendmsg.return = kernel.function ("sock_sendmsg").return state = $sock->state flags = $sock->flags type = $sock->type - mflags = $msg->msg_flags success = _success_check($return) } @@ -153,7 +153,6 @@ probe socket.sendmsg.return = kernel.function ("sock_sendmsg").return * state Socket state value * flags Socket flags value * type Socket type value - * mflags Message type value */ probe socket.recvmsg = kernel.function ("sock_recvmsg") { @@ -164,7 +163,6 @@ probe socket.recvmsg = kernel.function ("sock_recvmsg") state = $sock->state flags = $sock->flags type = $sock->type - mflags = $msg->msg_flags } /* @@ -185,7 +183,6 @@ probe socket.recvmsg = kernel.function ("sock_recvmsg") * state Socket state value * flags Socket flags value * type Socket type value - * mflags Message type value * success Was receive successful? (1 = yes, 0 = no) */ probe socket.recvmsg.return = kernel.function ("sock_recvmsg").return @@ -197,15 +194,14 @@ probe socket.recvmsg.return = kernel.function ("sock_recvmsg").return state = $sock->state flags = $sock->flags type = $sock->type - mflags = $msg->msg_flags success = _success_check($return) } /* - * probe socket.do_write + * probe socket.aio_write * * Fires at the beginning of sending a message on a socket - * via the do_sock_write() function + * via the sock_aio_write() function * * Context: * The message sender @@ -218,11 +214,139 @@ probe socket.recvmsg.return = kernel.function ("sock_recvmsg").return * state Socket state value * flags Socket flags value * type Socket type value - * mflags Message type value */ -probe socket.do_write = kernel.function ("do_sock_write") +probe socket.aio_write = kernel.function ("sock_aio_write") { - name = "socket.do_write" + name = "socket.aio_write" + _sock = _get_sock_addr ($iocb->ki_filp) + size = _get_sock_size ($iov, $nr_segs) + protocol = _sock_prot_num (_sock) + family = _sock_fam_num (_sock) + state = _sock_state_num (_sock) + flags = _sock_flags_num (_sock) + type = _sock_type_num (_sock) +} + +/* + * probe socket.aio_write.return + * + * Fires at the conclusion of sending a message on a socket + * via the sock_aio_write() function + * + * Context: + * The message receiver. + * + * Variables: + * name Name of this probe + * size Size of message received (in bytes) or + * error code if success = 0 + * protocol Protocol value + * family Protocol family value + * state Socket state value + * flags Socket flags value + * type Socket type value + * success Was receive successful? (1 = yes, 0 = no) + */ +probe socket.aio_write.return = kernel.function ("sock_aio_write").return +{ + name = "socket.aio_write.return" + size = $return + _sock = _get_sock_addr ($iocb->ki_filp) + size = _get_sock_size ($iov, $nr_segs) + protocol = _sock_prot_num (_sock) + family = _sock_fam_num (_sock) + state = _sock_state_num (_sock) + flags = _sock_flags_num (_sock) + type = _sock_type_num (_sock) + success = _success_check($return) +} + +/* + * probe socket.aio_read + * + * Fires at the beginning of receiving a message on a socket + * via the sock_aio_read() function + * + * Context: + * The message sender + * + * Variables: + * name Name of this probe + * size Message size in bytes + * protocol Protocol value + * family Protocol family value + * state Socket state value + * flags Socket flags value + * type Socket type value + */ +probe socket.aio_read = kernel.function ("sock_aio_read") +{ + name = "socket.aio_read" + _sock = _get_sock_addr ($iocb->ki_filp) + size = _get_sock_size ($iov, $nr_segs) + protocol = _sock_prot_num (_sock) + family = _sock_fam_num (_sock) + state = _sock_state_num (_sock) + flags = _sock_flags_num (_sock) + type = _sock_type_num (_sock) +} + +/* + * probe socket.aio_read.return + * + * Fires at the conclusion of receiving a message on a socket + * via the sock_aio_read() function + * + * Context: + * The message receiver. + * + * Variables: + * name Name of this probe + * size Size of message received (in bytes) or + * error code if success = 0 + * protocol Protocol value + * family Protocol family value + * state Socket state value + * flags Socket flags value + * type Socket type value + * success Was receive successful? (1 = yes, 0 = no) + */ +probe socket.aio_read.return = kernel.function ("sock_aio_read").return +{ + name = "socket.aio_read.return" + size = $return + _sock = _get_sock_addr ($iocb->ki_filp) + protocol = _sock_prot_num (_sock) + family = _sock_fam_num (_sock) + state = _sock_state_num (_sock) + flags = _sock_flags_num (_sock) + type = _sock_type_num (_sock) + success = _success_check($return) +} + +// readv and writev were removed in 2.6.19 +%( kernel_v < "2.6.19" %? +/* + * probe socket.writev + * + * Fires at the beginning of sending a message on a socket + * via the sock_writev() function + * + * Context: + * The message sender + * + * Variables: + * name Name of this probe + * size Message size in bytes + * protocol Protocol value + * family Protocol family value + * state Socket state value + * flags Socket flags value + * type Socket type value + */ +probe socket.writev = kernel.function ("sock_writev") +{ + name = "socket.writev" _sock = _get_sock_addr ($file) size = _get_sock_size ($iov, $nr_segs) protocol = _sock_prot_num (_sock) @@ -230,14 +354,13 @@ probe socket.do_write = kernel.function ("do_sock_write") state = _sock_state_num (_sock) flags = _sock_flags_num (_sock) type = _sock_type_num (_sock) - mflags = $msg->msg_flags } /* - * probe socket.do_write.return + * probe socket.writev.return * * Fires at the conclusion of sending a message on a socket - * via the do_sock_write() function + * via the sock_writev() function * * Context: * The message receiver. @@ -251,12 +374,11 @@ probe socket.do_write = kernel.function ("do_sock_write") * state Socket state value * flags Socket flags value * type Socket type value - * mflags Message type value * success Was send successful? (1 = yes, 0 = no) */ -probe socket.do_write.return = kernel.function ("do_sock_write").return +probe socket.writev.return = kernel.function ("sock_writev").return { - name = "socket.do_write.return" + name = "socket.writev.return" size = $return _sock = _get_sock_addr ($file) protocol = _sock_prot_num (_sock) @@ -264,15 +386,14 @@ probe socket.do_write.return = kernel.function ("do_sock_write").return state = _sock_state_num (_sock) flags = _sock_flags_num (_sock) type = _sock_type_num (_sock) - mflags = $msg->msg_flags success = _success_check($return) } /* - * probe socket.do_read + * probe socket.readv * * Fires at the beginning of receiving a message on a socket - * via the do_sock_read() function + * via the sock_readv() function * * Context: * The message sender @@ -285,11 +406,10 @@ probe socket.do_write.return = kernel.function ("do_sock_write").return * state Socket state value * flags Socket flags value * type Socket type value - * mflags Message type value */ -probe socket.do_read = kernel.function ("do_sock_read") +probe socket.readv = kernel.function ("sock_readv") { - name = "socket.do_read" + name = "socket.readv" _sock = _get_sock_addr ($file) size = _get_sock_size ($iov, $nr_segs) protocol = _sock_prot_num (_sock) @@ -297,14 +417,13 @@ probe socket.do_read = kernel.function ("do_sock_read") state = _sock_state_num (_sock) flags = _sock_flags_num (_sock) type = _sock_type_num (_sock) - mflags = $msg->msg_flags } /* - * probe socket.do_read.return + * probe socket.readv.return * * Fires at the conclusion of receiving a message on a socket - * via the do_sock_read() function + * via the sock_readv() function * * Context: * The message receiver. @@ -318,12 +437,11 @@ probe socket.do_read = kernel.function ("do_sock_read") * state Socket state value * flags Socket flags value * type Socket type value - * mflags Message type value * success Was receive successful? (1 = yes, 0 = no) */ -probe socket.do_read.return = kernel.function ("do_sock_read").return +probe socket.readv.return = kernel.function ("sock_readv").return { - name = "socket.do_read.return" + name = "socket.readv.return" size = $return _sock = _get_sock_addr ($file) protocol = _sock_prot_num (_sock) @@ -331,9 +449,9 @@ probe socket.do_read.return = kernel.function ("do_sock_read").return state = _sock_state_num (_sock) flags = _sock_flags_num (_sock) type = _sock_type_num (_sock) - mflags = $msg->msg_flags success = _success_check($return) } +%) /* * probe socket.create @@ -560,7 +678,6 @@ function msg_flags_num2str:string (flags:long) strlcpy (THIS->__retvalue, str, MAXSTRINGLEN); %} - ########################### # INTERNAL MAPPING ARRAYS # ########################### diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 9216640e2..21c78ba16 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2007-0-2 Mike Mason + + * buildok/socket.stp: Adapted to changes in 2.6.19 socket routines. + 2007-04-24 Will Cohen * buildok/memory.stp: Test vm.pagefault.return. diff --git a/testsuite/buildok/socket.stp b/testsuite/buildok/socket.stp index cac6f7140..4b9142a93 100755 --- a/testsuite/buildok/socket.stp +++ b/testsuite/buildok/socket.stp @@ -3,8 +3,12 @@ probe socket.send, socket.receive, socket.sendmsg, socket.sendmsg.return, socket.recvmsg, socket.recvmsg.return, - socket.do_write, socket.do_write.return, - socket.do_read, socket.do_read.return +%( kernel_v < "2.6.19" %? + socket.writev, socket.writev.return, + socket.readv, socket.readv.return, +%) + socket.aio_write, socket.aio_write.return, + socket.aio_read, socket.aio_read.return { log(pp()) log(name) @@ -29,9 +33,6 @@ probe socket.send, socket.receive, typ = sock_type_str2num(tstr) log(sprintf("%d, %d, %s", type, typ, tstr)) - mflstr = msg_flags_num2str(mflags) - log(sprintf("%d, %s", mflags, mflstr)) - log(sprintf("%d", success)) }