Skip to contentSkip to conversation

Fix compilation for 3.0 kernels that are named 2.6.40

PATCH New Simon Marchi 2 participants 3 messages Nov 23, 2012 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

PATCH 2/2 Fix compilation for 3.0 kernels that are named 2.6.40

Since some distro released the 3.0 kernel as 2.6.40, it might be useful to adjust some checks to treat 2.6.40 kernels as 3.0.

---
 instrumentation/events/lttng-module/net.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
instrumentation/events/lttng-module/net.h +3 -3
index a444b07..e552cf7 100644
@@ -12,7 +12,7 @@
 
 TRACE_EVENT(net_dev_xmit,
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,40))
 	TP_PROTO(struct sk_buff *skb,
 		 int rc,
 		 struct net_device *dev,
@@ -30,14 +30,14 @@ TRACE_EVENT(net_dev_xmit,
 		__field(	void *,		skbaddr		)
 		__field(	unsigned int,	len		)
 		__field(	int,		rc		)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,40))
 		__string(	name,		dev->name	)
 #else
 		__string(	name,		skb->dev->name	)
 #endif
 	),
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,40))
 	TP_fast_assign(
 		tp_assign(skbaddr, skb)
 		tp_assign(len, skb_len)
Signature · 1 line
1.7.1
#2 lore raw

Re: [PATCH lttng-modules 1/2] Fix compilation for 3.0 branch (>= 3.0.39).

In reply to a message not in the archive
Quoted 3 lines · * Simon Marchi ([email protected]) wrote:

The isolate_mode_t type that appeared in 3.2 was backported to 3.0.39 so the version check must be fixed. It was not backported to the 3.1 branch though, so it must be excluded.

Merged, thanks!

Mathieu

Quoted 37 lines
---
 probes/lttng-probe-vmscan.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
probes/lttng-probe-vmscan.c +4 -1
index 2abd0e4..0205c7e 100644
@@ -30,6 +30,8 @@
  */
 #include <trace/events/vmscan.h>
 
+#include "../lttng-kernel-version.h"
+
 /*
  * Create LTTng tracepoint probes.
  */
@@ -37,7 +39,8 @@
 #define CREATE_TRACE_POINTS
 #define TRACE_INCLUDE_PATH ../instrumentation/events/lttng-module
 
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0))
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(3,0,38)) || \
+	LTTNG_KERNEL_RANGE(3,1,0, 3,1,10)
 typedef int isolate_mode_t;
 #endif
 
Signature · 7 lines
1.7.1


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 4 lines
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com

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

#4 lore raw
Quoted 2 lines · * Simon Marchi ([email protected]) wrote:

Since some distro released the 3.0 kernel as 2.6.40, it might be useful to adjust some checks to treat 2.6.40 kernels as 3.0.

merged, thanks!

Mathieu

Quoted 44 lines
---
 instrumentation/events/lttng-module/net.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
instrumentation/events/lttng-module/net.h +3 -3
index a444b07..e552cf7 100644
@@ -12,7 +12,7 @@
 
 TRACE_EVENT(net_dev_xmit,
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,40))
 	TP_PROTO(struct sk_buff *skb,
 		 int rc,
 		 struct net_device *dev,
@@ -30,14 +30,14 @@ TRACE_EVENT(net_dev_xmit,
 		__field(	void *,		skbaddr		)
 		__field(	unsigned int,	len		)
 		__field(	int,		rc		)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,40))
 		__string(	name,		dev->name	)
 #else
 		__string(	name,		skb->dev->name	)
 #endif
 	),
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,40))
 	TP_fast_assign(
 		tp_assign(skbaddr, skb)
 		tp_assign(len, skb_len)
Signature · 7 lines
1.7.1


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 4 lines
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com