[PATCH 2/3] Support unix sockets in -yy option

Dmitry V. Levin ldv at altlinux.org
Tue Dec 9 02:01:58 UTC 2014


On Tue, Dec 09, 2014 at 10:39:41AM +0900, Masatake YAMATO wrote:
[...]
> How about following format:
> 
>     FD "<UNIX:[" SELF_INODE [ "->" PEER_INODE ] [ ":" PATH ] "]>"

I don't quite like ":" before the path, it reminds me of ip:port pairs,
so let's use "," as you suggested earlier.

> (I used double quotes here because "[" and "]" are used as literal and meta characters.)
> 
> e.g.
> 
>     % ./strace -yy -e network nc -l -U /tmp/example.socket
>     socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
>     setsockopt(3<UNIX:[14672314]>, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
>     bind(3<UNIX:[14672314]>, {sa_family=AF_LOCAL, sun_path="/tmp/example.socket"}, 21) = 0
>     listen(3<UNIX:[14672314:/tmp/example.socket]>, 10) = 0
>     accept(3<UNIX:[14672314:/tmp/example.socket]>, {sa_family=AF_LOCAL, NULL}, [2]) = 4<UNIX:[14672333->14672331:/tmp/example.socket]>
>     recvfrom(4<UNIX:[14672333->14672331:/tmp/example.socket]>, "a\n", 8192, 0, NULL, NULL) = 2
> 
> Using "[" and "]" as literal characters is verbose but the output
> format is uniformed well in listening, accepted sockets and other protocol
> of sockets like netlink.

Output formats for UNIX and TCP/UDP also have to be consistent.
How would TCP/UDP output format look like then?


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20141209/21a21032/attachment.bin>


More information about the Strace-devel mailing list