aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kvm/x86.c2
-rw-r--r--include/trace/events/kvm.h19
2 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 27af6e353b06..3b90298fb980 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -5292,6 +5292,7 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu)
5292 vcpu->guest_fpu_loaded = 1; 5292 vcpu->guest_fpu_loaded = 1;
5293 kvm_fx_save(&vcpu->arch.host_fx_image); 5293 kvm_fx_save(&vcpu->arch.host_fx_image);
5294 kvm_fx_restore(&vcpu->arch.guest_fx_image); 5294 kvm_fx_restore(&vcpu->arch.guest_fx_image);
5295 trace_kvm_fpu(1);
5295} 5296}
5296 5297
5297void kvm_put_guest_fpu(struct kvm_vcpu *vcpu) 5298void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
@@ -5304,6 +5305,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
5304 kvm_fx_restore(&vcpu->arch.host_fx_image); 5305 kvm_fx_restore(&vcpu->arch.host_fx_image);
5305 ++vcpu->stat.fpu_reload; 5306 ++vcpu->stat.fpu_reload;
5306 set_bit(KVM_REQ_DEACTIVATE_FPU, &vcpu->requests); 5307 set_bit(KVM_REQ_DEACTIVATE_FPU, &vcpu->requests);
5308 trace_kvm_fpu(0);
5307} 5309}
5308 5310
5309void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu) 5311void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h
index dbe108455275..8abdc1230143 100644
--- a/include/trace/events/kvm.h
+++ b/include/trace/events/kvm.h
@@ -145,6 +145,25 @@ TRACE_EVENT(kvm_mmio,
145 __entry->len, __entry->gpa, __entry->val) 145 __entry->len, __entry->gpa, __entry->val)
146); 146);
147 147
148#define kvm_fpu_load_symbol \
149 {0, "unload"}, \
150 {1, "load"}
151
152TRACE_EVENT(kvm_fpu,
153 TP_PROTO(int load),
154 TP_ARGS(load),
155
156 TP_STRUCT__entry(
157 __field( u32, load )
158 ),
159
160 TP_fast_assign(
161 __entry->load = load;
162 ),
163
164 TP_printk("%s", __print_symbolic(__entry->load, kvm_fpu_load_symbol))
165);
166
148#endif /* _TRACE_KVM_MAIN_H */ 167#endif /* _TRACE_KVM_MAIN_H */
149 168
150/* This part must be outside protection */ 169/* This part must be outside protection */