diff options
author | Peter Zijlstra <peterz@infradead.org> | 2011-09-16 05:16:43 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-09-26 07:25:54 -0400 |
commit | 557ab425429a5123d37f412ce3e6d6137cb621f8 (patch) | |
tree | 2e1106b01ada425da6b2cd4f38fc59384cb031a5 /include/trace | |
parent | f4cfb33ed980085b14a8f376281edb2e270f0244 (diff) |
sched, tracing: Show PREEMPT_ACTIVE state in trace_sched_switch
We had need to see the difference between scheduling a runnable task and
a runnable task being involuntarily preempted.
No app should rely on the old string output (the binary
trace event record format is not changed).
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1316164603.10174.11.camel@twins
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/sched.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index f6334782a593..959ff18b63b6 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
@@ -100,7 +100,7 @@ static inline long __trace_sched_switch_state(struct task_struct *p) | |||
100 | * For all intents and purposes a preempted task is a running task. | 100 | * For all intents and purposes a preempted task is a running task. |
101 | */ | 101 | */ |
102 | if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE) | 102 | if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE) |
103 | state = TASK_RUNNING; | 103 | state = TASK_RUNNING | TASK_STATE_MAX; |
104 | #endif | 104 | #endif |
105 | 105 | ||
106 | return state; | 106 | return state; |
@@ -137,13 +137,14 @@ TRACE_EVENT(sched_switch, | |||
137 | __entry->next_prio = next->prio; | 137 | __entry->next_prio = next->prio; |
138 | ), | 138 | ), |
139 | 139 | ||
140 | TP_printk("prev_comm=%s prev_pid=%d prev_prio=%d prev_state=%s ==> next_comm=%s next_pid=%d next_prio=%d", | 140 | TP_printk("prev_comm=%s prev_pid=%d prev_prio=%d prev_state=%s%s ==> next_comm=%s next_pid=%d next_prio=%d", |
141 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, | 141 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, |
142 | __entry->prev_state ? | 142 | __entry->prev_state & (TASK_STATE_MAX-1) ? |
143 | __print_flags(__entry->prev_state, "|", | 143 | __print_flags(__entry->prev_state & (TASK_STATE_MAX-1), "|", |
144 | { 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" }, | 144 | { 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" }, |
145 | { 16, "Z" }, { 32, "X" }, { 64, "x" }, | 145 | { 16, "Z" }, { 32, "X" }, { 64, "x" }, |
146 | { 128, "W" }) : "R", | 146 | { 128, "W" }) : "R", |
147 | __entry->prev_state & TASK_STATE_MAX ? "+" : "", | ||
147 | __entry->next_comm, __entry->next_pid, __entry->next_prio) | 148 | __entry->next_comm, __entry->next_pid, __entry->next_prio) |
148 | ); | 149 | ); |
149 | 150 | ||