Skip to contentSkip to conversation

ftrace: make the task state char-string visible to all

PATCH In review Ingo Molnar 1 participant 1 message Feb 10, 2008 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 5/19 ftrace: make the task state char-string visible to all

From: Steven Rostedt <[email protected]>

The tracer wants to be able to convert the state number into a user visible character. This patch pulls that conversion string out the scheduler into the header. This way if it were to ever change, other parts of the kernel will know.

---
 include/linux/sched.h |    2 ++
 kernel/sched.c        |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
include/linux/sched.h +2 -0
Index: linux/include/linux/sched.h
===================================================================
@@ -2117,6 +2117,8 @@ static inline void migration_init(void)
 #define TASK_SIZE_OF(tsk)	TASK_SIZE
 #endif
 
+#define TASK_STATE_TO_CHAR_STR "RSDTtZX"
+
 #endif /* __KERNEL__ */
 
 #endif
kernel/sched.c +1 -1
Index: linux/kernel/sched.c
===================================================================
@@ -5154,7 +5154,7 @@ out_unlock:
 	return retval;
 }
 
-static const char stat_nam[] = "RSDTtZX";
+static const char stat_nam[] = TASK_STATE_TO_CHAR_STR;
 
 void sched_show_task(struct task_struct *p)
 {