diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2014-12-16 09:08:16 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-01-08 16:48:01 -0500 |
commit | 6c19b7538f5ae2b6cdf91ab29f7fddf7320ece5b (patch) | |
tree | 895ff83a5ea372ff983d2458652f1995d06e6381 /arch | |
parent | d0659d946be05e098883b6955d2764595997f6a4 (diff) |
KVM: x86: add tracepoint to wait_lapic_expire
Add tracepoint to wait_lapic_expire.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
[Remind reader if early or late. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/lapic.c | 1 | ||||
-rw-r--r-- | arch/x86/kvm/trace.h | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index e1c0befaa9f6..3eb7f8d9992c 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c | |||
@@ -1134,6 +1134,7 @@ void wait_lapic_expire(struct kvm_vcpu *vcpu) | |||
1134 | tsc_deadline = apic->lapic_timer.expired_tscdeadline; | 1134 | tsc_deadline = apic->lapic_timer.expired_tscdeadline; |
1135 | apic->lapic_timer.expired_tscdeadline = 0; | 1135 | apic->lapic_timer.expired_tscdeadline = 0; |
1136 | guest_tsc = kvm_x86_ops->read_l1_tsc(vcpu, native_read_tsc()); | 1136 | guest_tsc = kvm_x86_ops->read_l1_tsc(vcpu, native_read_tsc()); |
1137 | trace_kvm_wait_lapic_expire(vcpu->vcpu_id, guest_tsc - tsc_deadline); | ||
1137 | 1138 | ||
1138 | /* __delay is delay_tsc whenever the hardware has TSC, thus always. */ | 1139 | /* __delay is delay_tsc whenever the hardware has TSC, thus always. */ |
1139 | if (guest_tsc < tsc_deadline) | 1140 | if (guest_tsc < tsc_deadline) |
diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h index c2a34bb5ad93..587149bd6f76 100644 --- a/arch/x86/kvm/trace.h +++ b/arch/x86/kvm/trace.h | |||
@@ -914,6 +914,26 @@ TRACE_EVENT(kvm_pvclock_update, | |||
914 | __entry->flags) | 914 | __entry->flags) |
915 | ); | 915 | ); |
916 | 916 | ||
917 | TRACE_EVENT(kvm_wait_lapic_expire, | ||
918 | TP_PROTO(unsigned int vcpu_id, s64 delta), | ||
919 | TP_ARGS(vcpu_id, delta), | ||
920 | |||
921 | TP_STRUCT__entry( | ||
922 | __field( unsigned int, vcpu_id ) | ||
923 | __field( s64, delta ) | ||
924 | ), | ||
925 | |||
926 | TP_fast_assign( | ||
927 | __entry->vcpu_id = vcpu_id; | ||
928 | __entry->delta = delta; | ||
929 | ), | ||
930 | |||
931 | TP_printk("vcpu %u: delta %lld (%s)", | ||
932 | __entry->vcpu_id, | ||
933 | __entry->delta, | ||
934 | __entry->delta < 0 ? "early" : "late") | ||
935 | ); | ||
936 | |||
917 | #endif /* _TRACE_KVM_H */ | 937 | #endif /* _TRACE_KVM_H */ |
918 | 938 | ||
919 | #undef TRACE_INCLUDE_PATH | 939 | #undef TRACE_INCLUDE_PATH |