#include <linux/tracepoint.h>
#include <asm/vmx.h>
#include <asm/svm.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
#include <asm/clocksource.h>
+#endif
#include <linux/version.h>
#include <../arch/x86/kvm/lapic.h>
#include <../arch/x86/kvm/kvm_cache_regs.h>
),
TP_fast_assign(
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
+ tp_assign(rip, vcpu->arch.emulate_ctxt.decode.fetch.start)
+ tp_assign(csbase, kvm_x86_ops->get_segment_base(vcpu, VCPU_SREG_CS))
+ tp_assign(len, vcpu->arch.emulate_ctxt.decode.eip
+ - vcpu->arch.emulate_ctxt.decode.fetch.start)
+ tp_memcpy(insn,
+ vcpu->arch.emulate_ctxt.decode.fetch.data,
+ 15)
+#else
tp_assign(rip, vcpu->arch.emulate_ctxt.fetch.start)
- tp_assign(csbase, kvm_x86_ops->get_segment_base(vcpu, VCPU_SREG_CS))
+ tp_assign(csbase, kvm_x86_ops->get_segment_base(vcpu, VCPU_SREG_CS))
tp_assign(len, vcpu->arch.emulate_ctxt._eip
- vcpu->arch.emulate_ctxt.fetch.start)
tp_memcpy(insn,
vcpu->arch.emulate_ctxt.fetch.data,
15)
+#endif
tp_assign(flags, kei_decode_mode(vcpu->arch.emulate_ctxt.mode))
tp_assign(failed, failed)
),
__entry->gpa_match ? "GPA" : "GVA")
)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
+TRACE_EVENT(kvm_write_tsc_offset,
+ TP_PROTO(unsigned int vcpu_id, __u64 previous_tsc_offset,
+ __u64 next_tsc_offset),
+ TP_ARGS(vcpu_id, previous_tsc_offset, next_tsc_offset),
+
+ TP_STRUCT__entry(
+ __field( unsigned int, vcpu_id )
+ __field( __u64, previous_tsc_offset )
+ __field( __u64, next_tsc_offset )
+ ),
+
+ TP_fast_assign(
+ tp_assign(vcpu_id, vcpu_id)
+ tp_assign(previous_tsc_offset, previous_tsc_offset)
+ tp_assign(next_tsc_offset, next_tsc_offset)
+ ),
+
+ TP_printk("vcpu=%u prev=%llu next=%llu", __entry->vcpu_id,
+ __entry->previous_tsc_offset, __entry->next_tsc_offset)
+)
+#endif
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
#ifdef CONFIG_X86_64
#define host_clocks \
)
#endif /* CONFIG_X86_64 */
+#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0) */
#endif /* _TRACE_KVM_H */