Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1066585ybi; Wed, 19 Jun 2019 12:52:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGbxVc+luOIPNqDdhGgp8fn+2sIIaaY+G7ISBs8T7jIBwix7WOKIW5M4QdIhZvUgIyY5nB X-Received: by 2002:a63:3042:: with SMTP id w63mr2047750pgw.21.1560973943601; Wed, 19 Jun 2019 12:52:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560973943; cv=none; d=google.com; s=arc-20160816; b=UGCm4yPwyye3hVWWkH+HOs+6MMmh24sFzlhD1yZhqxbtcq41Utn8rng+571+a4jeae b1KNLkEP66HSqx3Kq2TQnIq9SUVsmJ/YkeWYRmjqEy16SPsg7y53Lch23UIfH2ViiGSM l8AVH2bstFc6C0IpSIAQtUX0bXlhqAwQGkX43bMI4PfejzAbU+2ATPLn3ZqeUiZWlATx SIU3zRtC06n+3q9liDvQwkDuZvHV71oSZro3wkUR86k7rtTSiJIiWh4xs/nxKctfCgjx hZw/44Q+EpWJWL4frwAGgnyrwCO0BrjQ6VooNXmm5L54553iGqsjvcs00nvbtm0Sibth R2aw== 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 :references:in-reply-to:date:cc:to:from:subject:message-id; bh=9UqMkwWmLaKxEjBWC9VrXMYNUxYkyv4UzRjUoOCsCvE=; b=K+r86rc6T/f8EJSxQ3jvmYq/eEpRw7qDanDqMIE0/e9axMXeqtO0j+k05HBRzCrQ09 muGBOUJ8+0QS4XffYlwJQ9iqiN0x4KrtmXfaCLnyW4+bXM5h7ZDR1c+mnEyevuqJA96h eREruZg7R5x5DRjc9wme++7dh75LX1KrC1qCRHn9engnL1vEPHe81Hlsn5uKZ3Ru2P+g tWea2DS+XcHvltKPJS6sGevRl0+JVrMkmK9YNdHBnEf6v5OALg4GnmUXbI/AU8AucR55 uNV/gnmxMOVay1TKDJjOirDQfiE6bl1iv5FhziAAGK6ihddPtBy58+8/AkmWmIorwo6+ aIsw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cn1si12919515plb.204.2019.06.19.12.52.08; Wed, 19 Jun 2019 12:52:23 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727085AbfFSTur (ORCPT + 99 others); Wed, 19 Jun 2019 15:50:47 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:41331 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726175AbfFSTur (ORCPT ); Wed, 19 Jun 2019 15:50:47 -0400 Received: by mail-qt1-f196.google.com with SMTP id d17so483307qtj.8 for ; Wed, 19 Jun 2019 12:50:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=9UqMkwWmLaKxEjBWC9VrXMYNUxYkyv4UzRjUoOCsCvE=; b=p/eTHsjc5eh1nJfvtq7+3k8Ns39R2PvzpKt/WL7ChyV5v7IRkfWKTQt1qOpbhk7Wvd 7l52KyNtFDARMW4u1rSwKlZilNPqUA+ZuzDBTbz7iY6LqZZY6/GqSFD2syPXBRVc6EZO iCl6hBja0iI3xtUC+8Ft0404NNzTXYPGJHv6sk5Nqy/KRauIDQnhUbcaOEd1AnEOpDZG +AKMe7rGaE1pLczVDhZCT4TmfbPeum1j4gxZJj8W3aSBSF1Ulic5/2Cqca5ot6wE1D0g qH7lrEEszUSP2tJvCQz6TwnKbekHe4kwIyGx1wquadFjgwGaL3maovyihrFwzQjkf8GE gC4Q== X-Gm-Message-State: APjAAAUk8Zy7EttYVwXg5Dl89fYBXQB/daxlzJ4E7xw29o1VMHn+zqxW jeVxCgaYPqIhQUGAcAxMP+lS1yl+evY= X-Received: by 2002:a0c:b012:: with SMTP id k18mr35631188qvc.74.1560973845687; Wed, 19 Jun 2019 12:50:45 -0700 (PDT) Received: from dhcp-12-212-173.gsslab.rdu.redhat.com (nat-pool-rdu-t.redhat.com. [66.187.233.202]) by smtp.gmail.com with ESMTPSA id l5sm1001433qte.9.2019.06.19.12.50.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Jun 2019 12:50:45 -0700 (PDT) Message-ID: Subject: Re: [PATCH 3/3] mountstats: Check for RPC iostats version >= 1.1 with error counts From: Dave Wysochanski To: Chuck Lever Cc: Steve Dickson , Linux NFS Mailing List Date: Wed, 19 Jun 2019 15:50:44 -0400 In-Reply-To: References: <20190612190229.31811-1-dwysocha@redhat.com> <20190613120314.1864-1-dwysocha@redhat.com> <20190613120314.1864-3-dwysocha@redhat.com> <7211D5DF-6923-459D-9B84-2BD264EB9F11@oracle.com> <449f121418f5667436e6d42432c6404aa0fed9e9.camel@redhat.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-2.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, 2019-06-19 at 15:46 -0400, Chuck Lever wrote: > > On Jun 19, 2019, at 3:42 PM, Dave Wysochanski > > wrote: > > > > On Wed, 2019-06-19 at 13:45 -0400, Chuck Lever wrote: > > > > On Jun 19, 2019, at 1:42 PM, Chuck Lever < > > > > chuck.lever@oracle.com> > > > > wrote: > > > > > > > > > > > > > > > > > On Jun 19, 2019, at 1:22 PM, David Wysochanski < > > > > > dwysocha@redhat.com> wrote: > > > > > > > > > > > > > > > > > > > > On Wed, Jun 19, 2019 at 12:35 PM Chuck Lever < > > > > > chuck.lever@oracle.com> wrote: > > > > > > > > > > > > > > > > On Jun 13, 2019, at 8:03 AM, Dave Wysochanski < > > > > > > dwysocha@redhat.com> wrote: > > > > > > > > > > > > Add explicit check for statsvers instead of array based > > > > > > check. > > > > > > > > > > Hi Dave, > > > > > > > > > > I don't understand why this change is necessary. The patch > > > > > description > > > > > should explain. > > > > > > > > > > > > > > > Steve had already taken commit 73491ef for mountstats which > > > > > was > > > > > an array based check. This just makes this patch consistent > > > > > with > > > > > the others. Is that what you mean - you want a statement > > > > > about > > > > > consistency and refer to the other commit? How about: > > > > > > > > > > Commit 73491ef added per-op error counts for mountstats > > > > > command > > > > > but used an array based check rather than checking statsver. > > > > > Add > > > > > explicit check for statsver instead of array based check for > > > > > consistency with other tools. > > > > > > > > This is a better patch description (explains "why" not "what"), > > > > but I'm not clear why this change is necessary in either place. > > > > > > In other words, was this change necessary to fix a bug? Or is > > > this a defensive change to make parsing more robust? > > > > > > > I try to state "fix" somewhere in there when it is a bug fix - so > > no > > this does not fix a bug. In in some ways the original check was > > better > > because it makes no assumption of what 'statsver' means at any > > time. > > I'm not sure if you're really concerned about the commit message or > > you > > would prefer the array check? > > Both. The array check is done for all the other variables too, IIRC. > There doesn't seem to be a reason to check the statvers. If it's not > too much trouble, please resubmit so that the new checks are > consistent > with existing checks. > No problem at all - will do! > > > I can see argument for array check and I > > can change the other patches and resubmit if you prefer that. > > > > Commit 73491ef added per-op error counts for mountstats command > > but used an array based check rather than checking statsver. Check > > statsver >= 1.1 explicitly as this documents when this new count > > was > > added to the kernel. > > Not sure there's a need for the statvers bump here either. There > are some rules about when a statvers bump is necessary, but in my > old age I don't remember what they are. Anyway, if the statvers is > bumped already, no big deal. > As far as I understood this version covers the rpc_iostats structure so yes I thought it was necessary so I changed it when I added "om_error_status" http://git.linux-nfs.org/?p=trondmy/linux-nfs.git;a=patch;h=6e034f84c67d677e87e11e42d1faaca854023d16 > > > > > > > Signed-off-by: Dave Wysochanski > > > > > > --- > > > > > > tools/mountstats/mountstats.py | 2 +- > > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > > > diff --git a/tools/mountstats/mountstats.py > > > > > > b/tools/mountstats/mountstats.py > > > > > > index 5f13bf8e..2ebbf945 100755 > > > > > > --- a/tools/mountstats/mountstats.py > > > > > > +++ b/tools/mountstats/mountstats.py > > > > > > @@ -476,7 +476,7 @@ class DeviceData: > > > > > > if retrans != 0: > > > > > > print('\t%d retrans (%d%%)' % (retrans, > > > > > > ((retrans * 100) / count)), end=' ') > > > > > > print('\t%d major timeouts' % stats[3], > > > > > > end='') > > > > > > - if len(stats) >= 10 and stats[9] != 0: > > > > > > + if self.__rpc_data['statsvers'] >= 1.1 and > > > > > > stats[9] != 0: > > > > > > print('\t%d errors (%d%%)' % (stats[9], > > > > > > ((stats[9] * 100) / count))) > > > > > > else: > > > > > > print('') > > > > > > -- > > > > > > 2.20.1 > > > > > > > > > > > > > > > > -- > > > > > Chuck Lever > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Dave Wysochanski > > > > > Principal Software Maintenance Engineer > > > > > T: 919-754-4024 > > > > > > > > -- > > > > Chuck Lever > > > > > > -- > > > Chuck Lever > > -- > Chuck Lever > > >