You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/06/27 15:32:33 UTC

[GitHub] [incubator-nuttx] acassis commented on a change in pull request #3983: arch/sim: Implement mm_mallinfo and malloc_size for the custom heap

acassis commented on a change in pull request #3983:
URL: https://github.com/apache/incubator-nuttx/pull/3983#discussion_r659338630



##########
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:
       @xiaoxiang781216 shouldn't this buffer size be configurable? Seams too big for low-end microcontrollers




-- 
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-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org