[patch 5/9] LTTng instrumentation scheduler fix task migration

Mathieu Desnoyers
2009-03-24T16:25:12Z

[-- Attachment #1: lttng-instrumentation-scheduler-fixup-task-migration.patch --]
[-- Type: text/plain, Size: 1740 bytes --]

The scheduler migration only needs to pass the task struct pointer and the
destination CPU. The source CPU can be found by using task_cpu(p) in the probe.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: 'Ingo Molnar' <mingo@elte.hu>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Jason Baron <jbaron@redhat.com>
CC: 'Peter Zijlstra' <peterz@infradead.org>
---
include/trace/sched.h | 4 ++--
kernel/sched.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6-lttng/include/trace/sched.h
===================================================================
--- linux-2.6-lttng.orig/include/trace/sched.h 2009-01-30 10:42:51.000000000 -0500
+++ linux-2.6-lttng/include/trace/sched.h 2009-01-30 10:43:19.000000000 -0500
@@ -30,8 +30,8 @@ DECLARE_TRACE(sched_switch,
TPARGS(rq, prev, next));

DECLARE_TRACE(sched_migrate_task,
- TPPROTO(struct task_struct *p, int orig_cpu, int dest_cpu),
- TPARGS(p, orig_cpu, dest_cpu));
+ TPPROTO(struct task_struct *p, int dest_cpu),
+ TPARGS(p, dest_cpu));

DECLARE_TRACE(sched_process_free,
TPPROTO(struct task_struct *p),
Index: linux-2.6-lttng/kernel/sched.c
===================================================================
--- linux-2.6-lttng.orig/kernel/sched.c 2009-01-30 10:43:07.000000000 -0500
+++ linux-2.6-lttng/kernel/sched.c 2009-01-30 10:43:38.000000000 -0500
@@ -1876,7 +1876,7 @@ void set_task_cpu(struct task_struct *p,

clock_offset = old_rq->clock - new_rq->clock;

- trace_sched_migrate_task(p, task_cpu(p), new_cpu);
+ trace_sched_migrate_task(p, new_cpu);

#ifdef CONFIG_SCHEDSTATS
if (p->se.wait_start)

--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68