Fix: x86 kvm mmutrace instrumentation for kernel < 3.6
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 10 May 2016 13:37:00 +0000 (09:37 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 10 May 2016 16:02:01 +0000 (12:02 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/arch/x86/kvm/mmutrace.h

index 165d7d6a7c798148706351a989d75a8a6728e561..2a4f887e29b06a1d415c36ba4b63c59090b1b216 100644 (file)
@@ -55,6 +55,7 @@
        { PFERR_RSVD_MASK, "RSVD" },    \
        { PFERR_FETCH_MASK, "F" }
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
 /*
  * A pagetable walk has started
  */
@@ -76,6 +77,31 @@ LTTNG_TRACEPOINT_EVENT(
        TP_printk("addr %llx pferr %x %s", __entry->addr, __entry->pferr,
                  __print_flags(__entry->pferr, "|", kvm_mmu_trace_pferr_flags))
 )
+#else /* #if (LINUX_VERSION_CODE >= 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_STRUCT__entry(
+               __field(__u64, addr)
+               __field(__u32, pferr)
+       ),
+
+       TP_fast_assign(
+               tp_assign(addr, addr)
+               tp_assign(pferr,
+                       (!!write_fault << 1) | (!!user_fault << 2)
+                       | (!!fetch_fault << 4))
+       ),
+
+       TP_printk("addr %llx pferr %x %s", __entry->addr, __entry->pferr,
+                 __print_flags(__entry->pferr, "|", kvm_mmu_trace_pferr_flags))
+)
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)) */
 
 
 /* We just walked a paging element */
This page took 0.031754 seconds and 4 git commands to generate.