]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
rxrpc: Display call expect-receive-by timeout in proc
authorDavid Howells <dhowells@redhat.com>
Mon, 23 Jul 2018 16:18:36 +0000 (17:18 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 1 Aug 2018 12:28:23 +0000 (13:28 +0100)
Display in /proc/net/rxrpc/calls the timeout by which a call next expects
to receive a packet.

This makes it easier to debug timeout issues.

Signed-off-by: David Howells <dhowells@redhat.com>
net/rxrpc/proc.c

index d9fca8c4bcdc27288ab9f1fc3c433d722ab1495f..bc6f27c8869d14151da41093a7a8691665a26137 100644 (file)
@@ -63,6 +63,7 @@ static int rxrpc_call_seq_show(struct seq_file *seq, void *v)
        struct rxrpc_peer *peer;
        struct rxrpc_call *call;
        struct rxrpc_net *rxnet = rxrpc_net(seq_file_net(seq));
+       unsigned long timeout = 0, nowj;
        rxrpc_seq_t tx_hard_ack, rx_hard_ack;
        char lbuff[50], rbuff[50];
 
@@ -71,7 +72,7 @@ static int rxrpc_call_seq_show(struct seq_file *seq, void *v)
                         "Proto Local                                          "
                         " Remote                                         "
                         " SvID ConnID   CallID   End Use State    Abort   "
-                        " UserID\n");
+                        " UserID           TxSeq    TW RxSeq    RW RxTimo\n");
                return 0;
        }
 
@@ -94,11 +95,17 @@ static int rxrpc_call_seq_show(struct seq_file *seq, void *v)
        else
                strcpy(rbuff, "no_connection");
 
+       if (call->state != RXRPC_CALL_SERVER_PREALLOC) {
+               timeout = READ_ONCE(call->expect_rx_by);
+               nowj = jiffies;
+               timeout -= jiffies;
+       }
+
        tx_hard_ack = READ_ONCE(call->tx_hard_ack);
        rx_hard_ack = READ_ONCE(call->rx_hard_ack);
        seq_printf(seq,
                   "UDP   %-47.47s %-47.47s %4x %08x %08x %s %3u"
-                  " %-8.8s %08x %lx %08x %02x %08x %02x\n",
+                  " %-8.8s %08x %lx %08x %02x %08x %02x %06lx\n",
                   lbuff,
                   rbuff,
                   call->service_id,
@@ -110,7 +117,8 @@ static int rxrpc_call_seq_show(struct seq_file *seq, void *v)
                   call->abort_code,
                   call->user_call_ID,
                   tx_hard_ack, READ_ONCE(call->tx_top) - tx_hard_ack,
-                  rx_hard_ack, READ_ONCE(call->rx_top) - rx_hard_ack);
+                  rx_hard_ack, READ_ONCE(call->rx_top) - rx_hard_ack,
+                  timeout);
 
        return 0;
 }