This is an automated email from the ASF dual-hosted git repository. GUIDINGLI pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit b5a8c205b12c36e38ecb5c847fcd583593e080ef Author: yinshengkai <[email protected]> AuthorDate: Tue Nov 19 12:33:41 2024 +0800 note: use g_running_tasks to replace this_task Instrumentation is performed when the thread exits, and this_task points to the task that will be run, but the thread switching is not completed at this time, and we expect to get the running task Signed-off-by: yinshengkai <[email protected]> --- drivers/note/note_driver.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/note/note_driver.c b/drivers/note/note_driver.c index 2e8027c5caf..c978e9387c0 100644 --- a/drivers/note/note_driver.c +++ b/drivers/note/note_driver.c @@ -1238,7 +1238,7 @@ void sched_note_syscall_enter(int nr, int argc, ...) struct note_syscall_enter_s note; FAR struct note_driver_s **driver; bool formatted = false; - FAR struct tcb_s *tcb = this_task(); + FAR struct tcb_s *tcb = running_task(); unsigned int length = 0; uintptr_t arg; va_list ap; @@ -1328,7 +1328,7 @@ void sched_note_syscall_leave(int nr, uintptr_t result) struct note_syscall_leave_s note; FAR struct note_driver_s **driver; bool formatted = false; - FAR struct tcb_s *tcb = this_task(); + FAR struct tcb_s *tcb = running_task(); for (driver = g_note_drivers; *driver; driver++) { @@ -1373,7 +1373,7 @@ void sched_note_irqhandler(int irq, FAR void *handler, bool enter) struct note_irqhandler_s note; FAR struct note_driver_s **driver; bool formatted = false; - FAR struct tcb_s *tcb = this_task(); + FAR struct tcb_s *tcb = running_task(); for (driver = g_note_drivers; *driver; driver++) { @@ -1455,7 +1455,7 @@ void sched_note_heap(uint8_t event, FAR void *heap, FAR void *mem, FAR struct note_driver_s **driver; struct note_heap_s note; bool formatted = false; - FAR struct tcb_s *tcb = this_task(); + FAR struct tcb_s *tcb = running_task(); for (driver = g_note_drivers; *driver; driver++) { @@ -1500,7 +1500,7 @@ void sched_note_event_ip(uint32_t tag, uintptr_t ip, uint8_t event, bool formatted = false; char data[256]; unsigned int length; - FAR struct tcb_s *tcb = this_task(); + FAR struct tcb_s *tcb = running_task(); for (driver = g_note_drivers; *driver; driver++) { @@ -1554,7 +1554,7 @@ void sched_note_vprintf_ip(uint32_t tag, uintptr_t ip, FAR const char *fmt, bool formatted = false; uint8_t data[256]; size_t length = 0; - FAR struct tcb_s *tcb = this_task(); + FAR struct tcb_s *tcb = running_task(); for (driver = g_note_drivers; *driver; driver++) {
