#include <lttng/tracepoint-event.h>
#include <lttng/kernel-version.h>
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0))
#include <linux/trace_events.h>
-#else /* if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) */
-#include <linux/ftrace_event.h>
-#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,2,0)) */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM kvm_mmu
ctf_integer(__u32, root_count, (sp)->root_count) \
ctf_integer(bool, unsync, (sp)->unsync)
-#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0))
+#else
#define LTTNG_KVM_MMU_PAGE_FIELDS \
ctf_integer(unsigned long, mmu_valid_gen, (sp)->mmu_valid_gen) \
ctf_integer(__u32, root_count, (sp)->root_count) \
ctf_integer(bool, unsync, (sp)->unsync)
-#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) */
-
-#define LTTNG_KVM_MMU_PAGE_FIELDS \
- ctf_integer(__u64, gfn, (sp)->gfn) \
- ctf_integer(__u32, role, (sp)->role.word) \
- ctf_integer(__u32, root_count, (sp)->root_count) \
- ctf_integer(bool, unsync, (sp)->unsync)
-
-#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) */
+#endif
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,6,0))
/*
* A pagetable walk has started
*/
ctf_integer(__u32, pferr, pferr)
)
)
-#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,6,0)) */
-/*
- * A pagetable walk has started
- */
-LTTNG_TRACEPOINT_EVENT(
- kvm_mmu_pagetable_walk,
- TP_PROTO(u64 addr, int write_fault, int user_fault, int fetch_fault),
- TP_ARGS(addr, write_fault, user_fault, fetch_fault),
-
- TP_FIELDS(
- ctf_integer_hex(__u64, addr, addr)
- ctf_integer(__u32, pferr,
- (!!write_fault << 1) | (!!user_fault << 2)
- | (!!fetch_fault << 4))
- )
-)
-#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,6,0)) */
/* We just walked a paging element */
LTTNG_TRACEPOINT_EVENT(
)
)
-#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0))
+#else
LTTNG_TRACEPOINT_EVENT_MAP(
mark_mmio_spte,
ctf_integer(unsigned int, gen, gen)
)
)
-
-#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) */
-
-LTTNG_TRACEPOINT_EVENT_MAP(
- mark_mmio_spte,
-
- kvm_mmu_mark_mmio_spte,
-
- TP_PROTO(u64 *sptep, gfn_t gfn, unsigned access),
- TP_ARGS(sptep, gfn, access),
-
- TP_FIELDS(
- ctf_integer_hex(void *, sptep, sptep)
- ctf_integer(gfn_t, gfn, gfn)
- ctf_integer(unsigned, access, access)
- )
-)
-
-#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0)) */
+#endif
LTTNG_TRACEPOINT_EVENT_MAP(
handle_mmio_page_fault,
#include <lttng/tracepoint-event.h>
#include <asm/vmx.h>
#include <asm/svm.h>
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
#include <asm/clocksource.h>
-#endif
#include <lttng/kernel-version.h>
#include <wrapper/kvm-x86.h>
#include <../arch/x86/kvm/lapic.h>
TP_ARGS(vcpu, failed),
TP_FIELDS(
-#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,1,0))
- ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt.decode.fetch.start)
- ctf_integer(__u32, csbase, kvm_x86_ops->get_segment_base(vcpu, VCPU_SREG_CS))
- ctf_integer(__u8, len, vcpu->arch.emulate_ctxt.decode.eip
- - vcpu->arch.emulate_ctxt.decode.fetch.start)
- ctf_array(__u8, insn, vcpu->arch.emulate_ctxt.decode.fetch.data, 15)
- ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt.mode))
-#elif (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,17,0))
- ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt.fetch.start)
- ctf_integer(__u32, csbase, kvm_x86_ops->get_segment_base(vcpu, VCPU_SREG_CS))
- ctf_integer(__u8, len, vcpu->arch.emulate_ctxt._eip
- - vcpu->arch.emulate_ctxt.fetch.start)
- ctf_array(__u8, insn, vcpu->arch.emulate_ctxt.fetch.data, 15)
- ctf_integer(__u8, flags, kei_decode_mode(vcpu->arch.emulate_ctxt.mode))
-#elif (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(5,7,0))
+#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(5,7,0))
ctf_integer(__u64, rip, vcpu->arch.emulate_ctxt._eip -
(vcpu->arch.emulate_ctxt.fetch.ptr -
vcpu->arch.emulate_ctxt.fetch.data))
)
)
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,11,0))
LTTNG_TRACEPOINT_EVENT_MAP(kvm_write_tsc_offset, kvm_x86_write_tsc_offset,
TP_PROTO(unsigned int vcpu_id, __u64 previous_tsc_offset,
__u64 next_tsc_offset),
ctf_integer(__u64, next_tsc_offset, next_tsc_offset)
)
)
-#endif
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
#ifdef CONFIG_X86_64
LTTNG_TRACEPOINT_EVENT_MAP(kvm_update_master_clock, kvm_x86_update_master_clock,
)
#endif /* CONFIG_X86_64 */
-#endif /* LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0) */
#endif /* LTTNG_TRACE_KVM_H */
)
)
-#if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,6,0))
#if defined(__KVM_HAVE_IOAPIC)
-#undef __KVM_HAVE_IRQ_LINE
-#define __KVM_HAVE_IRQ_LINE
-#endif
-#endif
-
-#if defined(__KVM_HAVE_IRQ_LINE)
LTTNG_TRACEPOINT_EVENT(kvm_set_irq,
TP_PROTO(unsigned int gsi, int level, int irq_source_id),
TP_ARGS(gsi, level, irq_source_id),
ctf_integer(int, irq_source_id, irq_source_id)
)
)
-#endif
-
-#if defined(__KVM_HAVE_IOAPIC)
LTTNG_TRACEPOINT_EVENT(kvm_ioapic_set_irq,
TP_PROTO(__u64 e, int pin, bool coalesced),
|| LTTNG_DEBIAN_KERNEL_RANGE(4,14,13,0,1,0, 4,15,0,0,0,0) \
|| LTTNG_KERNEL_RANGE(4,9,77, 4,10,0) \
|| LTTNG_KERNEL_RANGE(4,4,112, 4,5,0) \
- || LTTNG_KERNEL_RANGE(4,1,50, 4,2,0) \
- || LTTNG_KERNEL_RANGE(3,16,52, 3,17,0) \
- || LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,144, 3,14,0,0) \
- || LTTNG_KERNEL_RANGE(3,2,97, 3,3,0) \
|| LTTNG_UBUNTU_KERNEL_RANGE(4,13,16,38, 4,14,0,0) \
|| LTTNG_DEBIAN_KERNEL_RANGE(4,9,65,0,3,0, 4,10,0,0,0,0) \
|| LTTNG_FEDORA_KERNEL_RANGE(4,14,13,300, 4,15,0,0))
)
)
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,18,0) \
- || LTTNG_RHEL_KERNEL_RANGE(3,10,0,327,0,0, 3,11,0,0,0,0))
-
LTTNG_TRACEPOINT_EVENT(kvm_age_page,
TP_PROTO(ulong gfn, int level, struct kvm_memory_slot *slot, int ref),
TP_ARGS(gfn, level, slot, ref),
)
)
-#else
-
-LTTNG_TRACEPOINT_EVENT(kvm_age_page,
- TP_PROTO(ulong hva, struct kvm_memory_slot *slot, int ref),
- TP_ARGS(hva, slot, ref),
-
- TP_FIELDS(
- ctf_integer(u64, hva, hva)
- ctf_integer(u64, gfn,
- slot->base_gfn + ((hva - slot->userspace_addr) >> PAGE_SHIFT))
- ctf_integer(u8, referenced, ref)
- )
-)
-#endif
-
#ifdef CONFIG_KVM_ASYNC_PF
LTTNG_TRACEPOINT_EVENT_CLASS(kvm_async_get_page_class,
TP_ARGS(token, gva)
)
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,13,0) \
- || LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,0,0, 3,11,0,0,0,0))
-
LTTNG_TRACEPOINT_EVENT(
kvm_async_pf_completed,
TP_PROTO(unsigned long address, u64 gva),
)
)
-#else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,13,0)) */
-
-LTTNG_TRACEPOINT_EVENT(
- kvm_async_pf_completed,
- TP_PROTO(unsigned long address, struct page *page, u64 gva),
- TP_ARGS(address, page, gva),
-
- TP_FIELDS(
- ctf_integer_hex(unsigned long, address, address)
- ctf_integer(pfn_t, pfn, page ? page_to_pfn(page) : 0)
- ctf_integer(u64, gva, gva)
- )
-)
-
-#endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,13,0)) */
-
#endif
#endif /* LTTNG_TRACE_KVM_MAIN_H */