perf sched: sync task state macros with kernel

Message ID 20230329035203.6194-1-zegao2021@gmail.com
State New
Headers
Series perf sched: sync task state macros with kernel |

Commit Message

Ze Gao March 29, 2023, 3:52 a.m. UTC
  commit 8ef9925b02c2 ("sched/debug: Add explicit TASK_PARKED printing")
changes some task state macros, this patch makes perf-sched in sync

Fixes: 8ef9925b02c2 ("sched/debug: Add explicit TASK_PARKED printing")
Signed-off-by: Ze Gao <zegao2021@gmail.com>
---
 tools/perf/builtin-sched.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Peter Zijlstra March 29, 2023, 7:11 a.m. UTC | #1
On Wed, Mar 29, 2023 at 11:52:02AM +0800, Ze Gao wrote:
> commit 8ef9925b02c2 ("sched/debug: Add explicit TASK_PARKED printing")
> changes some task state macros, this patch makes perf-sched in sync
> 

Why does perf care? Where do we export raw state values?

That is, I really don't like this being ABI...
  

Patch

diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c
index 86e18575c9be..c715593d88c4 100644
--- a/tools/perf/builtin-sched.c
+++ b/tools/perf/builtin-sched.c
@@ -105,10 +105,10 @@  struct sched_atom {
 #define EXIT_ZOMBIE		32
 #define EXIT_TRACE		(EXIT_ZOMBIE | EXIT_DEAD)
 /* in tsk->state again */
-#define TASK_DEAD		64
-#define TASK_WAKEKILL		128
-#define TASK_WAKING		256
-#define TASK_PARKED		512
+#define TASK_PARKED		64
+#define TASK_DEAD		128
+#define TASK_WAKEKILL		256
+#define TASK_WAKING		512
 
 enum thread_state {
 	THREAD_SLEEPING = 0,