[PATCH 001/001] net: Add tx_queue/rx_queue info to /proc/net/unix

STALE5311d REVIEWED: 1 (0M)

1 review trailer.

3 messages, 2 authors, 2012-01-29 · open the first message on its own page

[PATCH 001/001] net: Add tx_queue/rx_queue info to /proc/net/unix

From: Ryan Hajdaj <hidden>
Date: 2012-01-29 02:37:55

From: Ryan Hajdaj <redacted>

Add tx_queue/rx_queue info to /proc/net/unix (unix_seq_show)

Signed-off-by: Ryan Hajdaj <redacted>
Tested-by: Ryan Hajdaj <redacted>
---
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.000000000 +0000
+++ linux-3.3-rc1/net/unix/af_unix.c	2012-01-28 19:09:18.000000000 +0000
@@ -2286,13 +2286,14 @@ static int unix_seq_show(struct seq_file

 	if (v == 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 = v;
 		struct unix_sock *u = unix_sk(s);
 		unix_state_lock(s);

-		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 == TCP_ESTABLISHED ? SS_CONNECTED : SS_UNCONNECTED) :
 			(s->sk_state == TCP_ESTABLISHED ? SS_CONNECTING : SS_DISCONNECTING),
+			unix_outq_len(s),
+			(unix_inq_len(s) < 0 ? 0 : unix_inq_len(s)),
 			sock_i_ino(s));

 		if (u->addr) {

Re: [PATCH 001/001] net: Add tx_queue/rx_queue info to /proc/net/unix

From: Eric Dumazet <hidden>
Date: 2012-01-29 02:57:55

Le samedi 28 janvier 2012 à 21:37 -0500, Ryan Hajdaj a écrit :
quoted hunk
From: Ryan Hajdaj <redacted>

Add tx_queue/rx_queue info to /proc/net/unix (unix_seq_show)

Signed-off-by: Ryan Hajdaj <redacted>
Tested-by: Ryan Hajdaj <redacted>
---
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.000000000 +0000
+++ linux-3.3-rc1/net/unix/af_unix.c	2012-01-28 19:09:18.000000000 +0000
@@ -2286,13 +2286,14 @@ static int unix_seq_show(struct seq_file

 	if (v == 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 = v;
 		struct unix_sock *u = unix_sk(s);
 		unix_state_lock(s);

-		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 == TCP_ESTABLISHED ? SS_CONNECTED : SS_UNCONNECTED) :
 			(s->sk_state == TCP_ESTABLISHED ? SS_CONNECTING : SS_DISCONNECTING),
+			unix_outq_len(s),
+			(unix_inq_len(s) < 0 ? 0 : unix_inq_len(s)),
 			sock_i_ino(s));

 		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.

Re: [PATCH 001/001] net: Add tx_queue/rx_queue info to /proc/net/unix

From: Ryan Hajdaj <hidden>
Date: 2012-01-29 20:56:44

Acknowledged, unix_diag (ss command) addresses the need for this patch.
- Ryan

On 1/28/12, Eric Dumazet [off-list ref] wrote:
Le samedi 28 janvier 2012 à 21:37 -0500, Ryan Hajdaj a écrit :
quoted
From: Ryan Hajdaj <redacted>

Add tx_queue/rx_queue info to /proc/net/unix (unix_seq_show)

Signed-off-by: Ryan Hajdaj <redacted>
Tested-by: Ryan Hajdaj <redacted>
---
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.000000000
+0000
+++ linux-3.3-rc1/net/unix/af_unix.c	2012-01-28 19:09:18.000000000 +0000
@@ -2286,13 +2286,14 @@ static int unix_seq_show(struct seq_file

 	if (v == 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 = v;
 		struct unix_sock *u = unix_sk(s);
 		unix_state_lock(s);

-		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 == TCP_ESTABLISHED ? SS_CONNECTED : SS_UNCONNECTED) :
 			(s->sk_state == TCP_ESTABLISHED ? SS_CONNECTING : SS_DISCONNECTING),
+			unix_outq_len(s),
+			(unix_inq_len(s) < 0 ? 0 : unix_inq_len(s)),
 			sock_i_ino(s));

 		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.


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help