Skip to contentSkip to conversation

Fix: update sched instrumentation for kernel 4.4.0

PATCH New Michael Jeanson 2 participants 3 messages May 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 1/2 Fix: update sched instrumentation for kernel 4.4.0

From: Mathieu Desnoyers <[email protected]>

Due to upstream Linux kernel commit:

commit c73464b1c8434ad4cbfd5369c3e724f3e8ffe5a4

Author: Peter Zijlstra <[email protected]>
Date:   Mon Sep 28 18:06:56 2015 +0200

sched/core: Fix trace_sched_switch()

---
 instrumentation/events/lttng-module/sched.h | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)
instrumentation/events/lttng-module/sched.h +25 -3
index d2e03f9..347edb7 100644
@@ -15,7 +15,21 @@
 #ifndef _TRACE_SCHED_DEF_
 #define _TRACE_SCHED_DEF_
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0))
+
+static inline long __trace_sched_switch_state(bool preempt, struct task_struct *p)
+{
+#ifdef CONFIG_SCHED_DEBUG
+	BUG_ON(p != current);
+#endif /* CONFIG_SCHED_DEBUG */
+	/*
+	 * Preemption ignores task state, therefore preempted tasks are always RUNNING
+	 * (we will not have dequeued if state != RUNNING).
+	 */
+	return preempt ? TASK_RUNNING | TASK_STATE_MAX : p->state;
+}
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0))
 
 static inline long __trace_sched_switch_state(struct task_struct *p)
 {
@@ -271,7 +285,13 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(sched_wakeup_template, sched_wakeup_new,
  */
 LTTNG_TRACEPOINT_EVENT(sched_switch,
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0))
+	TP_PROTO(bool preempt,
+		 struct task_struct *prev,
+		 struct task_struct *next),
+
+	TP_ARGS(preempt, prev, next),
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
 	TP_PROTO(struct task_struct *prev,
 		 struct task_struct *next),
 
@@ -297,7 +317,9 @@ LTTNG_TRACEPOINT_EVENT(sched_switch,
 		tp_memcpy(next_comm, next->comm, TASK_COMM_LEN)
 		tp_assign(prev_tid, prev->pid)
 		tp_assign(prev_prio, prev->prio - MAX_RT_PRIO)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0))
+		tp_assign(prev_state, __trace_sched_switch_state(preempt, prev))
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
 		tp_assign(prev_state, __trace_sched_switch_state(prev))
 #else
 		tp_assign(prev_state, prev->state)
Signature · 6 lines
2.7.4

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

PATCH 2/2 Fix: Ubuntu kernel range for mm_page_alloc_extfrag

In reply to a message not in the archive
---
 instrumentation/events/lttng-module/kmem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
instrumentation/events/lttng-module/kmem.h +1 -1
index 171fcb9..0115afe 100644
@@ -291,7 +291,7 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE_PRINT(mm_page, mm_page_pcpu_drain,
 	|| LTTNG_KERNEL_RANGE(3,18,10, 3,19,0)		\
 	|| LTTNG_DEBIAN_KERNEL_RANGE(3,16,7,9,0,0, 3,17,0,0,0,0)	\
 	|| LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,50, 3,14,0,0)	\
-	|| LTTNG_UBUNTU_KERNEL_RANGE(3,16,7,38, 3,17,0,0))
+	|| LTTNG_UBUNTU_KERNEL_RANGE(3,16,7,34, 3,17,0,0))
 
 LTTNG_TRACEPOINT_EVENT(mm_page_alloc_extfrag,
 
Signature · 6 lines
2.7.4

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

Re: [PATCH lttng-modules stable-2.6 0/2] Fix Ubuntu kernels

In reply to a message not in the archive

Merged, thanks!

Mathieu

Quoted 15 lines · ----- On May 5, 2016, at 4:57 PM, Michael Jeanson [email protected] wrote:

Here are 2 patches backported from master to stable-2.6 to fix the build on Ubuntu kernels.

Mathieu Desnoyers (1):
Fix: update sched instrumentation for kernel 4.4.0

Michael Jeanson (1):
Fix: Ubuntu kernel range for mm_page_alloc_extfrag

instrumentation/events/lttng-module/kmem.h | 2 +- instrumentation/events/lttng-module/sched.h | 28 +++++++++++++++++++++++++---

2 files changed, 26 insertions(+), 4 deletions(-)

--
2.7.4

Signature · 7 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev