]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: get per socket memory statistics at socket's sysfs file
authorAmir Vadai <amirv@mellanox.co.il>
Sun, 6 Mar 2011 13:09:24 +0000 (15:09 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:05:45 +0000 (05:05 -0700)
Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_proc.c

index b5eb400b611f2aa009e4e388af0afb3f6ae0f195..6fe0136d1064951c8eda182defacbb1fa16baed8 100644 (file)
@@ -700,7 +700,15 @@ static int sdp_ssk_hist_seq_show(struct seq_file *seq, void *v)
                        sk, sdp_state_str(sk->sk_state),
                        ssk->hst_idx, ARRAY_SIZE(ssk->hst));
 
-       for (i = 0; i < ssk->hst_idx; ++i) {
+       seq_printf(seq, "rmem: %d wmem: %d wqueue: %d "
+                       "fw: %d prot->alloc: %d\n",
+                       atomic_read(&sk->sk_rmem_alloc),
+                       atomic_read(&sk->sk_wmem_alloc),
+                       sk->sk_wmem_queued,
+                       sk->sk_forward_alloc,
+                       atomic_read(sk->sk_prot->memory_allocated));
+                       
+       for (i = 0; i < min(ssk->hst_idx, ARRAY_SIZE(ssk->hst)); ++i) {
                struct sdp_sock_hist *hst = &ssk->hst[i];
                char *ref_str = reftype2str(hst->ref_type);