Thread (3 messages) flat view 3 messages, 2 authors, 2016-07-15

Re: [PATCH V3 4/5] kvm/stats: Add provisioning for 64-bit vm and vcpu statistics

From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Date: 2016-07-15 07:50:11
Also in: kvm, kvmarm, linux-mips, linux-s390


On 13/07/16 19:04, Christian Borntraeger wrote:
On 07/13/2016 10:53 AM, Suraj Jitindar Singh wrote:
quoted
vms and vcpus have statistics associated with them which can be viewed
within the debugfs. Currently it is assumed within the vcpu_stat_get() and
vm_stat_get() functions that all of these statistics are represented as
u32s, however the next patch adds some u64 statistics.

Thus modify these two functions, vcpu_stat_get() and vm_stat_get(), such
that they expect u64 statistics and update vm and vcpu statistics to u64s
accordingly.

---
Change Log:

V1 -> V2:
	- Nothing
V2 -> V3:
	- Instead of implementing separate u32 and u64 functions keep the
	  generic functions and modify them to expect u64s. Thus update all
	  vm and vcpu statistics to u64s accordingly.
Have not looked into everything, but I agree with changing everything to 64bit.

quoted
@@ -3583,8 +3583,8 @@ static const struct file_operations vcpu_stat_get_per_vm_fops = {
 };

 static const struct file_operations *stat_fops_per_vm[] = {
-	[KVM_STAT_VCPU] = &vcpu_stat_get_per_vm_fops,
-	[KVM_STAT_VM]   = &vm_stat_get_per_vm_fops,
+	[KVM_STAT_VCPU]		= &vcpu_stat_get_per_vm_fops,
+	[KVM_STAT_VM]		= &vm_stat_get_per_vm_fops,
 };
unrelated white space changes?
Woops, I'll fix that. Thanks
quoted
 static int vm_stat_get(void *_offset, u64 *val)
@@ -3628,8 +3628,8 @@ static int vcpu_stat_get(void *_offset, u64 *val)
 DEFINE_SIMPLE_ATTRIBUTE(vcpu_stat_fops, vcpu_stat_get, NULL, "%llu\n");

 static const struct file_operations *stat_fops[] = {
-	[KVM_STAT_VCPU] = &vcpu_stat_fops,
-	[KVM_STAT_VM]   = &vm_stat_fops,
+	[KVM_STAT_VCPU]		= &vcpu_stat_fops,
+	[KVM_STAT_VM]		= &vm_stat_fops,
 };

 static int kvm_init_debug(void)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help