From 624fc5a9b8b1f1500f199fb594ab337ce2552d5f Mon Sep 17 00:00:00 2001 From: yinshengkai Date: Tue, 25 Jun 2024 11:33:47 +0800 Subject: [PATCH] sched: support dumping all file information during assert Signed-off-by: yinshengkai --- sched/misc/assert.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sched/misc/assert.c b/sched/misc/assert.c index ea0910046e..31419abaec 100644 --- a/sched/misc/assert.c +++ b/sched/misc/assert.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -414,6 +415,18 @@ static void dump_backtrace(FAR struct tcb_s *tcb, FAR void *arg) } #endif +/**************************************************************************** + * Name: dump_filelist + ****************************************************************************/ + +#ifdef CONFIG_SCHED_DUMP_ON_EXIT +static void dump_filelist(FAR struct tcb_s *tcb, FAR void *arg) +{ + FAR struct filelist *filelist = &tcb->group->tg_filelist; + files_dumplist(filelist); +} +#endif + /**************************************************************************** * Name: dump_tasks ****************************************************************************/ @@ -495,6 +508,10 @@ static void dump_tasks(void) #ifdef CONFIG_SCHED_BACKTRACE nxsched_foreach(dump_backtrace, NULL); #endif + +#ifdef CONFIG_SCHED_DUMP_ON_EXIT + nxsched_foreach(dump_filelist, NULL); +#endif } /****************************************************************************