This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new f280c33311 sched/logging: add task activation/exit logs
f280c33311 is described below
commit f280c3331112b4230a49ec96e4412602e5ada1ba
Author: Yanfeng Liu <[email protected]>
AuthorDate: Sun Jan 14 16:43:11 2024 +0800
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 <[email protected]>
---
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 <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);