On Sun, Dec 07, 2014 at 06:56:14AM +0900, Masatake YAMATO wrote:
> This patch extends -yy option; the peer address of a unix socket can be
> printed like an inet socket.
> 
> About a listening socket, its socket path and socket inode are printed.
> About an accepted socket, its socket path, socket inode and peer inode
> are printed.
> About a client socket, its socket inode and peer inode are printed.
> 
> An example of server side with netcat:
> 
>    $ ./strace -yy -e network nc -l -U /tmp/example.sock
>    socket(PF_LOCAL, SOCK_STREAM, 0)        = 3
>    setsockopt(3<UNIX:[12592606]>, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
>    bind(3<UNIX:[12592606]>, {sa_family=AF_LOCAL, 
> sun_path="/tmp/example.sock"}, 19) = 0
>    listen(3</tmp/example.sock,12592606>, 10) = 0
>    accept(3</tmp/example.sock,12592606>, {sa_family=AF_LOCAL, NULL}, [2]) = 
> 4</tmp/example.sock,12593212->12591974>
>    recvfrom(4</tmp/example.sock,12593212->12591974>, "INPUT\n", 8192, 0, 
> NULL, NULL) = 6

I see potential source of confusion in this output format: socket path
looks very similar to a regular file path.  Lets change it somehow to
avoid ambiguity.  For example, we could add "UNIX:" prefix:

        3<UNIX:/tmp/example.sock,12592606>

For the same reason, maybe the inode information is better to be added
before the path rather than after the path, e.g.

        4<UNIX:12593212->12591974:/tmp/example.sock>


-- 
ldv

Attachment: pgpOgrL7bLjVk.pgp
Description: PGP signature

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to