aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/proc/array.c3
-rw-r--r--include/linux/sched.h16
-rw-r--r--include/trace/events/sched.h2
3 files changed, 10 insertions, 11 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index a120a4549d48..77a8eacbe032 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -128,9 +128,10 @@ static const char * const task_state_array[] = {
128 "t (tracing stop)", /* 0x08 */ 128 "t (tracing stop)", /* 0x08 */
129 "X (dead)", /* 0x10 */ 129 "X (dead)", /* 0x10 */
130 "Z (zombie)", /* 0x20 */ 130 "Z (zombie)", /* 0x20 */
131 "P (parked)", /* 0x40 */
131 132
132 /* states beyond TASK_REPORT: */ 133 /* states beyond TASK_REPORT: */
133 "I (idle)", /* 0x40 */ 134 "I (idle)", /* 0x80 */
134}; 135};
135 136
136static inline const char *get_task_state(struct task_struct *tsk) 137static inline const char *get_task_state(struct task_struct *tsk)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 286fc1117046..26a7df4e558c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -75,10 +75,10 @@ struct task_group;
75#define EXIT_ZOMBIE 0x0020 75#define EXIT_ZOMBIE 0x0020
76#define EXIT_TRACE (EXIT_ZOMBIE | EXIT_DEAD) 76#define EXIT_TRACE (EXIT_ZOMBIE | EXIT_DEAD)
77/* Used in tsk->state again: */ 77/* Used in tsk->state again: */
78#define TASK_DEAD 0x0040 78#define TASK_PARKED 0x0040
79#define TASK_WAKEKILL 0x0080 79#define TASK_DEAD 0x0080
80#define TASK_WAKING 0x0100 80#define TASK_WAKEKILL 0x0100
81#define TASK_PARKED 0x0200 81#define TASK_WAKING 0x0200
82#define TASK_NOLOAD 0x0400 82#define TASK_NOLOAD 0x0400
83#define TASK_NEW 0x0800 83#define TASK_NEW 0x0800
84#define TASK_STATE_MAX 0x1000 84#define TASK_STATE_MAX 0x1000
@@ -97,7 +97,8 @@ struct task_group;
97/* get_task_state(): */ 97/* get_task_state(): */
98#define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \ 98#define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \
99 TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \ 99 TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \
100 __TASK_TRACED | EXIT_DEAD | EXIT_ZOMBIE) 100 __TASK_TRACED | EXIT_DEAD | EXIT_ZOMBIE | \
101 TASK_PARKED)
101 102
102#define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) 103#define task_is_traced(task) ((task->state & __TASK_TRACED) != 0)
103 104
@@ -1251,9 +1252,6 @@ static inline unsigned int __get_task_state(struct task_struct *tsk)
1251 1252
1252 BUILD_BUG_ON_NOT_POWER_OF_2(TASK_REPORT_MAX); 1253 BUILD_BUG_ON_NOT_POWER_OF_2(TASK_REPORT_MAX);
1253 1254
1254 if (tsk_state == TASK_PARKED)
1255 state = TASK_INTERRUPTIBLE;
1256
1257 if (tsk_state == TASK_IDLE) 1255 if (tsk_state == TASK_IDLE)
1258 state = TASK_REPORT_IDLE; 1256 state = TASK_REPORT_IDLE;
1259 1257
@@ -1262,7 +1260,7 @@ static inline unsigned int __get_task_state(struct task_struct *tsk)
1262 1260
1263static inline char __task_state_to_char(unsigned int state) 1261static inline char __task_state_to_char(unsigned int state)
1264{ 1262{
1265 static const char state_char[] = "RSDTtXZI"; 1263 static const char state_char[] = "RSDTtXZPI";
1266 1264
1267 BUILD_BUG_ON(1 + ilog2(TASK_REPORT_MAX) != sizeof(state_char) - 1); 1265 BUILD_BUG_ON(1 + ilog2(TASK_REPORT_MAX) != sizeof(state_char) - 1);
1268 1266
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index b371ef8206e1..3c8b7f625670 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -160,7 +160,7 @@ TRACE_EVENT(sched_switch,
160 __print_flags(__entry->prev_state & (TASK_REPORT_MAX - 1), "|", 160 __print_flags(__entry->prev_state & (TASK_REPORT_MAX - 1), "|",
161 { 0x01, "S" }, { 0x02, "D" }, { 0x04, "T" }, 161 { 0x01, "S" }, { 0x02, "D" }, { 0x04, "T" },
162 { 0x08, "t" }, { 0x10, "X" }, { 0x20, "Z" }, 162 { 0x08, "t" }, { 0x10, "X" }, { 0x20, "Z" },
163 { 0x40, "I" }) : 163 { 0x40, "P" }, { 0x80, "I" }) :
164 "R", 164 "R",
165 165
166 __entry->prev_state & TASK_STATE_MAX ? "+" : "", 166 __entry->prev_state & TASK_STATE_MAX ? "+" : "",