Skip to content

Commit

Permalink
fs/dump: correct SCHED_DUMP_ON_EXIT to DUMP_ON_EXIT
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
anchao committed Sep 18, 2024
1 parent baa716a commit a485bcc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions fs/inode/fs_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -424,6 +425,7 @@ void files_dumplist(FAR struct filelist *list)
);
}
}
#endif

/****************************************************************************
* Name: files_getlist
Expand Down
4 changes: 4 additions & 0 deletions include/nuttx/fs/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions sched/misc/assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit a485bcc

Please sign in to comment.