Skip to contentSkip to conversation

Fix compilation on Linux kernel >= 3.17.0

PATCH New Mathieu Desnoyers 2 participants 3 messages Nov 12, 2014 – Nov 15, 2014 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

----- Original Message -----

Quoted 7 lines

From: "André Goddard Rosa" <[email protected]>
To: [email protected]
Sent: Saturday, November 8, 2014 6:17:16 PM
Subject: [lttng-dev] [PATCH lttng-modules] Fix compilation on Linux kernel >= 3.17.0

Since kernel commit 8a9522d2fe compilation fails as kvm_age_page tracepoint had its signature changed, so update it accordingly.

Hi André,

Can you double-check the kernel version you match there ?

It appears that commit 8a9522d2fe appeared within the 3.18-rc cycle. Therefore, I think you might want to change the version check for:

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0))

Can you verify this and submit an updated patch ?

Thanks,

Mathieu

Quoted 66 lines
---
 instrumentation/events/lttng-module/kvm.h | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 mode change 100644 => 100755 instrumentation/events/lttng-module/kvm.h
instrumentation/events/lttng-module/kvm.h +29 -1
old mode 100644
new mode 100755
index c0d42e2..42824be
@@ -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,17,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))
 
--

2.2.0.rc1

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Signature · 8 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#2 lore raw

PATCH 1/1 Fix compilation on Linux kernel >= 3.18.0

In reply to a message not in the archive

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
---
 instrumentation/events/lttng-module/kvm.h | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 mode change 100644 => 100755 instrumentation/events/lttng-module/kvm.h
instrumentation/events/lttng-module/kvm.h +29 -0
old mode 100644
new mode 100755
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))
 
Signature · 7 lines
2.1.3


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): [email protected]

author Applied
#4 lore raw

Re: [PATCH lttng-modules] Fix compilation on Linux kernel >= 3.18.0

Merged into master and stable-2.6, thanks!

Mathieu

----- Original Message -----

Quoted 77 lines

From: "André Goddard Rosa" <[email protected]>
To: [email protected]
Sent: Friday, November 14, 2014 6:33:02 AM
Subject: [lttng-dev] [PATCH lttng-modules] Fix compilation on Linux kernel >= 3.18.0

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
---
 instrumentation/events/lttng-module/kvm.h | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 mode change 100644 => 100755 instrumentation/events/lttng-module/kvm.h
instrumentation/events/lttng-module/kvm.h +29 -1
old mode 100644
new mode 100755
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))
 
--

2.1.3

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Signature · 8 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev