sched/logging: add task activation/exit logs

Task activation/exit logs are helpful for device bringup,
especially when user space nsh prompt doesn't show up.

Putting them here will allow cleaning of logs in multiple
up_exit() functions  later.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
Yanfeng Liu 2024-01-14 16:43:11 +08:00 committed by Xiang Xiao
parent 3c327efd2f
commit f280c33311
2 changed files with 15 additions and 0 deletions

View File

@ -84,6 +84,13 @@ void nxtask_activate(FAR struct tcb_s *tcb)
nxsched_remove_blocked(tcb);
#if CONFIG_TASK_NAME_SIZE > 0
sinfo("%s pid=%d,TCB=%p\n", tcb->name,
#else
sinfo("pid=%d,TCB=%p\n",
#endif
tcb->pid, tcb);
/* Add the task to ready-to-run task list, and
* perform the context switch if one is needed
*/

View File

@ -25,6 +25,7 @@
#include <nuttx/config.h>
#include <sched.h>
#include <debug.h>
#include "sched/sched.h"
@ -88,6 +89,13 @@ int nxtask_exit(void)
dtcb = this_task();
#endif
#if CONFIG_TASK_NAME_SIZE > 0
sinfo("%s pid=%d,TCB=%p\n", dtcb->name,
#else
sinfo("pid=%d,TCB=%p\n",
#endif
dtcb->pid, dtcb);
/* Update scheduler parameters */
nxsched_suspend_scheduler(dtcb);