From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Dumazet Subject: Re: [PATCH 001/001] net: Add tx_queue/rx_queue info to /proc/net/unix Date: Sun, 29 Jan 2012 03:57:45 +0100 Message-ID: <1327805865.2805.23.camel@edumazet-laptop> References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: Ryan Hajdaj Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Le samedi 28 janvier 2012 =C3=A0 21:37 -0500, Ryan Hajdaj a =C3=A9crit = : > From: Ryan Hajdaj >=20 > Add tx_queue/rx_queue info to /proc/net/unix (unix_seq_show) >=20 > Signed-off-by: Ryan Hajdaj > Tested-by: Ryan Hajdaj > --- > tx_queue/rx_queue info is useful in systems with multiple processes > using Unix Domain sockets to communicate, as it can be used to check > process health "at a glance". > Unit tested on Unix stream and datagram sockets. > --- linux-3.3-rc1/net/unix/af_unix.c.orig 2012-01-28 20:36:33.0000000= 00 +0000 > +++ linux-3.3-rc1/net/unix/af_unix.c 2012-01-28 19:09:18.000000000 +0= 000 > @@ -2286,13 +2286,14 @@ static int unix_seq_show(struct seq_file >=20 > if (v =3D=3D SEQ_START_TOKEN) > seq_puts(seq, "Num RefCount Protocol Flags Type St " > - "Inode Path\n"); > + "tx_queue rx_queue Inode Path\n"); > else { > struct sock *s =3D v; > struct unix_sock *u =3D unix_sk(s); > unix_state_lock(s); >=20 > - seq_printf(seq, "%pK: %08X %08X %08X %04X %02X %5lu", > + seq_printf(seq, > + "%pK: %08X %08X %08X %04X %02X %08lX %08lX %5lu", > s, > atomic_read(&s->sk_refcnt), > 0, > @@ -2301,6 +2302,8 @@ static int unix_seq_show(struct seq_file > s->sk_socket ? > (s->sk_state =3D=3D TCP_ESTABLISHED ? SS_CONNECTED : SS_UNCONNECT= ED) : > (s->sk_state =3D=3D TCP_ESTABLISHED ? SS_CONNECTING : SS_DISCONNE= CTING), > + unix_outq_len(s), > + (unix_inq_len(s) < 0 ? 0 : unix_inq_len(s)), > sock_i_ino(s)); >=20 > if (u->addr) { You missed some discussion on netdev about this kind of patches. /proc/net/unix format is frozen. Pavel Emelyanov did the work to support unix_diag, where you can find all you need.