kvm: x86: Add APICv (de)activate request trace points
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Thu, 14 Nov 2019 20:15:07 +0000 (14:15 -0600)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 5 Feb 2020 14:17:41 +0000 (15:17 +0100)
Add trace points when sending request to (de)activate APICv.

Suggested-by: Alexander Graf <graf@amazon.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/trace.h
arch/x86/kvm/x86.c

index 7c741a0c5f808466354c7e786d81f2e6acdf12ee..f194dd0584703bc948ecccea2e7a108139d79dd6 100644 (file)
@@ -1291,6 +1291,25 @@ TRACE_EVENT(kvm_hv_stimer_cleanup,
                  __entry->vcpu_id, __entry->timer_index)
 );
 
+TRACE_EVENT(kvm_apicv_update_request,
+           TP_PROTO(bool activate, unsigned long bit),
+           TP_ARGS(activate, bit),
+
+       TP_STRUCT__entry(
+               __field(bool, activate)
+               __field(unsigned long, bit)
+       ),
+
+       TP_fast_assign(
+               __entry->activate = activate;
+               __entry->bit = bit;
+       ),
+
+       TP_printk("%s bit=%lu",
+                 __entry->activate ? "activate" : "deactivate",
+                 __entry->bit)
+);
+
 /*
  * Tracepoint for AMD AVIC
  */
index 616491c134aefb0c8a224d4ef2f3eb353baa1378..3ceb0bc7d3f2f2a6b9c5f688b7e28a4167ccbeb1 100644 (file)
@@ -8044,6 +8044,7 @@ void kvm_request_apicv_update(struct kvm *kvm, bool activate, ulong bit)
                        return;
        }
 
+       trace_kvm_apicv_update_request(activate, bit);
        kvm_make_all_cpus_request(kvm, KVM_REQ_APICV_UPDATE);
 }
 EXPORT_SYMBOL_GPL(kvm_request_apicv_update);
@@ -10503,3 +10504,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_pml_full);
 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_apicv_update_request);