[PATCH 2/4] libtraceeval samples: Add PARKED and DEAD fields

Steven Rostedt <[email protected]>
Newsgroups org.kernel.vger.linux-trace-devel
Message-ID <[email protected]>
From: "Steven Rostedt (Google)" <[email protected]>

get_stop_state() was returning PREEMPT when a task was really in the
PARKED or DEAD state. Check those as well.

Signed-off-by: Steven Rostedt (Google) <[email protected]>
---
 samples/task-eval.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/samples/task-eval.c b/samples/task-eval.c
index 7b709f715332..47ccce8e4737 100644
--- a/samples/task-eval.c
+++ b/samples/task-eval.c
@@ -91,7 +91,9 @@ enum sched_state {
 	SLEEP,
 	IDLE,
 	ZOMBIE,
+	PARKED,
 	EXITED,
+	DEAD,
 	OTHER,
 	WAKEUP,
 };
@@ -749,6 +751,10 @@ static int get_stop_state(unsigned long long val)
 		return ZOMBIE;
 	if (val & 0x20)
 		return EXITED;
+	if (val & 0x40)
+		return PARKED;
+	if (val & 0x80)
+		return DEAD;
 	return PREEMPT;
 }
 
-- 
2.45.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.