diff mbox series

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

Message ID 20241025074247.1157166-3-rostedt@goodmis.org (mailing list archive)
State New
Headers show
Series libtraceeval: Updates | expand

Commit Message

Steven Rostedt Oct. 25, 2024, 7:40 a.m. UTC
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

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) <rostedt@goodmis.org>
---
 samples/task-eval.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

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;
 }