Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f2b5756bb3fbdca912c4890e444c18650389d8ae
Commit:     f2b5756bb3fbdca912c4890e444c18650389d8ae
Parent:     f096ed8588b53bf802b84862c6c4d00d25d1ed72
Author:     Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Sun Nov 18 15:17:51 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 17:53:04 2008 +0200

    KVM: Add instruction emulation statistics
---
 drivers/kvm/kvm.h |    2 ++
 drivers/kvm/x86.c |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index a85c590..5a8a9af 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -249,6 +249,8 @@ struct kvm_stat {
        u32 host_state_reload;
        u32 efer_reload;
        u32 fpu_reload;
+       u32 insn_emulation;
+       u32 insn_emulation_fail;
 };
 
 struct kvm_io_device {
diff --git a/drivers/kvm/x86.c b/drivers/kvm/x86.c
index c1211e1..a46b95b 100644
--- a/drivers/kvm/x86.c
+++ b/drivers/kvm/x86.c
@@ -63,6 +63,8 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
        { "host_state_reload", STAT_OFFSET(host_state_reload) },
        { "efer_reload", STAT_OFFSET(efer_reload) },
        { "fpu_reload", STAT_OFFSET(fpu_reload) },
+       { "insn_emulation", STAT_OFFSET(insn_emulation) },
+       { "insn_emulation_fail", STAT_OFFSET(insn_emulation_fail) },
        { NULL }
 };
 
@@ -1381,7 +1383,9 @@ int emulate_instruction(struct kvm_vcpu *vcpu,
                                        get_segment_base(vcpu, VCPU_SREG_FS);
 
                r = x86_decode_insn(&vcpu->emulate_ctxt, &emulate_ops);
+               ++vcpu->stat.insn_emulation;
                if (r)  {
+                       ++vcpu->stat.insn_emulation_fail;
                        if (kvm_mmu_unprotect_page_virt(vcpu, cr2))
                                return EMULATE_DONE;
                        return EMULATE_FAIL;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to