]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
KVM: Add stat counter for hypercalls
authorAmit Shah <amit.shah@qumranet.com>
Wed, 20 Feb 2008 19:30:30 +0000 (01:00 +0530)
committerAvi Kivity <avi@qumranet.com>
Sun, 27 Apr 2008 08:53:24 +0000 (11:53 +0300)
Signed-off-by: Amit Shah <amit.shah@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/x86/kvm/x86.c
include/asm-x86/kvm_host.h

index a063f449a12eb94de72a46e2a1e3847ad5eef514..15bba5d379311a69b8d05b4f0b296e4f9d6bc12a 100644 (file)
@@ -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);
index 90c80fd830fcc96140d2f06f80ebf98d2916a009..935ffa4db9f4f8289ba47e75dd7cde1fb25a0dfa 100644 (file)
@@ -328,6 +328,7 @@ struct kvm_vcpu_stat {
        u32 fpu_reload;
        u32 insn_emulation;
        u32 insn_emulation_fail;
+       u32 hypercalls;
 };
 
 struct descriptor_table {