[RFC PATCH 4/4] KVM: arm64: Add trace for TWED update
Jingyi Wang
wangjingyi11 at huawei.com
Tue Sep 29 05:17:27 EDT 2020
From: Zengruan Ye <yezengruan at huawei.com>
Add tracepoints for TWE delay value update
Signed-off-by: Zengruan Ye <yezengruan at huawei.com>
Signed-off-by: Jingyi Wang <wangjingyi11 at huawei.com>
---
arch/arm64/kvm/arm.c | 4 ++++
arch/arm64/kvm/trace_arm.h | 21 +++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index 989bffdcb3e9..c3d7a326bf1b 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -80,6 +80,8 @@ void grow_twed(struct kvm_vcpu *vcpu)
vcpu->arch.twed += 1;
vcpu->arch.twed_dirty = true;
}
+
+ trace_kvm_twed_update(vcpu->vcpu_id, vcpu->arch.twed, old);
}
void shrink_twed(struct kvm_vcpu *vcpu)
@@ -90,6 +92,8 @@ void shrink_twed(struct kvm_vcpu *vcpu)
vcpu->arch.twed -= 1;
vcpu->arch.twed_dirty = true;
}
+
+ trace_kvm_twed_update(vcpu->vcpu_id, vcpu->arch.twed, old);
}
#endif
diff --git a/arch/arm64/kvm/trace_arm.h b/arch/arm64/kvm/trace_arm.h
index ff0444352bba..5081266399e8 100644
--- a/arch/arm64/kvm/trace_arm.h
+++ b/arch/arm64/kvm/trace_arm.h
@@ -367,6 +367,27 @@ TRACE_EVENT(kvm_timer_emulate,
__entry->timer_idx, __entry->should_fire)
);
+TRACE_EVENT(kvm_twed_update,
+ TP_PROTO(unsigned int vcpu_id, unsigned int new, unsigned int old),
+ TP_ARGS(vcpu_id, new, old),
+
+ TP_STRUCT__entry(
+ __field( unsigned int, vcpu_id )
+ __field( unsigned int, new )
+ __field( unsigned int, old )
+ ),
+
+ TP_fast_assign(
+ __entry->vcpu_id = vcpu_id;
+ __entry->new = new;
+ __entry->old = old;
+ ),
+
+ TP_printk("vcpu %u old %u new %u (%s)",
+ __entry->vcpu_id, __entry->old, __entry->new,
+ __entry->old < __entry->new ? "growed" : "shrinked")
+);
+
#endif /* _TRACE_ARM_ARM64_KVM_H */
#undef TRACE_INCLUDE_PATH
--
2.19.1
More information about the linux-arm-kernel
mailing list