From d8304979b455fce5d499df48ea78ce15e8596708 Mon Sep 17 00:00:00 2001 From: wangchengdong Date: Thu, 30 Oct 2025 09:11:13 +0800 Subject: [PATCH] tools/nxgdb: Add gdb and statenames for TSTATE_WAIT_EVENT This patch add new taskstate entry in tools/pynuttx/nxgdb/thread.py and in sched_get_stateinfo.c/g_statenames for the new added task state: TSTATE_WAIT_EVENT test log is: nsh> ps PID PPID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK STACK USED FILLED COMMAND 0 0 0 0 FIFO Kthread - Ready 0000000000000000 0001008 0000196 19.4% Idle_Task 1 0 0 192 FIFO Kthread - Waiting Semaphore 0000000000000000 0001984 0000016 0.8% hpwork 0x70000100 0x7000014c 2 0 2 100 FIFO Task - Running 0000000000000000 0002008 0000740 36.8% nsh_main 4 0 0 100 FIFO Kthread - Waiting Event 0000000000000000 0000984 0000012 1.2% event_wait_task Signed-off-by: Chengdong Wang wangchengdong@lixiang.com --- sched/sched/sched_get_stateinfo.c | 3 +++ tools/pynuttx/nxgdb/thread.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/sched/sched/sched_get_stateinfo.c b/sched/sched/sched_get_stateinfo.c index 1d7d2c5575b..024a7afa169 100644 --- a/sched/sched/sched_get_stateinfo.c +++ b/sched/sched/sched_get_stateinfo.c @@ -51,6 +51,9 @@ static FAR const char * const g_statenames[] = "Inactive", "Waiting,Semaphore", "Waiting,Signal" +#ifdef CONFIG_SCHED_EVENTS + , "Waiting,Event" +#endif #if !defined(CONFIG_DISABLE_MQUEUE) || !defined(CONFIG_DISABLE_MQUEUE_SYSV) , "Waiting,MQ empty" , "Waiting,MQ full" diff --git a/tools/pynuttx/nxgdb/thread.py b/tools/pynuttx/nxgdb/thread.py index c2fc9413c6b..1e45a307acf 100644 --- a/tools/pynuttx/nxgdb/thread.py +++ b/tools/pynuttx/nxgdb/thread.py @@ -435,6 +435,8 @@ class TaskState(Enum): Inactive = auto() Waiting_Semaphore = auto() Waiting_Signal = auto() + if utils.get_symbol_value("CONFIG_SCHED_EVENTS"): + Waiting_Event = auto() if not utils.get_symbol_value( "CONFIG_DISABLE_MQUEUE" ) or not utils.get_symbol_value("CONFIG_DISABLE_MQUEUE_SYSV"):