X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=instrumentation%2Fevents%2Flttng-module%2Fkvm.h;h=ba4e528dea47be8cfa4174ad7eaa1c302e7156b8;hb=9a6800e3a7bed25af7a62d7e8cb2ad9a689e5877;hp=e10455bc8cf8cd496d7d66e931450e52ed37b586;hpb=5b88d86e2d45fed6d405fd9fb72d6c1c22d35374;p=lttng-modules.git diff --git a/instrumentation/events/lttng-module/kvm.h b/instrumentation/events/lttng-module/kvm.h index e10455bc..ba4e528d 100644 --- a/instrumentation/events/lttng-module/kvm.h +++ b/instrumentation/events/lttng-module/kvm.h @@ -2,12 +2,37 @@ #define _TRACE_KVM_MAIN_H #include +#include #undef TRACE_SYSTEM #define TRACE_SYSTEM kvm +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) + #define ERSN(x) { KVM_EXIT_##x, "KVM_EXIT_" #x } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) + +#define kvm_trace_exit_reason \ + ERSN(UNKNOWN), ERSN(EXCEPTION), ERSN(IO), ERSN(HYPERCALL), \ + ERSN(DEBUG), ERSN(HLT), ERSN(MMIO), ERSN(IRQ_WINDOW_OPEN), \ + ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ + ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ + ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \ + ERSN(S390_UCONTROL), ERSN(WATCHDOG), ERSN(S390_TSCH) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) + +#define kvm_trace_exit_reason \ + ERSN(UNKNOWN), ERSN(EXCEPTION), ERSN(IO), ERSN(HYPERCALL), \ + ERSN(DEBUG), ERSN(HLT), ERSN(MMIO), ERSN(IRQ_WINDOW_OPEN), \ + ERSN(SHUTDOWN), ERSN(FAIL_ENTRY), ERSN(INTR), ERSN(SET_TPR), \ + ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ + ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI), ERSN(PAPR_HCALL), \ + ERSN(S390_UCONTROL) + +#else + #define kvm_trace_exit_reason \ ERSN(UNKNOWN), ERSN(EXCEPTION), ERSN(IO), ERSN(HYPERCALL), \ ERSN(DEBUG), ERSN(HLT), ERSN(MMIO), ERSN(IRQ_WINDOW_OPEN), \ @@ -15,6 +40,8 @@ ERSN(TPR_ACCESS), ERSN(S390_SIEIC), ERSN(S390_RESET), ERSN(DCR),\ ERSN(NMI), ERSN(INTERNAL_ERROR), ERSN(OSI) +#endif + TRACE_EVENT(kvm_userspace_exit, TP_PROTO(__u32 reason, int errno), TP_ARGS(reason, errno), @@ -35,8 +62,16 @@ TRACE_EVENT(kvm_userspace_exit, __print_symbolic(__entry->reason, kvm_trace_exit_reason), __entry->errno < 0 ? -__entry->errno : __entry->reason) ) +#endif +#if (LINUX_VERSION_CODE < 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) TRACE_EVENT(kvm_set_irq, TP_PROTO(unsigned int gsi, int level, int irq_source_id), TP_ARGS(gsi, level, irq_source_id), @@ -56,7 +91,9 @@ TRACE_EVENT(kvm_set_irq, TP_printk("gsi %u level %d source %d", __entry->gsi, __entry->level, __entry->irq_source_id) ) +#endif +#if defined(__KVM_HAVE_IOAPIC) #define kvm_deliver_mode \ {0x0, "Fixed"}, \ {0x1, "LowPrio"}, \ @@ -174,6 +211,8 @@ TRACE_EVENT(kvm_mmio, __entry->len, __entry->gpa, __entry->val) ) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)) + #define kvm_fpu_load_symbol \ {0, "unload"}, \ {1, "load"} @@ -214,6 +253,9 @@ TRACE_EVENT(kvm_age_page, __entry->hva, __entry->gfn, __entry->referenced ? "YOUNG" : "OLD") ) +#endif + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) #ifdef CONFIG_KVM_ASYNC_PF DECLARE_EVENT_CLASS(kvm_async_get_page_class, @@ -306,6 +348,8 @@ TRACE_EVENT( #endif +#endif + #endif /* _TRACE_KVM_MAIN_H */ /* This part must be outside protection */