aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-06-03 18:47:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-06-03 18:47:51 -0400
commit39d112100e561686ab1e2b19c57984163ad6c1fa (patch)
tree19b3cd50345306de6f95b58b4a35e8f725786b9b /include/trace
parent167b7129042a4b4c09bb4ede5482ff79340a3999 (diff)
parent02f726949f2be0967aa4871dd4e47d3967779b26 (diff)
Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: sched, trace: Fix sched_switch() prev_state argument sched: Fix wake_affine() vs RT tasks sched: Make sure timers have migrated before killing the migration_thread
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/sched.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 4f733ecea46e..b9e1dd6c6208 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -115,6 +115,23 @@ DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new,
115 TP_PROTO(struct task_struct *p, int success), 115 TP_PROTO(struct task_struct *p, int success),
116 TP_ARGS(p, success)); 116 TP_ARGS(p, success));
117 117
118#ifdef CREATE_TRACE_POINTS
119static inline long __trace_sched_switch_state(struct task_struct *p)
120{
121 long state = p->state;
122
123#ifdef CONFIG_PREEMPT
124 /*
125 * For all intents and purposes a preempted task is a running task.
126 */
127 if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE)
128 state = TASK_RUNNING;
129#endif
130
131 return state;
132}
133#endif
134
118/* 135/*
119 * Tracepoint for task switches, performed by the scheduler: 136 * Tracepoint for task switches, performed by the scheduler:
120 */ 137 */
@@ -139,7 +156,7 @@ TRACE_EVENT(sched_switch,
139 memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN); 156 memcpy(__entry->next_comm, next->comm, TASK_COMM_LEN);
140 __entry->prev_pid = prev->pid; 157 __entry->prev_pid = prev->pid;
141 __entry->prev_prio = prev->prio; 158 __entry->prev_prio = prev->prio;
142 __entry->prev_state = prev->state; 159 __entry->prev_state = __trace_sched_switch_state(prev);
143 memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN); 160 memcpy(__entry->prev_comm, prev->comm, TASK_COMM_LEN);
144 __entry->next_pid = next->pid; 161 __entry->next_pid = next->pid;
145 __entry->next_prio = next->prio; 162 __entry->next_prio = next->prio;