KVM: SVM: Add tracepoint for #vmexit because intr pending
authorJoerg Roedel <joerg.roedel@amd.com>
Fri, 9 Oct 2009 14:08:30 +0000 (16:08 +0200)
committerAvi Kivity <avi@redhat.com>
Thu, 3 Dec 2009 07:32:16 +0000 (09:32 +0200)
This patch adds a special tracepoint for the event that a
nested #vmexit is injected because kvm wants to inject an
interrupt into the guest.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/svm.c
arch/x86/kvm/trace.h
arch/x86/kvm/x86.c

index 369eeb86e87cf446e7c172e27f2d172a702da721..78a391c60a752dcb34c65af8b75c513ad2035a6d 100644 (file)
@@ -1390,7 +1390,7 @@ static inline int nested_svm_intr(struct vcpu_svm *svm)
                 * the #vmexit here.
                 */
                svm->nested.exit_required = true;
-               nsvm_printk("VMexit -> INTR\n");
+               trace_kvm_nested_intr_vmexit(svm->vmcb->save.rip);
                return 1;
        }
 
index 4d6bb5ee39b54b6ee597d4f01b1d468ee004e3ff..3cc8f444be14393743379594e2047c7aedc7b692 100644 (file)
@@ -451,6 +451,24 @@ TRACE_EVENT(kvm_nested_vmexit_inject,
                __entry->exit_info1, __entry->exit_info2,
                __entry->exit_int_info, __entry->exit_int_info_err)
 );
+
+/*
+ * Tracepoint for nested #vmexit because of interrupt pending
+ */
+TRACE_EVENT(kvm_nested_intr_vmexit,
+           TP_PROTO(__u64 rip),
+           TP_ARGS(rip),
+
+       TP_STRUCT__entry(
+               __field(        __u64,  rip     )
+       ),
+
+       TP_fast_assign(
+               __entry->rip    =       rip
+       ),
+
+       TP_printk("rip: 0x%016llx\n", __entry->rip)
+);
 #endif /* _TRACE_KVM_H */
 
 /* This part must be outside protection */
index a522d9ba81b32a69e33999e66ccf64416574e1a0..2cf4146b425a8f63e9152b98461c814e642448fa 100644 (file)
@@ -4987,3 +4987,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_cr);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmrun);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmexit);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_vmexit_inject);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_nested_intr_vmexit);