This is an automated email from the ASF dual-hosted git repository. GUIDINGLI pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 4a5ed9876fa69c0d7911ee4b5365c3d99cfbe662 Author: Bowen Wang <[email protected]> AuthorDate: Thu May 21 20:36:59 2026 +0800 sched/assert: add CONFIG_SCHED_DUMP_FDLIST for fd list dump The dump_fdlist in assert was guarded by CONFIG_SCHED_DUMP_ON_EXIT which is semantically unrelated. Add a dedicated Kconfig option CONFIG_SCHED_DUMP_FDLIST to control fd list dumping on assert. Signed-off-by: Bowen Wang <[email protected]> --- fs/inode/fs_files.c | 2 +- include/nuttx/fs/fs.h | 2 +- sched/Kconfig | 6 ++++++ sched/misc/assert.c | 4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/fs/inode/fs_files.c b/fs/inode/fs_files.c index 617c1cd6aa3..016e1045edc 100644 --- a/fs/inode/fs_files.c +++ b/fs/inode/fs_files.c @@ -399,7 +399,7 @@ void fdlist_init(FAR struct fdlist *list) * ****************************************************************************/ -#ifdef CONFIG_SCHED_DUMP_ON_EXIT +#ifdef CONFIG_SCHED_DUMP_FDLIST void fdlist_dump(FAR struct fdlist *list) { FAR char *path; diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h index 9b0ada54d9d..8ca466e3513 100644 --- a/include/nuttx/fs/fs.h +++ b/include/nuttx/fs/fs.h @@ -910,7 +910,7 @@ void fdlist_init(FAR struct fdlist *list); * ****************************************************************************/ -#ifdef CONFIG_SCHED_DUMP_ON_EXIT +#ifdef CONFIG_SCHED_DUMP_FDLIST void fdlist_dump(FAR struct fdlist *list); #else # define fdlist_dump(l) diff --git a/sched/Kconfig b/sched/Kconfig index 9c43a9f7c5f..330e90a38c3 100644 --- a/sched/Kconfig +++ b/sched/Kconfig @@ -890,6 +890,12 @@ config SCHED_DUMP_ON_EXIT ---help--- Dump all tasks state on exit() +config SCHED_DUMP_FDLIST + bool "Dump fd list on assert" + default n + ---help--- + Dump all tasks fd list when assert is triggered. + config SCHED_USER_IDENTITY bool "Support per-task User Identity" default n diff --git a/sched/misc/assert.c b/sched/misc/assert.c index e1f66056616..d6fc372d044 100644 --- a/sched/misc/assert.c +++ b/sched/misc/assert.c @@ -491,7 +491,7 @@ static void dump_backtrace(FAR struct tcb_s *tcb, FAR void *arg) * Name: dump_filelist ****************************************************************************/ -#ifdef CONFIG_SCHED_DUMP_ON_EXIT +#ifdef CONFIG_SCHED_DUMP_FDLIST static void dump_fdlist(FAR struct tcb_s *tcb, FAR void *arg) { FAR struct fdlist *list = &tcb->group->tg_fdlist; @@ -584,7 +584,7 @@ static void dump_tasks(void) nxsched_foreach(dump_backtrace, NULL); #endif -#ifdef CONFIG_SCHED_DUMP_ON_EXIT +#ifdef CONFIG_SCHED_DUMP_FDLIST nxsched_foreach(dump_fdlist, NULL); #endif }
