aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@qumranet.com>2008-02-20 14:30:30 -0500
committerAvi Kivity <avi@qumranet.com>2008-04-27 04:53:24 -0400
commitf11c3a8d84d7bf091bf963edd7104dd4ba6416c3 (patch)
treee297b6cee55b06c8ec40fe00998deef7cfe4a7ce
parenta5f61300c489e334ddf99781a13a7f8d4b580781 (diff)
KVM: Add stat counter for hypercalls
Signed-off-by: Amit Shah <amit.shah@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r--arch/x86/kvm/x86.c2
-rw-r--r--include/asm-x86/kvm_host.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index a063f449a12e..15bba5d37931 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -72,6 +72,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
72 { "irq_window", VCPU_STAT(irq_window_exits) }, 72 { "irq_window", VCPU_STAT(irq_window_exits) },
73 { "halt_exits", VCPU_STAT(halt_exits) }, 73 { "halt_exits", VCPU_STAT(halt_exits) },
74 { "halt_wakeup", VCPU_STAT(halt_wakeup) }, 74 { "halt_wakeup", VCPU_STAT(halt_wakeup) },
75 { "hypercalls", VCPU_STAT(hypercalls) },
75 { "request_irq", VCPU_STAT(request_irq_exits) }, 76 { "request_irq", VCPU_STAT(request_irq_exits) },
76 { "irq_exits", VCPU_STAT(irq_exits) }, 77 { "irq_exits", VCPU_STAT(irq_exits) },
77 { "host_state_reload", VCPU_STAT(host_state_reload) }, 78 { "host_state_reload", VCPU_STAT(host_state_reload) },
@@ -2405,6 +2406,7 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu)
2405 } 2406 }
2406 vcpu->arch.regs[VCPU_REGS_RAX] = ret; 2407 vcpu->arch.regs[VCPU_REGS_RAX] = ret;
2407 kvm_x86_ops->decache_regs(vcpu); 2408 kvm_x86_ops->decache_regs(vcpu);
2409 ++vcpu->stat.hypercalls;
2408 return 0; 2410 return 0;
2409} 2411}
2410EXPORT_SYMBOL_GPL(kvm_emulate_hypercall); 2412EXPORT_SYMBOL_GPL(kvm_emulate_hypercall);
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h
index 90c80fd830fc..935ffa4db9f4 100644
--- a/include/asm-x86/kvm_host.h
+++ b/include/asm-x86/kvm_host.h
@@ -328,6 +328,7 @@ struct kvm_vcpu_stat {
328 u32 fpu_reload; 328 u32 fpu_reload;
329 u32 insn_emulation; 329 u32 insn_emulation;
330 u32 insn_emulation_fail; 330 u32 insn_emulation_fail;
331 u32 hypercalls;
331}; 332};
332 333
333struct descriptor_table { 334struct descriptor_table {