All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-trace-devel@vger.kernel.org
Cc: Ross Zwisler <zwisler@google.com>,
	"Steven Rostedt (Google)" <rostedt@goodmis.org>
Subject: [PATCH 05/11] libtraceeval task-eval: Account for ZOMBIE and EXITED states
Date: Tue, 10 Oct 2023 23:25:21 -0400	[thread overview]
Message-ID: <20231011032640.1804571-6-rostedt@goodmis.org> (raw)
In-Reply-To: <20231011032640.1804571-1-rostedt@goodmis.org>

From: "Steven Rostedt (Google)" <rostedt@goodmis.org>

Currently, if a sched_switch happens with a task in he ZOMBIE or EXITED
state, task-eval will treat it as being preempted in a running state. This
is incorrect, and should be updated to reflect it.

Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
 samples/task-eval.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/samples/task-eval.c b/samples/task-eval.c
index 40e7345a27c4..061d27374e66 100644
--- a/samples/task-eval.c
+++ b/samples/task-eval.c
@@ -254,6 +254,8 @@ enum sched_state {
 	PREEMPT,
 	SLEEP,
 	IDLE,
+	ZOMBIE,
+	EXITED,
 	OTHER
 };
 
@@ -474,6 +476,10 @@ static int get_stop_state(unsigned long long val)
 		return SLEEP;
 	if (val & 2)
 		return BLOCKED;
+	if (val & 0x10)
+		return ZOMBIE;
+	if (val & 0x20)
+		return EXITED;
 	return PREEMPT;
 }
 
-- 
2.42.0


  parent reply	other threads:[~2023-10-11  3:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11  3:25 [PATCH 00/11] libtraceeval task-eval: Updates to evaluate tasks Steven Rostedt
2023-10-11  3:25 ` [PATCH 01/11] libtraceeval task-eval: Fix naming conventions of variables Steven Rostedt
2023-10-11  3:25 ` [PATCH 02/11] libtraceeval task-eval: Use "assign_*keys/vals()" helper functions Steven Rostedt
2023-10-11  3:25 ` [PATCH 03/11] libtraceeval task-eval: Add tracking of priority Steven Rostedt
2023-10-11  3:25 ` [PATCH 04/11] libtraceeval task-eval: Add way to read trace.dat buffer instances Steven Rostedt
2023-10-11  3:25 ` Steven Rostedt [this message]
2023-10-11  3:25 ` [PATCH 06/11] libtraceeval task-eval: Show max, min and count of deltas too Steven Rostedt
2023-10-11  3:25 ` [PATCH 07/11] libtraceeval task-eval: Add more comments Steven Rostedt
2023-10-11  3:25 ` [PATCH 08/11] libtraceeval task-eval: Only release results if found Steven Rostedt
2023-10-11  3:25 ` [PATCH 09/11] libtraceeval task-eval: Do not add pdata to non RUNNING tasks Steven Rostedt
2023-10-11  3:25 ` [PATCH 10/11] libtraceveal task-eval: Clean up all traceeval_iterators Steven Rostedt
2023-10-11  3:25 ` [PATCH 11/11] libtraceeval task-evals: Free the libtraceevals Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231011032640.1804571-6-rostedt@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=zwisler@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.