summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorCarsten Emde <C.Emde@osadl.org>2010-02-24 09:51:14 +0100
committerThomas Gleixner <tglx@linutronix.de>2010-02-24 12:10:52 +0100
commitd740a0190499992ffc6fca56922b1771bdb77189 (patch)
tree5d59b70e83c8cb8746a7d059def052fbfddcfbd1 /fs
parent18efbf5b5a41937fa7dd3839a3a8a42fda538cf1 (diff)
downloadlwn-d740a0190499992ffc6fca56922b1771bdb77189.tar.gz
lwn-d740a0190499992ffc6fca56922b1771bdb77189.zip
sched: Fix taskstates in sched_switch and proc
The sched_switch trace event displays erroneous character codes of task states, after a new task state was added in the scheduler code but omitted to add in the trace event code. Define character codes of task states individually. In addition, define task state descriptions needed in /proc at the same place. This will help to keep the task state bits, characters and descriptions in sync should they ever need to be changed again. Signed-off-by: Carsten Emde <C.Emde@osadl.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/array.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 3dc90164e8a1..768d3e2d1087 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -129,22 +129,23 @@ static inline void task_name(struct seq_file *m, struct task_struct *p)
/*
* The task state array is a strange "bitmap" of
- * reasons to sleep. Thus "running" is zero, and
- * you can test for combinations of others with
+ * reasons to sleep. Thus, the first element is zero,
+ * and you can test for combinations of others with
* simple bit tests.
*/
+#define TASK_STATE_X(num) TASK_STATE_##num " (" DESCR_TASK_STATE_##num ")"
static const char *task_state_array[] = {
- "R (running)", /* 0 */
- "M (running-mutex)", /* 1 */
- "S (sleeping)", /* 2 */
- "D (disk sleep)", /* 4 */
- "T (stopped)", /* 8 */
- "t (tracing stop)", /* 16 */
- "Z (zombie)", /* 32 */
- "X (dead)", /* 64 */
- "x (dead)", /* 128 */
- "K (wakekill)", /* 256 */
- "W (waking)", /* 512 */
+ TASK_STATE_X(0),
+ TASK_STATE_X(1),
+ TASK_STATE_X(2),
+ TASK_STATE_X(4),
+ TASK_STATE_X(8),
+ TASK_STATE_X(16),
+ TASK_STATE_X(32),
+ TASK_STATE_X(64),
+ TASK_STATE_X(128),
+ TASK_STATE_X(256),
+ TASK_STATE_X(512)
};
static inline const char *get_task_state(struct task_struct *tsk)