Fix: x86 mmutrace event extra field for kernels >= 3.11
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 27 Apr 2015 21:32:54 +0000 (17:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 27 Apr 2015 21:40:47 +0000 (17:40 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h

index 2b71d44136b9d699e3c5a71d5d5791f627723d66..918622ccccdb7530f1d400829300010df499b130 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "../../../../../../probes/lttng-tracepoint-event.h"
 #include <linux/ftrace_event.h>
+#include <linux/version.h>
 
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM kvmmmu
@@ -195,6 +196,33 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(kvm_mmu_page_class, kvm_mmu_prepare_zap_page,
        TP_ARGS(sp)
 )
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
+
+LTTNG_TRACEPOINT_EVENT(
+       mark_mmio_spte,
+       TP_PROTO(u64 *sptep, gfn_t gfn, unsigned access, unsigned int gen),
+       TP_ARGS(sptep, gfn, access, gen),
+
+       TP_STRUCT__entry(
+               __field(void *, sptep)
+               __field(gfn_t, gfn)
+               __field(unsigned, access)
+               __field(unsigned int, gen)
+       ),
+
+       TP_fast_assign(
+               tp_assign(sptep, sptep)
+               tp_assign(gfn, gfn)
+               tp_assign(access, access)
+               tp_assign(gen, gen)
+       ),
+
+       TP_printk("sptep:%p gfn %llx access %x", __entry->sptep, __entry->gfn,
+                 __entry->access)
+)
+
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */
+
 LTTNG_TRACEPOINT_EVENT(
        mark_mmio_spte,
        TP_PROTO(u64 *sptep, gfn_t gfn, unsigned access),
@@ -216,6 +244,8 @@ LTTNG_TRACEPOINT_EVENT(
                  __entry->access)
 )
 
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)) */
+
 LTTNG_TRACEPOINT_EVENT(
        handle_mmio_page_fault,
        TP_PROTO(u64 addr, gfn_t gfn, unsigned access),
This page took 0.026345 seconds and 4 git commands to generate.