]> granicus.if.org Git - strace/commit
Add a function for dumping iovec in msghdr used in sendmsg and recvmsg
authorMasatake YAMATO <yamato@redhat.com>
Wed, 15 Oct 2014 13:11:43 +0000 (22:11 +0900)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 1 Nov 2014 01:46:06 +0000 (01:46 +0000)
commit02f9f6b386741a52f58e1b31ad4e7fff60781ef8
treea450dd7c4acf33da13683d04cf3b60cedef22ce0
parent40c174b38b15adb059f3e855e24fcfea9e091a87
Add a function for dumping iovec in msghdr used in sendmsg and recvmsg

Here is an example session:

    $ ./strace -e write=all ip link change dev enp0s25 mtu 1501 > /dev/null
    sendmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"(...
     * 40 bytes in buffer 0
     | 00000  28 00 00 00 10 00 05 00  d0 d9 aa 53 00 00 00 00  (..........S.... |
     | 00010  00 00 00 00 02 00 00 00  00 00 00 00 00 00 00 00  ................ |
     | 00020  08 00 04 00 dd 05 00 00                           ........         |
    ...

    $ ./strace -e read=all ip link show > /dev/null
    recvmsg(3, {msg_name(12)={sa_family=AF_NETLINK, pid=0, groups=00000000}, msg_iov(1)=[{"...
     * 8192 bytes in buffer 0
     | 00000  34 00 00 00 02 00 00 00  00 00 00 00 ff 23 00 00  4............#.. |
     | 00010  ff ff ff ff 20 00 00 00  10 00 05 00 00 00 00 00  .... ........... |
    ...

* defs.h (dumpiov_in_msghdr): New prototype.
* net.c (extractmsghdr): New function derived from printmsghdr.
(printmsghdr): Use extractmsghdr.
(dumpiov_in_msghdr): New function.
* syscall.c (dumpio) [HAVE_SENDMSG]: Call dumpiov_in_msghdr for recvmsg
and sendmsg syscalls.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
defs.h
net.c
syscall.c