mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Theodore Tso <tytso@mit.edu>,
	Arjan van de Ven <arjan@infradead.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: [RFC][PATCH 5/5] [PATCH 5/5] tracing/events: Add sched_migrate_task stable event
Date: Tue, 16 Nov 2010 19:54:02 -0500	[thread overview]
Message-ID: <20101117005940.688000675@goodmis.org> (raw)
In-Reply-To: <20101117005357.024472450@goodmis.org>

[-- Attachment #1: 0005-tracing-events-Add-sched_migrate_task-stable-event.patch --]
[-- Type: text/plain, Size: 1743 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

Add the stable event for sched_migrate_task.

[root@bxf ~]# cat /sys/kernel/event/sched_migrate_task/format
	array:comm	type:char	size:8	count:16	align:1	signed:1;
	field:pid	type:pid_t	size:32	align:4	signed:1;
	field:orig_cpu	type:int	size:32	align:4	signed:1;
	field:dest_cpu	type:int	size:32	align:4	signed:1;

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 include/trace/stable/sched.h |   13 +++++++++++++
 kernel/events/events.c       |   10 ++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/include/trace/stable/sched.h b/include/trace/stable/sched.h
index b5f4fd7..55d0e6f 100644
--- a/include/trace/stable/sched.h
+++ b/include/trace/stable/sched.h
@@ -17,4 +17,17 @@ STABLE_EVENT(sched_switch,
 	)
 );
 
+/*
+ * Tracepoint for a task being migrated:
+ */
+STABLE_EVENT(sched_migrate_task,
+
+	EVENT_STRUCT(
+		__array(	char,	comm,	TASK_COMM_LEN	)__SEP__
+		__field(	pid_t,	pid			)__SEP__
+		__field(	int,	orig_cpu		)__SEP__
+		__field(	int,	dest_cpu		)
+	)
+);
+
 #endif /* _STABLE_SCHED_H */
diff --git a/kernel/events/events.c b/kernel/events/events.c
index f69e720..6ca2d2d 100644
--- a/kernel/events/events.c
+++ b/kernel/events/events.c
@@ -35,4 +35,14 @@ static void hook_sched_switch(void *ignore,
 				  next->comm, next->pid);
 }
 
+DECLARE_TRACE(stable_sched_migrate_task,
+	      TP_PROTO(char *comm, pid_t pid, int orig_cpu, int dest_cpu),
+	      TP_ARGS(comm, pid, orig_cpu, dest_cpu));
+DEFINE_TRACE(stable_sched_migrate_task);
+
+static void hook_sched_migrate_task(void *ignore, struct task_struct *p, int dest_cpu)
+{
+	trace_stable_sched_migrate_task(p->comm, p->pid, task_cpu(p), dest_cpu);
+}
+
 #include "event_reg.h"
-- 
1.7.1



  parent reply	other threads:[~2010-11-17  1:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17  0:53 [RFC][PATCH 0/5] tracing/events: stable tracepoints Steven Rostedt
2010-11-17  0:53 ` [RFC][PATCH 1/5] [PATCH 1/5] events: Add EVENT_FS the event filesystem Steven Rostedt
2010-11-17  3:32   ` Greg KH
2010-11-17 10:39     ` Ingo Molnar
2010-11-17 12:25       ` Steven Rostedt
2010-11-17 15:03         ` Ingo Molnar
2010-11-17 15:16           ` Peter Zijlstra
2010-11-17 15:16           ` Steven Rostedt
2010-11-17 15:35             ` Peter Zijlstra
2010-11-17 18:42           ` Ted Ts'o
2010-11-17 15:16         ` Peter Zijlstra
2010-11-23 21:29           ` Steven Rostedt
2010-11-17 17:46         ` Mathieu Desnoyers
2010-11-17 17:52           ` Steven Rostedt
2010-11-17 18:12             ` Mathieu Desnoyers
2010-11-18  9:42               ` Avi Kivity
2010-11-17 23:48             ` Ted Ts'o
2010-11-18 13:05               ` Mathieu Desnoyers
2010-11-17 12:16     ` Steven Rostedt
2010-11-17  0:53 ` [RFC][PATCH 2/5] [PATCH 2/5] tracing/events: Add code to (un)register stable events Steven Rostedt
2010-11-17  0:54 ` [RFC][PATCH 3/5] [PATCH 3/5] tracing/events: Add infrastructure to show stable event formats Steven Rostedt
2010-11-17  0:54 ` [RFC][PATCH 4/5] [PATCH 4/5] tracing/events: Add stable event sched_switch Steven Rostedt
2010-11-17  0:54 ` Steven Rostedt [this message]
2010-11-17 20:14 ` [RFC][PATCH 0/5] tracing/events: stable tracepoints Mathieu Desnoyers

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=20101117005940.688000675@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome