Skip to contentSkip to conversation

Fix: sched instrumentation for 4.1-rt11

PATCH New Michael Jeanson 2 participants 2 messages Feb 5, 2016 1 message 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: sched instrumentation for 4.1-rt11

---
 instrumentation/events/lttng-module/sched.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
instrumentation/events/lttng-module/sched.h +4 -2
index 4f3676b..116d65e 100644
@@ -145,7 +145,8 @@ LTTNG_TRACEPOINT_EVENT(sched_kthread_stop_ret,
 /*
  * Tracepoint for waking up a task:
  */
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) || \
+	LTTNG_RT_KERNEL_RANGE(4,1,10,11, 4,2,0,0))
 LTTNG_TRACEPOINT_EVENT_CLASS(sched_wakeup_template,
 
 	TP_PROTO(struct task_struct *p),
@@ -184,7 +185,8 @@ LTTNG_TRACEPOINT_EVENT_CLASS(sched_wakeup_template,
 )
 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)) */
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) || \
+	LTTNG_RT_KERNEL_RANGE(4,1,10,11, 4,2,0,0))
 
 /*
  * Tracepoint called when waking a task; this tracepoint is guaranteed to be
Signature · 1 line
2.7.0
#2 lore raw

Re: [PATCH lttng-modules 1/2] Add RT patch version macros

In reply to a message not in the archive

Both patches merged, thanks!

Mathieu

Quoted 86 lines · ----- On Feb 5, 2016, at 5:53 PM, Michael Jeanson [email protected] wrote:

---

Makefile.ABI.workarounds |  8 +++++++-
lttng-kernel-version.h   | 17 +++++++++++++++++
rt-patch-version.sh      | 25 +++++++++++++++++++++++++
3 files changed, 49 insertions(+), 1 deletion(-)

create mode 100755 rt-patch-version.sh

Makefile.ABI.workarounds +1 -1
index d553ee4..e8cf520 100644
@@ -4,8 +4,14 @@
 # the kernel EXTRAVERSION to figure it out. Translate this information
 # into a define visible from the C preprocessor.
 
-DEB_API_VERSION=$(shell $(MAKEFILEDIR)/abi-debian-version.sh $(KERNELDIR))
+DEB_API_VERSION:=$(shell $(MAKEFILEDIR)/abi-debian-version.sh $(KERNELDIR))
 
 ifneq ($(DEB_API_VERSION), 0)
  ccflags-y += -DDEBIAN_API_VERSION=$(DEB_API_VERSION)

endif

Makefile.ABI.workarounds +6 -0
+
+RT_PATCH_VERSION:=$(shell $(MAKEFILEDIR)/rt-patch-version.sh $(KERNELDIR))
+
+ifneq ($(RT_PATCH_VERSION), 0)
+  ccflags-y += -DRT_PATCH_VERSION=$(RT_PATCH_VERSION)
+endif
lttng-kernel-version.h +17 -0
index f98a192..ac61739 100644
@@ -90,4 +90,21 @@
 		LTTNG_RHEL_VERSION_CODE < \
 		LTTNG_RHEL_KERNEL_VERSION(a_high, b_high, c_high, d_high, e_high))
 
+#define LTTNG_RT_KERNEL_VERSION(a, b, c, d) \
+	(((a) << 24) + ((b) << 16) + ((c) << 8) + (d))
+
+#ifdef RT_PATCH_VERSION
+#define LTTNG_RT_VERSION_CODE \
+	((LINUX_VERSION_CODE << 8) + RT_PATCH_VERSION)
+#else
+#define LTTNG_RT_VERSION_CODE 	0
+#endif
+
+#define LTTNG_RT_KERNEL_RANGE(a_low, b_low, c_low, d_low, \
+		a_high, b_high, c_high, d_high) \
+	(LTTNG_RT_VERSION_CODE >= \
+		LTTNG_RT_KERNEL_VERSION(a_low, b_low, c_low, d_low) && \
+		LTTNG_RT_VERSION_CODE < \
+		LTTNG_RT_KERNEL_VERSION(a_high, b_high, c_high, d_high))
+
 #endif /* _LTTNG_KERNEL_VERSION_H */
rt-patch-version.sh new file +25 -1
new file mode 100755
index 0000000..89c7755
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# First argument is the path to the kernel headers.
+KPATH=$1
+
+VERSIONFILE=""
+
+if [ -f "${KPATH}/localversion-rt" ]; then
+	VERSIONFILE="${KPATH}/localversion-rt"
+
+elif [ -f "${KPATH}/source/localversion-rt" ]; then
+	VERSIONFILE="${KPATH}/source/localversion-rt"
+else
+	echo 0
+	exit 0
+fi
+
+RT_PATCH_VERSION=$(sed -rn 's/^-rt([0-9]+)$/\1/p' "${VERSIONFILE}")
+
+if [ "x${RT_PATCH_VERSION}" = "x" ]; then
+	echo 0
+	exit 0
+fi
+
+echo ${RT_PATCH_VERSION}
--

2.7.0

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