From f280c3331112b4230a49ec96e4412602e5ada1ba Mon Sep 17 00:00:00 2001 From: Yanfeng Liu Date: Sun, 14 Jan 2024 16:43:11 +0800 Subject: [PATCH] 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 --- sched/task/task_activate.c | 7 +++++++ sched/task/task_exit.c | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/sched/task/task_activate.c b/sched/task/task_activate.c index 7fb6496183..564403d20d 100644 --- a/sched/task/task_activate.c +++ b/sched/task/task_activate.c @@ -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 */ diff --git a/sched/task/task_exit.c b/sched/task/task_exit.c index 02a5c83064..28272f6308 100644 --- a/sched/task/task_exit.c +++ b/sched/task/task_exit.c @@ -25,6 +25,7 @@ #include #include +#include #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);