lkml.org 
[lkml]   [2012]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/5] sched: event: add trace events when a task starts executing on a cpu
Date
sched_switch_finish is sent when a task starts executing on a cpu.
It sends in context of this task, that's why sched_switch can't be used.
sched_switch is send when a task goes out from a cpu.

This two events will be needed for profiling sleep time.

Signed-off-by: Andrew Vagin <avagin@openvz.org>
---
include/trace/events/sched.h | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index ea7a203..b2219d8 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -149,6 +149,25 @@ TRACE_EVENT(sched_switch,
__entry->next_comm, __entry->next_pid, __entry->next_prio)
);

+TRACE_EVENT(sched_switch_finish,
+
+ TP_PROTO(struct task_struct *p),
+
+ TP_ARGS(p),
+
+ TP_STRUCT__entry(
+ __array( char, comm, TASK_COMM_LEN )
+ __field( pid_t, pid )
+ ),
+
+ TP_fast_assign(
+ __entry->pid = p->pid;
+ memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
+ ),
+
+ TP_printk("comm=%s pid=%d", __entry->comm, __entry->pid)
+);
+
/*
* Tracepoint for a task being migrated:
*/
--
1.7.1


\
 
 \ /
  Last update: 2012-06-04 10:41    [from the cache]
©2003-2011 Jasper Spaans