From a485bcc54bc7202b11b7f60266b7f9d81983fe98 Mon Sep 17 00:00:00 2001 From: chao an Date: Wed, 18 Sep 2024 16:41:12 +0800 Subject: [PATCH] fs/dump: correct SCHED_DUMP_ON_EXIT to DUMP_ON_EXIT 1. correct SCHED_DUMP_ON_EXIT to DUMP_ON_EXIT 2. dump file list only if DUMP_ON_EXIT enabled Signed-off-by: chao an --- fs/inode/fs_files.c | 2 ++ include/nuttx/fs/fs.h | 4 ++++ sched/misc/assert.c | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/inode/fs_files.c b/fs/inode/fs_files.c index ea8fc30241538..2a01978acb925 100644 --- a/fs/inode/fs_files.c +++ b/fs/inode/fs_files.c @@ -372,6 +372,7 @@ void files_initlist(FAR struct filelist *list) * ****************************************************************************/ +#ifdef CONFIG_DUMP_ON_EXIT void files_dumplist(FAR struct filelist *list) { int count = files_countlist(list); @@ -424,6 +425,7 @@ void files_dumplist(FAR struct filelist *list) ); } } +#endif /**************************************************************************** * Name: files_getlist diff --git a/include/nuttx/fs/fs.h b/include/nuttx/fs/fs.h index 14a6b2280e586..ac20d38b12052 100644 --- a/include/nuttx/fs/fs.h +++ b/include/nuttx/fs/fs.h @@ -877,7 +877,11 @@ void files_initlist(FAR struct filelist *list); * ****************************************************************************/ +#ifdef CONFIG_DUMP_ON_EXIT void files_dumplist(FAR struct filelist *list); +#else +# define files_dumplist(l) +#endif /**************************************************************************** * Name: files_getlist diff --git a/sched/misc/assert.c b/sched/misc/assert.c index ebd7aad71b550..fb9c1a91077c5 100644 --- a/sched/misc/assert.c +++ b/sched/misc/assert.c @@ -422,7 +422,7 @@ static void dump_backtrace(FAR struct tcb_s *tcb, FAR void *arg) * Name: dump_filelist ****************************************************************************/ -#ifdef CONFIG_SCHED_DUMP_ON_EXIT +#ifdef CONFIG_DUMP_ON_EXIT static void dump_filelist(FAR struct tcb_s *tcb, FAR void *arg) { FAR struct filelist *filelist = &tcb->group->tg_filelist; @@ -512,7 +512,7 @@ static void dump_tasks(void) nxsched_foreach(dump_backtrace, NULL); #endif -#ifdef CONFIG_SCHED_DUMP_ON_EXIT +#ifdef CONFIG_DUMP_ON_EXIT nxsched_foreach(dump_filelist, NULL); #endif }