Commit 6c19b753 authored by Marcelo Tosatti's avatar Marcelo Tosatti Committed by Paolo Bonzini

KVM: x86: add tracepoint to wait_lapic_expire

Add tracepoint to wait_lapic_expire.
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
[Remind reader if early or late. - Paolo]
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent d0659d94
...@@ -1134,6 +1134,7 @@ void wait_lapic_expire(struct kvm_vcpu *vcpu) ...@@ -1134,6 +1134,7 @@ void wait_lapic_expire(struct kvm_vcpu *vcpu)
tsc_deadline = apic->lapic_timer.expired_tscdeadline; tsc_deadline = apic->lapic_timer.expired_tscdeadline;
apic->lapic_timer.expired_tscdeadline = 0; apic->lapic_timer.expired_tscdeadline = 0;
guest_tsc = kvm_x86_ops->read_l1_tsc(vcpu, native_read_tsc()); guest_tsc = kvm_x86_ops->read_l1_tsc(vcpu, native_read_tsc());
trace_kvm_wait_lapic_expire(vcpu->vcpu_id, guest_tsc - tsc_deadline);
/* __delay is delay_tsc whenever the hardware has TSC, thus always. */ /* __delay is delay_tsc whenever the hardware has TSC, thus always. */
if (guest_tsc < tsc_deadline) if (guest_tsc < tsc_deadline)
......
...@@ -914,6 +914,26 @@ TRACE_EVENT(kvm_pvclock_update, ...@@ -914,6 +914,26 @@ TRACE_EVENT(kvm_pvclock_update,
__entry->flags) __entry->flags)
); );
TRACE_EVENT(kvm_wait_lapic_expire,
TP_PROTO(unsigned int vcpu_id, s64 delta),
TP_ARGS(vcpu_id, delta),
TP_STRUCT__entry(
__field( unsigned int, vcpu_id )
__field( s64, delta )
),
TP_fast_assign(
__entry->vcpu_id = vcpu_id;
__entry->delta = delta;
),
TP_printk("vcpu %u: delta %lld (%s)",
__entry->vcpu_id,
__entry->delta,
__entry->delta < 0 ? "early" : "late")
);
#endif /* _TRACE_KVM_H */ #endif /* _TRACE_KVM_H */
#undef TRACE_INCLUDE_PATH #undef TRACE_INCLUDE_PATH
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment