KVM: SVM: Introduce trace point for the slow-path of avic_kic_target_vcpus
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Wed, 20 Apr 2022 15:49:54 +0000 (10:49 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 29 Apr 2022 16:50:00 +0000 (12:50 -0400)
This can help identify potential performance issues when handles
AVIC incomplete IPI due vCPU not running.

Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220420154954.19305-3-suravee.suthikulpanit@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/avic.c
arch/x86/kvm/trace.h
arch/x86/kvm/x86.c

index 7249d76..54fe037 100644 (file)
@@ -354,6 +354,8 @@ static void avic_kick_target_vcpus(struct kvm *kvm, struct kvm_lapic *source,
        if (!avic_kick_target_vcpus_fast(kvm, source, icrl, icrh, index))
                return;
 
+       trace_kvm_avic_kick_vcpu_slowpath(icrh, icrl, index);
+
        /*
         * Wake any target vCPUs that are blocking, i.e. waiting for a wake
         * event.  There's no need to signal doorbells, as hardware has handled
index e3a24b8..de47625 100644 (file)
@@ -1459,6 +1459,26 @@ TRACE_EVENT(kvm_avic_ga_log,
                  __entry->vmid, __entry->vcpuid)
 );
 
+TRACE_EVENT(kvm_avic_kick_vcpu_slowpath,
+           TP_PROTO(u32 icrh, u32 icrl, u32 index),
+           TP_ARGS(icrh, icrl, index),
+
+       TP_STRUCT__entry(
+               __field(u32, icrh)
+               __field(u32, icrl)
+               __field(u32, index)
+       ),
+
+       TP_fast_assign(
+               __entry->icrh = icrh;
+               __entry->icrl = icrl;
+               __entry->index = index;
+       ),
+
+       TP_printk("icrh:icrl=%#08x:%08x, index=%u",
+                 __entry->icrh, __entry->icrl, __entry->index)
+);
+
 TRACE_EVENT(kvm_hv_timer_state,
                TP_PROTO(unsigned int vcpu_id, unsigned int hv_timer_in_use),
                TP_ARGS(vcpu_id, hv_timer_in_use),
index ee774c7..1abce22 100644 (file)
@@ -13072,6 +13072,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_pi_irte_update);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_avic_unaccelerated_access);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_avic_incomplete_ipi);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_avic_ga_log);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_avic_kick_vcpu_slowpath);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_apicv_accept_irq);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_vmgexit_enter);
 EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_vmgexit_exit);