All of lore.kernel.org
 help / color / mirror / Atom feed
From: Raistlin <raistlin@linux.it>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	Steven Rostedt <rostedt@goodmis.org>,
	Chris Friesen <cfriesen@nortel.com>,
	oleg@redhat.com, Frederic Weisbecker <fweisbec@gmail.com>,
	Darren Hart <darren@dvhart.com>,
	Johan Eker <johan.eker@ericsson.com>,
	"p.faure" <p.faure@akatech.ch>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Claudio Scordino <claudio@evidence.eu.com>,
	michael trimarchi <trimarchi@retis.sssup.it>,
	Fabio Checconi <fabio@gandalf.sssup.it>,
	Tommaso Cucinotta <cucinotta@sssup.it>,
	Juri Lelli <juri.lelli@gmail.com>,
	Nicola Manica <nicola.manica@disi.unitn.it>,
	Luca Abeni <luca.abeni@unitn.it>,
	Dhaval Giani <dhaval@retis.sssup.it>,
	Harald Gustafsson <hgu1972@gmail.com>,
	paulmck <paulmck@linux.vnet.ibm.com>
Subject: [RFC][PATCH 16/22] sched: add SMP traceporints for -deadline tasks
Date: Fri, 29 Oct 2010 08:39:37 +0200	[thread overview]
Message-ID: <1288334377.8661.157.camel@Palantir> (raw)
In-Reply-To: <1288333128.8661.137.camel@Palantir>

[-- Attachment #1: Type: text/plain, Size: 5183 bytes --]


Add tracepoints for the events involved in -deadline task migration
(mainly push, pull and migrate-task).

Signed-off-by: Dario Faggioli <raistlin@linux.it>
---
 include/trace/events/sched.h |  109 ++++++++++++++++++++++++++++++++++++++++++
 kernel/sched.c               |    3 +
 kernel/sched_dl.c            |    7 +++
 3 files changed, 119 insertions(+), 0 deletions(-)

diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 03baa17..f1d805f 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -475,6 +475,115 @@ TRACE_EVENT(sched_timer_dl,
 );
 
 /*
+ *
+ */
+TRACE_EVENT(sched_push_task_dl,
+
+	TP_PROTO(struct task_struct *n, u64 clock, int later_cpu),
+
+	TP_ARGS(n, clock, later_cpu),
+
+	TP_STRUCT__entry(
+		__array(	char,	comm,	TASK_COMM_LEN	)
+		__field(	pid_t,	pid			)
+		__field(	u64,	clock			)
+		__field(	s64,	rt			)
+		__field(	u64,	dl			)
+		__field(	int,	cpu			)
+		__field(	int,	later_cpu		)
+	),
+
+	TP_fast_assign(
+		memcpy(__entry->comm, n->comm, TASK_COMM_LEN);
+		__entry->pid		= n->pid;
+		__entry->clock		= clock;
+		__entry->rt		= n->dl.runtime;
+		__entry->dl		= n->dl.deadline;
+		__entry->cpu		= task_cpu(n);
+		__entry->later_cpu	= later_cpu;
+	),
+
+	TP_printk("comm=%s pid=%d rt=%Ld [ns] dl=%Lu [ns] clock=%Lu [ns] cpu=%d later_cpu=%d",
+		  __entry->comm, __entry->pid, (long long)__entry->rt,
+		  (unsigned long long)__entry->dl, (unsigned long long)__entry->clock,
+		  __entry->cpu, __entry->later_cpu)
+);
+
+/*
+ *
+ */
+TRACE_EVENT(sched_pull_task_dl,
+
+	TP_PROTO(struct task_struct *p, u64 clock, int src_cpu),
+
+	TP_ARGS(p, clock, src_cpu),
+
+	TP_STRUCT__entry(
+		__array(	char,	comm,	TASK_COMM_LEN	)
+		__field(	pid_t,	pid			)
+		__field(	u64,	clock			)
+		__field(	s64,	rt			)
+		__field(	u64,	dl			)
+		__field(	int,	cpu			)
+		__field(	int,	src_cpu			)
+	),
+
+	TP_fast_assign(
+		memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+		__entry->pid		= p->pid;
+		__entry->clock		= clock;
+		__entry->rt		= p->dl.runtime;
+		__entry->dl		= p->dl.deadline;
+		__entry->cpu		= task_cpu(p);
+		__entry->src_cpu	= src_cpu;
+	),
+
+	TP_printk("comm=%s pid=%d rt=%Ld [ns] dl=%Lu [ns] clock=%Lu [ns] cpu=%d later_cpu=%d",
+		  __entry->comm, __entry->pid, (long long)__entry->rt,
+		  (unsigned long long)__entry->dl, (unsigned long long)__entry->clock,
+		  __entry->cpu, __entry->src_cpu)
+);
+
+/*
+ * Tracepoint for migrations involving -deadline tasks:
+ */
+TRACE_EVENT(sched_migrate_task_dl,
+
+	TP_PROTO(struct task_struct *p, u64 clock, int dest_cpu, u64 dclock),
+
+	TP_ARGS(p, clock, dest_cpu, dclock),
+
+	TP_STRUCT__entry(
+		__array(	char,	comm,	TASK_COMM_LEN	)
+		__field(	pid_t,	pid			)
+		__field(	u64,	clock			)
+		__field(	s64,	rt			)
+		__field(	u64,	dl			)
+		__field(	int,	orig_cpu		)
+		__field(	int,	dest_cpu		)
+		__field(	u64,	dclock			)
+	),
+
+	TP_fast_assign(
+		memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+		__entry->pid		= p->pid;
+		__entry->clock		= clock;
+		__entry->rt		= p->dl.runtime;
+		__entry->dl		= p->dl.deadline;
+		__entry->orig_cpu	= task_cpu(p);
+		__entry->dest_cpu	= dest_cpu;
+		__entry->dclock		= dclock;
+	),
+
+	TP_printk("comm=%s pid=%d rt=%Ld [ns] dl=%Lu [ns] orig_cpu=%d orig_clock=%Lu [ns] "
+		  "dest_cpu=%d dest_clock=%Lu [ns]",
+		  __entry->comm, __entry->pid, (long long)__entry->rt,
+		  (unsigned long long)__entry->dl, __entry->orig_cpu,
+		  (unsigned long long)__entry->clock, __entry->dest_cpu,
+		  (unsigned long long)__entry->dclock)
+);
+
+/*
  * sched_stat tracepoints for -deadline tasks:
  */
 DECLARE_EVENT_CLASS(sched_stat_template_dl,
diff --git a/kernel/sched.c b/kernel/sched.c
index 060d0c9..79cac6e 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2235,6 +2235,9 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
 #endif
 
 	trace_sched_migrate_task(p, new_cpu);
+	if (unlikely(dl_task(p)))
+		trace_sched_migrate_task_dl(p, task_rq(p)->clock,
+					    new_cpu, cpu_rq(new_cpu)->clock);
 
 	if (task_cpu(p) != new_cpu) {
 		p->se.nr_migrations++;
diff --git a/kernel/sched_dl.c b/kernel/sched_dl.c
index 229814a..cc87949 100644
--- a/kernel/sched_dl.c
+++ b/kernel/sched_dl.c
@@ -1294,6 +1294,10 @@ retry:
 
 	/* Will lock the rq it'll find */
 	later_rq = find_lock_later_rq(next_task, rq);
+
+	trace_sched_push_task_dl(next_task, rq->clock,
+				 later_rq ? later_rq->cpu : -1);
+
 	if (!later_rq) {
 		struct task_struct *task;
 
@@ -1378,6 +1382,9 @@ static int pull_dl_task(struct rq *this_rq)
 			goto skip;
 
 		p = pick_next_earliest_dl_task(src_rq, this_cpu);
+		if (p)
+			trace_sched_pull_task_dl(p, this_rq->clock,
+						 src_rq->cpu);
 
 		/*
 		 * We found a task to be pulled if:
-- 
1.7.2.3


-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
----------------------------------------------------------------------
Dario Faggioli, ReTiS Lab, Scuola Superiore Sant'Anna, Pisa  (Italy)

http://blog.linux.it/raistlin / raistlin@ekiga.net /
dario.faggioli@jabber.org

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  parent reply	other threads:[~2010-10-29  6:39 UTC|newest]

Thread overview: 135+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-29  6:18 [RFC][PATCH 00/22] sched: SCHED_DEADLINE v3 Raistlin
2010-10-29  6:25 ` [RFC][PATCH 01/22] sched: add sched_class->task_dead Raistlin
2010-10-29  6:27 ` [RFC][PATCH 02/22] sched: add extended scheduling interface Raistlin
2010-11-10 16:00   ` Dhaval Giani
2010-11-10 16:12     ` Dhaval Giani
2010-11-10 22:45       ` Raistlin
2010-11-10 16:17     ` Claudio Scordino
2010-11-10 17:28   ` Peter Zijlstra
2010-11-10 19:26     ` Peter Zijlstra
2010-11-10 23:33       ` Tommaso Cucinotta
2010-11-11 12:19         ` Peter Zijlstra
2010-11-10 22:17     ` Raistlin
2010-11-10 22:57       ` Tommaso Cucinotta
2010-11-11 13:32       ` Peter Zijlstra
2010-11-11 13:54         ` Raistlin
2010-11-11 14:08           ` Peter Zijlstra
2010-11-11 17:27             ` Raistlin
2010-11-11 14:05         ` Dhaval Giani
2010-11-10 22:24     ` Raistlin
2010-11-10 18:50   ` Peter Zijlstra
2010-11-10 22:05     ` Raistlin
2010-11-12 16:38   ` Steven Rostedt
2010-11-12 16:43     ` Peter Zijlstra
2010-11-12 16:52       ` Steven Rostedt
2010-11-12 19:19         ` Raistlin
2010-11-12 19:23           ` Steven Rostedt
2010-11-12 17:42     ` Tommaso Cucinotta
2010-11-12 19:21       ` Steven Rostedt
2010-11-12 19:24     ` Raistlin
2010-10-29  6:28 ` [RFC][PATCH 03/22] sched: SCHED_DEADLINE data structures Raistlin
2010-11-10 18:59   ` Peter Zijlstra
2010-11-10 22:06     ` Raistlin
2010-11-10 19:10   ` Peter Zijlstra
2010-11-12 17:11     ` Steven Rostedt
2010-10-29  6:29 ` [RFC][PATCH 04/22] sched: SCHED_DEADLINE SMP-related " Raistlin
2010-11-10 19:17   ` Peter Zijlstra
2010-10-29  6:30 ` [RFC][PATCH 05/22] sched: SCHED_DEADLINE policy implementation Raistlin
2010-11-10 19:21   ` Peter Zijlstra
2010-11-10 19:43   ` Peter Zijlstra
2010-11-11  1:02     ` Raistlin
2010-11-10 19:45   ` Peter Zijlstra
2010-11-10 22:26     ` Raistlin
2010-11-10 20:21   ` Peter Zijlstra
2010-11-11  1:18     ` Raistlin
2010-11-11 13:13       ` Peter Zijlstra
2010-11-11 14:13   ` Peter Zijlstra
2010-11-11 14:28     ` Raistlin
2010-11-11 14:17   ` Peter Zijlstra
2010-11-11 18:33     ` Raistlin
2010-11-11 14:25   ` Peter Zijlstra
2010-11-11 14:33     ` Raistlin
2010-11-14  8:54   ` Raistlin
2010-11-23 14:24     ` Peter Zijlstra
2010-10-29  6:31 ` [RFC][PATCH 06/22] sched: SCHED_DEADLINE handles spacial kthreads Raistlin
2010-11-11 14:31   ` Peter Zijlstra
2010-11-11 14:50     ` Dario Faggioli
2010-11-11 14:34   ` Peter Zijlstra
2010-11-11 15:27     ` Oleg Nesterov
2010-11-11 15:43       ` Peter Zijlstra
2010-11-11 16:32         ` Oleg Nesterov
2010-11-13 18:35           ` Peter Zijlstra
2010-11-13 19:58             ` Oleg Nesterov
2010-11-13 20:31               ` Peter Zijlstra
2010-11-13 20:51                 ` Peter Zijlstra
2010-11-13 23:31                   ` Peter Zijlstra
2010-11-15 20:06                     ` [PATCH] sched: Simplify cpu-hot-unplug task migration Peter Zijlstra
2010-11-17 19:27                       ` Oleg Nesterov
2010-11-17 19:42                         ` Peter Zijlstra
2010-11-18 14:05                           ` Oleg Nesterov
2010-11-18 14:24                             ` Peter Zijlstra
2010-11-18 15:32                               ` Oleg Nesterov
2010-11-18 14:09                       ` [tip:sched/core] " tip-bot for Peter Zijlstra
2010-11-11 14:46   ` [RFC][PATCH 06/22] sched: SCHED_DEADLINE handles spacial kthreads Peter Zijlstra
2010-10-29  6:32 ` [RFC][PATCH 07/22] sched: SCHED_DEADLINE push and pull logic Raistlin
2010-11-12 16:17   ` Peter Zijlstra
2010-11-12 21:11     ` Raistlin
2010-11-14  9:14     ` Raistlin
2010-11-23 14:27       ` Peter Zijlstra
2010-10-29  6:33 ` [RFC][PATCH 08/22] sched: SCHED_DEADLINE avg_update accounting Raistlin
2010-11-11 19:16   ` Peter Zijlstra
2010-10-29  6:34 ` [RFC][PATCH 09/22] sched: add period support for -deadline tasks Raistlin
2010-11-11 19:17   ` Peter Zijlstra
2010-11-11 19:31     ` Raistlin
2010-11-11 19:43       ` Peter Zijlstra
2010-11-11 23:33         ` Tommaso Cucinotta
2010-11-12 13:33         ` Raistlin
2010-11-12 13:45           ` Peter Zijlstra
2010-11-12 13:46       ` Luca Abeni
2010-11-12 14:01         ` Raistlin
2010-10-29  6:35 ` [RFC][PATCH 10/22] sched: add a syscall to wait for the next instance Raistlin
2010-11-11 19:21   ` Peter Zijlstra
2010-11-11 19:33     ` Raistlin
2010-10-29  6:35 ` [RFC][PATCH 11/22] sched: add schedstats for -deadline tasks Raistlin
2010-10-29  6:36 ` [RFC][PATCH 12/22] sched: add runtime reporting " Raistlin
2010-11-11 19:37   ` Peter Zijlstra
2010-11-12 16:15     ` Raistlin
2010-11-12 16:27       ` Peter Zijlstra
2010-11-12 21:12         ` Raistlin
2010-10-29  6:37 ` [RFC][PATCH 13/22] sched: add resource limits " Raistlin
2010-11-11 19:57   ` Peter Zijlstra
2010-11-12 21:30     ` Raistlin
2010-11-12 23:32       ` Peter Zijlstra
2010-10-29  6:38 ` [RFC][PATCH 14/22] sched: add latency tracing " Raistlin
2010-10-29  6:38 ` [RFC][PATCH 15/22] sched: add traceporints " Raistlin
2010-11-11 19:54   ` Peter Zijlstra
2010-11-12 16:13     ` Raistlin
2010-10-29  6:39 ` Raistlin [this message]
2010-10-29  6:40 ` [RFC][PATCH 17/22] sched: add signaling overrunning " Raistlin
2010-11-11 21:58   ` Peter Zijlstra
2010-11-12 15:39     ` Raistlin
2010-11-12 16:04       ` Peter Zijlstra
2010-10-29  6:42 ` [RFC][PATCH 19/22] rtmutex: turn the plist into an rb-tree Raistlin
2010-10-29  6:42 ` [RFC][PATCH 18/22] sched: add reclaiming logic to -deadline tasks Raistlin
2010-11-11 22:12   ` Peter Zijlstra
2010-11-12 15:36     ` Raistlin
2010-11-12 16:04       ` Peter Zijlstra
2010-11-12 17:41         ` Luca Abeni
2010-11-12 17:51           ` Peter Zijlstra
2010-11-12 17:54             ` Luca Abeni
2010-11-13 21:08             ` Raistlin
2010-11-12 18:07           ` Tommaso Cucinotta
2010-11-12 19:07             ` Raistlin
2010-11-13  0:43             ` Peter Zijlstra
2010-11-13  1:49               ` Tommaso Cucinotta
2010-11-12 18:56         ` Raistlin
     [not found]           ` <80992760-24F2-42AE-AF2D-15727F6A1C81@email.unc.edu>
2010-11-15 18:37             ` James H. Anderson
2010-11-15 19:23               ` Luca Abeni
2010-11-15 19:49                 ` James H. Anderson
2010-11-15 19:39               ` Luca Abeni
2010-11-15 21:34               ` Raistlin
2010-10-29  6:43 ` [RFC][PATCH 20/22] sched: drafted deadline inheritance logic Raistlin
2010-11-11 22:15   ` Peter Zijlstra
2010-11-14 12:00     ` Raistlin
2010-10-29  6:44 ` [RFC][PATCH 21/22] sched: add bandwidth management for sched_dl Raistlin
2010-10-29  6:45 ` [RFC][PATCH 22/22] sched: add sched_dl documentation Raistlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1288334377.8661.157.camel@Palantir \
    --to=raistlin@linux.it \
    --cc=cfriesen@nortel.com \
    --cc=claudio@evidence.eu.com \
    --cc=cucinotta@sssup.it \
    --cc=darren@dvhart.com \
    --cc=dhaval@retis.sssup.it \
    --cc=fabio@gandalf.sssup.it \
    --cc=fweisbec@gmail.com \
    --cc=hgu1972@gmail.com \
    --cc=johan.eker@ericsson.com \
    --cc=juri.lelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.abeni@unitn.it \
    --cc=mingo@elte.hu \
    --cc=nicola.manica@disi.unitn.it \
    --cc=oleg@redhat.com \
    --cc=p.faure@akatech.ch \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=trimarchi@retis.sssup.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.