[PATCH 02/35] KVM: Add stat counter for hypercalls

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Avi Kivity
Date: Thursday, April 3, 2008 - 12:32 pm

From: Amit Shah <amit.shah@qumranet.com>

Signed-off-by: Amit Shah <amit.shah@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
---
 arch/x86/kvm/x86.c         |    2 ++
 include/asm-x86/kvm_host.h |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index a063f44..15bba5d 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 0c429c8..4f5a71a 100644
--- a/include/asm-x86/kvm_host.h
+++ b/include/asm-x86/kvm_host.h
@@ -327,6 +327,7 @@ struct kvm_vcpu_stat {
 	u32 fpu_reload;
 	u32 insn_emulation;
 	u32 insn_emulation_fail;
+	u32 hypercalls;
 };
 
 struct descriptor_table {
-- 
1.5.4.5

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 02/35] KVM: Add stat counter for hypercalls, Avi Kivity, (Thu Apr 3, 12:32 pm)
[PATCH 04/35] KVM: SVM: make iopm_base static, Avi Kivity, (Thu Apr 3, 12:32 pm)
[PATCH 05/35] KVM: sparse fixes for kvm/x86.c, Avi Kivity, (Thu Apr 3, 12:32 pm)
[PATCH 08/35] KVM: MMU: large page support, Avi Kivity, (Thu Apr 3, 12:32 pm)
[PATCH 11/35] KVM: detect if VCPU triple faults, Avi Kivity, (Thu Apr 3, 12:32 pm)
[PATCH 14/35] KVM: Remove pointless desc_ptr #ifdef, Avi Kivity, (Thu Apr 3, 12:32 pm)
[PATCH 15/35] KVM: In kernel PIT model, Avi Kivity, (Thu Apr 3, 12:32 pm)
[PATCH 18/35] KVM: add basic paravirt support, Avi Kivity, (Thu Apr 3, 12:32 pm)
[PATCH 23/35] x86: KVM guest: hypercall batching, Avi Kivity, (Thu Apr 3, 12:32 pm)
[PATCH 27/35] KVM: kvm.h: __user requires compiler.h, Avi Kivity, (Thu Apr 3, 12:32 pm)
[PATCH 32/35] KVM: no longer EXPERIMENTAL, Avi Kivity, (Thu Apr 3, 12:32 pm)