xiaoxiang781216 commented on a change in pull request #3983: URL: https://github.com/apache/incubator-nuttx/pull/3983#discussion_r659341832
########## File path: drivers/note/notelog_driver.c ########## @@ -189,3 +260,131 @@ void sched_note_csection(FAR struct tcb_s *tcb, bool enter) #endif } #endif + +#ifdef CONFIG_SCHED_INSTRUMENTATION_SPINLOCKS +void sched_note_spinlock(FAR struct tcb_s *tcb, + FAR volatile void *spinlock) +{ +#ifdef CONFIG_SMP +#if CONFIG_TASK_NAME_SIZE > 0 + syslog(LOG_INFO, "CPU%d: Task %s TCB@%p spinlock@%p LOCK\n", + tcb->cpu, tcb->name, tcb, spinlock); +#else + syslog(LOG_INFO, "CPU%d: TCB@%p spinlock@%p LOCK\n", + tcb->cpu, tcb, spinlock); +#endif +#else +#if CONFIG_TASK_NAME_SIZE > 0 + syslog(LOG_INFO, "Task %s TCB@%p spinlock@%p LOCK\n", + tcb->name, tcb, spinlock); +#else + syslog(LOG_INFO, "TCB@%p spinlock@%p LOCK\n", + tcb, spinlock); +#endif +#endif +} + +void sched_note_spinlocked(FAR struct tcb_s *tcb, + FAR volatile void *spinlock) +{ +#ifdef CONFIG_SMP +#if CONFIG_TASK_NAME_SIZE > 0 + syslog(LOG_INFO, "CPU%d: Task %s TCB@%p spinlock@%p LOCKED\n", + tcb->cpu, tcb->name, tcb, spinlock); +#else + syslog(LOG_INFO, "CPU%d: TCB@%p spinlock@%p LOCKED\n", + tcb->cpu, tcb, spinlock); +#endif +#else +#if CONFIG_TASK_NAME_SIZE > 0 + syslog(LOG_INFO, "Task %s TCB@%p spinlock@%p LOCKED\n", + tcb->name, tcb, spinlock); +#else + syslog(LOG_INFO, "TCB@%p spinlock@%p LOCKED\n", + tcb, spinlock); +#endif +#endif +} + +void sched_note_spinunlock(FAR struct tcb_s *tcb, + FAR volatile void *spinlock) +{ +#ifdef CONFIG_SMP +#if CONFIG_TASK_NAME_SIZE > 0 + syslog(LOG_INFO, "CPU%d: Task %s TCB@%p spinlock@%p UNLOCK\n", + tcb->cpu, tcb->name, tcb, spinlock); +#else + syslog(LOG_INFO, "CPU%d: TCB@%p spinlock@%p UNLOCK\n", + tcb->cpu, tcb, spinlock); +#endif +#else +#if CONFIG_TASK_NAME_SIZE > 0 + syslog(LOG_INFO, "Task %s TCB@%p spinlock@%p UNLOCK\n", + tcb->name, tcb, spinlock); +#else + syslog(LOG_INFO, "TCB@%p spinlock@%p UNLOCK\n", + tcb, spinlock); +#endif +#endif +} + +void sched_note_spinabort(FAR struct tcb_s *tcb, + FAR volatile void *spinlock) +{ +#ifdef CONFIG_SMP +#if CONFIG_TASK_NAME_SIZE > 0 + syslog(LOG_INFO, "CPU%d: Task %s TCB@%p spinlock@%p ABORT\n", + tcb->cpu, tcb->name, tcb, spinlock); +#else + syslog(LOG_INFO, "CPU%d: TCB@%p spinlock@%p ABORT\n", + tcb->cpu, tcb, spinlock); +#endif +#else +#if CONFIG_TASK_NAME_SIZE > 0 + syslog(LOG_INFO, "Task %s TCB@%p spinlock@%p ABORT\n", + tcb->name, tcb, spinlock); +#else + syslog(LOG_INFO, "TCB@%p spinlock@%p ABORT\n", + tcb, spinlock); +#endif +#endif +} +#endif + +#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL +void sched_note_syscall_enter(int nr, int argc, ...) +{ + char buf[256]; Review comment: Ok, the buffer is changed to 128B, which is enough to hold 8 ponter dump. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org