]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
KVM: Add fpu_reload counter
authorAvi Kivity <avi@qumranet.com>
Sun, 18 Nov 2007 11:54:33 +0000 (13:54 +0200)
committerAvi Kivity <avi@qumranet.com>
Wed, 30 Jan 2008 15:53:04 +0000 (17:53 +0200)
Measure the number of times we switch the fpu state.

Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/kvm.h
drivers/kvm/x86.c

index 04efe8833e090c9d74b3604937c5b4095349b62b..a85c5903591f2fa87e3ee09a50fd91205e248fc1 100644 (file)
@@ -248,6 +248,7 @@ struct kvm_stat {
        u32 irq_exits;
        u32 host_state_reload;
        u32 efer_reload;
+       u32 fpu_reload;
 };
 
 struct kvm_io_device {
index 923dfd4e0afd85ff0cd2e33f02f56c40b4ba8065..c1211e125b4387bc06ef14067149f75f5912572b 100644 (file)
@@ -62,6 +62,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
        { "irq_exits", STAT_OFFSET(irq_exits) },
        { "host_state_reload", STAT_OFFSET(host_state_reload) },
        { "efer_reload", STAT_OFFSET(efer_reload) },
+       { "fpu_reload", STAT_OFFSET(fpu_reload) },
        { NULL }
 };
 
@@ -2417,6 +2418,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
        vcpu->guest_fpu_loaded = 0;
        fx_save(&vcpu->guest_fx_image);
        fx_restore(&vcpu->host_fx_image);
+       ++vcpu->stat.fpu_reload;
 }
 EXPORT_SYMBOL_GPL(kvm_put_guest_fpu);