lkml.org 
[lkml]   [2019]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 05/16] kvm: x86: Add APICv activate/deactivate request trace points
Date
Add trace points when sending request to activate/deactivate APICv.

Suggested-by: Alexander Graf <graf@amazon.com>
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
arch/x86/kvm/trace.h | 30 ++++++++++++++++++++++++++++++
arch/x86/kvm/x86.c | 7 +++++++
2 files changed, 37 insertions(+)

diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h
index b5c831e..e3f745a 100644
--- a/arch/x86/kvm/trace.h
+++ b/arch/x86/kvm/trace.h
@@ -1297,6 +1297,36 @@
__entry->vcpu_id, __entry->timer_index)
);

+TRACE_EVENT(kvm_apicv_activate_request,
+ TP_PROTO(u32 vcpu),
+ TP_ARGS(vcpu),
+
+ TP_STRUCT__entry(__field(u32, vcpu)),
+
+ TP_fast_assign(__entry->vcpu = vcpu;),
+
+ TP_printk("vcpu=%u", __entry->vcpu)
+);
+
+TRACE_EVENT(kvm_apicv_deactivate_request,
+ TP_PROTO(u32 vcpu, bool disable),
+ TP_ARGS(vcpu, disable),
+
+ TP_STRUCT__entry(
+ __field(u32, vcpu)
+ __field(bool, disable)
+ ),
+
+ TP_fast_assign(
+ __entry->vcpu = vcpu;
+ __entry->disable = disable;
+ ),
+
+ TP_printk("vcpu=%u, disable=%s",
+ __entry->vcpu,
+ __entry->disable ? "disabled" : "suspended")
+);
+
/*
* Tracepoint for AMD AVIC
*/
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 446df2b..bc74876 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -7756,6 +7756,8 @@ void kvm_make_apicv_activate_request(struct kvm_vcpu *vcpu)
struct kvm_vcpu *v;
struct kvm *kvm = vcpu->kvm;

+ trace_kvm_apicv_activate_request(vcpu->vcpu_id);
+
mutex_lock(&kvm->arch.apicv_lock);
if (kvm->arch.apicv_state != APICV_SUSPENDED) {
mutex_unlock(&kvm->arch.apicv_lock);
@@ -7782,6 +7784,8 @@ void kvm_make_apicv_deactivate_request(struct kvm_vcpu *vcpu, bool disable)
struct kvm_vcpu *v;
struct kvm *kvm = vcpu->kvm;

+ trace_kvm_apicv_deactivate_request(vcpu->vcpu_id, disable);
+
mutex_lock(&kvm->arch.apicv_lock);
if (kvm->arch.apicv_state != APICV_ACTIVATED) {
mutex_unlock(&kvm->arch.apicv_lock);
@@ -10194,3 +10198,6 @@ bool kvm_arch_no_poll(struct kvm_vcpu *vcpu)
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_activate_request);
+EXPORT_TRACEPOINT_SYMBOL_GPL(kvm_apicv_deactivate_request);
+
--
1.8.3.1
\
 
 \ /
  Last update: 2019-09-13 21:02    [W:0.208 / U:2.584 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site