]> Git Repo - linux.git/commitdiff
sched/debug: Use symbolic names for task state constants
authorUwe Kleine-König <[email protected]>
Wed, 5 Sep 2018 09:36:36 +0000 (11:36 +0200)
committerIngo Molnar <[email protected]>
Mon, 10 Sep 2018 09:05:56 +0000 (11:05 +0200)
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 <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Sebastian Andrzej Siewior <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
include/trace/events/sched.h

index 0be866c91f62d055f5a6a3ab25a263a11f111916..f07b270d4fc4febeb1d3c4d0413ba4bf14e05daf 100644 (file)
@@ -159,9 +159,14 @@ TRACE_EVENT(sched_switch,
 
                (__entry->prev_state & (TASK_REPORT_MAX - 1)) ?
                  __print_flags(__entry->prev_state & (TASK_REPORT_MAX - 1), "|",
-                               { 0x01, "S" }, { 0x02, "D" }, { 0x04, "T" },
-                               { 0x08, "t" }, { 0x10, "X" }, { 0x20, "Z" },
-                               { 0x40, "P" }, { 0x80, "I" }) :
+                               { TASK_INTERRUPTIBLE, "S" },
+                               { TASK_UNINTERRUPTIBLE, "D" },
+                               { __TASK_STOPPED, "T" },
+                               { __TASK_TRACED, "t" },
+                               { EXIT_DEAD, "X" },
+                               { EXIT_ZOMBIE, "Z" },
+                               { TASK_PARKED, "P" },
+                               { TASK_DEAD, "I" }) :
                  "R",
 
                __entry->prev_state & TASK_REPORT_MAX ? "+" : "",
This page took 0.061267 seconds and 4 git commands to generate.