From: Amit Shah Date: Wed, 20 Feb 2008 19:30:30 +0000 (+0530) Subject: KVM: Add stat counter for hypercalls X-Git-Tag: v2.6.26-rc1~1028^2~105 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=f11c3a8d84d7bf091bf963edd7104dd4ba6416c3;p=linux-2.6-omap-h63xx.git KVM: Add stat counter for hypercalls Signed-off-by: Amit Shah Signed-off-by: Avi Kivity --- diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index a063f449a12..15bba5d3793 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -72,6 +72,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { { "irq_window", VCPU_STAT(irq_window_exits) }, { "halt_exits", VCPU_STAT(halt_exits) }, { "halt_wakeup", VCPU_STAT(halt_wakeup) }, + { "hypercalls", VCPU_STAT(hypercalls) }, { "request_irq", VCPU_STAT(request_irq_exits) }, { "irq_exits", VCPU_STAT(irq_exits) }, { "host_state_reload", VCPU_STAT(host_state_reload) }, @@ -2405,6 +2406,7 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu) } vcpu->arch.regs[VCPU_REGS_RAX] = ret; kvm_x86_ops->decache_regs(vcpu); + ++vcpu->stat.hypercalls; return 0; } EXPORT_SYMBOL_GPL(kvm_emulate_hypercall); diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h index 90c80fd830f..935ffa4db9f 100644 --- a/include/asm-x86/kvm_host.h +++ b/include/asm-x86/kvm_host.h @@ -328,6 +328,7 @@ struct kvm_vcpu_stat { u32 fpu_reload; u32 insn_emulation; u32 insn_emulation_fail; + u32 hypercalls; }; struct descriptor_table {