]> granicus.if.org Git - strace/commit
Print protocol name of socket descriptors with -yy option
authorMasatake YAMATO <yamato@redhat.com>
Sat, 22 Nov 2014 10:03:33 +0000 (19:03 +0900)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 27 Nov 2014 23:48:02 +0000 (23:48 +0000)
commitf548067417e1700e549e1dfe9ffab281258df9cd
tree08ffc3f3cf0c791e9586819affc62a5bddfe621f
parent025b3581ae241150dfc8e24f6a7bae413f8c72b2
Print protocol name of socket descriptors with -yy option

For those socket descriptors that have no associated ip:port pairs
(or when this information is not available), -yy option prints
the same <socket:[INODE]> information as -y option, e.g.

$ strace -e sendto -yy ip l > /dev/null
sendto(3<socket:[23456789]>, ...

This change makes -yy output more informative: instead of just
printing "socket", the name of protocol behind the socket descriptor
will be printed, e.g.

sendto(3<NETLINK:[23456789]>, ...

* configure.ac (AC_CHECK_HEADERS): Add sys/xattr.h.
* tests/net-yy-accept.awk: Update to support protocol names.
* tests/net-yy-connect.awk: Likewise.
* util.c [HAVE_SYS_XATTR_H]: Include <sys/xattr.h>.
(getfdproto): New function.
(printfd): Use it.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
configure.ac
tests/net-yy-accept.awk
tests/net-yy-connect.awk
util.c