Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp110957ybi; Wed, 29 May 2019 17:43:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqy47wZ6zRY3P2wodXtOBZn5lpDNCxxZgAXvssZJQyFj6dno/nvtZT+iJrE5kO0bnDQPdUlQ X-Received: by 2002:a17:902:b495:: with SMTP id y21mr866432plr.243.1559177029075; Wed, 29 May 2019 17:43:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559177029; cv=none; d=google.com; s=arc-20160816; b=vzzedreunYA433rd804fAMTqvvbCgcZhrLUc6qPR+A7vmx5hkkAr2+PLvpdUge/Cmu dTqsrHloB2x8n/ga/CEWFpWk00MLPmojJmW1Wd0SwNT7oCK8GU4ywrTUNMeRPdtHsE9w XsPMm0sZoZM3JpXGq0Bwzd0kK3TyX5DdaTAGQMmKyqXhvwAAYhyoSFevOgT0TWDnKxDz LrAPAcltT8S20zRf4c7h89rignUoybdMjloRqyUYYLkX6LBT7hBp1bhMMaFLrkS4y9hh 8yWH+x9lwuifhw7SI/sKLcwy65anh3o88i6GXdpxdLCrMgepJOxA3EecD/nP7CRv59z0 dGow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:cc:subject:date:to :from; bh=Mr5RjdlD5MXv9MZnQWFmzMAnfnAGq6i/k0+VkQ7dmYw=; b=BfvdmVPEf3JrBcgrRKBkfCChpm9cPxsytHlFkQI9aqWsx5h3veyyW0VJNR1aNPY0kg IzkAn63x7SNnsTfrAqdFewC6cwVyAw0QRN/7xVfpzrDtWWi2LeePJMOKoYBm/5A11q+g 4rrRVy6KL1ufaKF9MQiZH77yAd8E74bpUk0852v8GlkIJdVkNcyC+C1ihy/HZ0XxzinZ I+ZAFaON7jkSbU/Eue3GB6Lpj8G8Gna9g/djAPjtq9CTjQjoKm60LniCicPRP6x0WKDX +BqF5pY0Z4TF03vQo1x79IQdusMDFy2wFH7+NNvMGaAjytAOuNHpRNr3OY6QmX2nSCSI oy+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l59si1183265pjb.38.2019.05.29.17.43.34; Wed, 29 May 2019 17:43:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726701AbfE3An3 (ORCPT + 99 others); Wed, 29 May 2019 20:43:29 -0400 Received: from mx2.suse.de ([195.135.220.15]:46444 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726527AbfE3An3 (ORCPT ); Wed, 29 May 2019 20:43:29 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 679B8AC66; Thu, 30 May 2019 00:43:28 +0000 (UTC) From: NeilBrown To: Olga Kornievskaia , Chuck Lever , Schumaker Anna , Trond Myklebust Date: Thu, 30 May 2019 10:41:28 +1000 Subject: [PATCH 4/9] SUNRPC: enhance rpc_clnt_show_stats() to report on all xprts. Cc: linux-nfs@vger.kernel.org Message-ID: <155917688867.3988.13820076347074775411.stgit@noble.brown> In-Reply-To: <155917564898.3988.6096672032831115016.stgit@noble.brown> References: <155917564898.3988.6096672032831115016.stgit@noble.brown> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Now that a client can have multiple xprts, we need to report the statistics for all of them. Reported-by: Chuck Lever Signed-off-by: NeilBrown --- net/sunrpc/stats.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/net/sunrpc/stats.c b/net/sunrpc/stats.c index 2b6dc7e5f74f..d26df6074bca 100644 --- a/net/sunrpc/stats.c +++ b/net/sunrpc/stats.c @@ -236,9 +236,16 @@ static void _print_rpc_iostats(struct seq_file *seq, struct rpc_iostats *stats, ktime_to_ms(stats->om_execute)); } +static int do_print_stats(struct rpc_clnt *clnt, struct rpc_xprt *xprt, void *seqv) +{ + struct seq_file *seq = seqv; + + xprt->ops->print_stats(xprt, seq); + return 0; +} + void rpc_clnt_show_stats(struct seq_file *seq, struct rpc_clnt *clnt) { - struct rpc_xprt *xprt; unsigned int op, maxproc = clnt->cl_maxproc; if (!clnt->cl_metrics) @@ -248,11 +255,7 @@ void rpc_clnt_show_stats(struct seq_file *seq, struct rpc_clnt *clnt) seq_printf(seq, "p/v: %u/%u (%s)\n", clnt->cl_prog, clnt->cl_vers, clnt->cl_program->name); - rcu_read_lock(); - xprt = rcu_dereference(clnt->cl_xprt); - if (xprt) - xprt->ops->print_stats(xprt, seq); - rcu_read_unlock(); + rpc_clnt_iterate_for_each_xprt(clnt, do_print_stats, seq); seq_printf(seq, "\tper-op statistics\n"); for (op = 0; op < maxproc; op++) {