Re: [PATCH] kvm/stats: Update kvm stats to clear on write to their debugfs entry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
> > ---
> I have applied it to kvm/queue for the moment, thanks.
Thanks,
Suraj
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux