Fix compilation on Linux kernel >= 3.18.0
authorAndré Goddard Rosa <andre.goddard@gmail.com>
Fri, 14 Nov 2014 05:33:02 +0000 (21:33 -0800)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sat, 15 Nov 2014 18:41:31 +0000 (19:41 +0100)
Since kernel commit 8a9522d2fe compilation fails as kvm_age_page
tracepoint had its signature changed, so update it accordingly.

Tested pointing to kernels:
    git reset --hard v3.17; make init/version.o
    git reset --hard v3.18-rc1; make init/version.o

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/kvm.h [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index c0d42e2..4f95095
@@ -232,6 +232,34 @@ LTTNG_TRACEPOINT_EVENT(kvm_fpu,
        TP_printk("%s", __print_symbolic(__entry->load, kvm_fpu_load_symbol))
 )
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,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),
+
+       TP_STRUCT__entry(
+               __field(        u64,    hva             )
+               __field(        u64,    gfn             )
+               __field(        u8,     level           )
+               __field(        u8,     referenced      )
+       ),
+
+       TP_fast_assign(
+               tp_assign(gfn, gfn)
+               tp_assign(level, level)
+               tp_assign(hva, ((gfn - slot->base_gfn) <<
+                       PAGE_SHIFT) + slot->userspace_addr)
+               tp_assign(referenced, ref)
+       ),
+
+       TP_printk("hva %llx gfn %llx level %u %s",
+               __entry->hva, __entry->gfn, __entry->level,
+               __entry->referenced ? "YOUNG" : "OLD")
+)
+
+#else
+
 LTTNG_TRACEPOINT_EVENT(kvm_age_page,
        TP_PROTO(ulong hva, struct kvm_memory_slot *slot, int ref),
        TP_ARGS(hva, slot, ref),
@@ -254,6 +282,7 @@ LTTNG_TRACEPOINT_EVENT(kvm_age_page,
                  __entry->referenced ? "YOUNG" : "OLD")
 )
 #endif
+#endif
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
 
This page took 0.028418 seconds and 4 git commands to generate.