aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2018-09-05 05:36:36 -0400
committerIngo Molnar <mingo@kernel.org>2018-09-10 05:05:56 -0400
commitff28915fd31ccafc0d38e6f84b66df280ed9e86a (patch)
treefc05512d865bdb0036b7d6ec077972417f6dbeb6
parent7477a3504e619768c9e972dafe2907e6b8ed9823 (diff)
sched/debug: Use symbolic names for task state constants
include/trace/events/sched.h includes <linux/sched.h> (via <linux/sched/numa_balancing.h>) and so knows about the TASK_* constants used to interpret .prev_state. So instead of duplicating the magic numbers make use of the defined macros to ease understanding the mapping from state bits to letters which isn't completely intuitive for an outsider. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: kernel@pengutronix.de Link: http://lkml.kernel.org/r/20180905093636.24068-1-u.kleine-koenig@pengutronix.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--include/trace/events/sched.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 0be866c91f62..f07b270d4fc4 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -159,9 +159,14 @@ TRACE_EVENT(sched_switch,
159 159
160 (__entry->prev_state & (TASK_REPORT_MAX - 1)) ? 160 (__entry->prev_state & (TASK_REPORT_MAX - 1)) ?
161 __print_flags(__entry->prev_state & (TASK_REPORT_MAX - 1), "|", 161 __print_flags(__entry->prev_state & (TASK_REPORT_MAX - 1), "|",
162 { 0x01, "S" }, { 0x02, "D" }, { 0x04, "T" }, 162 { TASK_INTERRUPTIBLE, "S" },
163 { 0x08, "t" }, { 0x10, "X" }, { 0x20, "Z" }, 163 { TASK_UNINTERRUPTIBLE, "D" },
164 { 0x40, "P" }, { 0x80, "I" }) : 164 { __TASK_STOPPED, "T" },
165 { __TASK_TRACED, "t" },
166 { EXIT_DEAD, "X" },
167 { EXIT_ZOMBIE, "Z" },
168 { TASK_PARKED, "P" },
169 { TASK_DEAD, "I" }) :
165 "R", 170 "R",
166 171
167 __entry->prev_state & TASK_REPORT_MAX ? "+" : "", 172 __entry->prev_state & TASK_REPORT_MAX ? "+" : "",