kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
To: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: kvm@vger.kernel.org, pbonzini@redhat.com
Subject: Re: [PATCH] kvm/stats: Update kvm stats to clear on write to their debugfs entry
Date: Tue, 18 Oct 2016 18:16:51 +1100	[thread overview]
Message-ID: <1476775011.2150.9.camel@gmail.com> (raw)
In-Reply-To: <20161017134004.GA8631@potion>

On Mon, 2016-10-17 at 15:40 +0200, Radim Krčmář wrote:
> 2016-10-14 17:02+1100, Suraj Jitindar Singh:
> > 
> > Various kvm vm and vcpu stats are provided via debugfs entries.
> > Currently there is no way to reset these stats back to zero for the
> > system
> > except by stopping all vms.
> It is not really resetting, just a special case of current behavior
> --
> top-level stats are a sum of all existing VMs/VCPUs, so we would see
> 0
> if they all had 0.
Yeah I worded that poorly
> 
> > 
> > Add the ability to clear (reset back to zero) these stats on a per
> > stat
> > basis by writing to the debugfs files.
> I can see this being used before a test, but the userspace could also
> read the value instead of writing and subtract it from the value
> after
> the test to get a similar result.
True
> 
> The userspace-only solution is insufficient?
> 
> When and what do you zero?
My use case was just reading these stats as a way to verify that I was
actually hitting certain code paths that increment certain stats.
It was beneficial to be able to reset them to zero just to make it
easier to discern when and by how much they increased.

While it would be trivial to put something together which tracked the
change from some baseline value I don't see any reason to not have the
functionality to reset them back to zero as well.
> 
> > 
> >                                        The stats are just reset to
> > zero
> > irrespective of what is actually written to the file.
> Sounds good.  Setting the val would be as simple, but there shouldn't
> be
> a reason to and it is a debug interface, so we can change it anytime.
> 
> > 
> > Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
> > ---
> I have applied it to kvm/queue for the moment, thanks.
Thanks,
Suraj

  parent reply	other threads:[~2016-10-18  7:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-14  6:02 [PATCH] kvm/stats: Update kvm stats to clear on write to their debugfs entry Suraj Jitindar Singh
2016-10-17 13:40 ` Radim Krčmář
2016-10-17 13:48   ` Christian Borntraeger
2016-10-18  7:18     ` Suraj Jitindar Singh
2016-10-18  7:16   ` Suraj Jitindar Singh [this message]
2016-10-17 16:50 ` Paolo Bonzini
2016-10-18  6:20   ` Suraj Jitindar Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1476775011.2150.9.camel@gmail.com \
    --to=sjitindarsingh@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).