This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch releases/12.7
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit f3d611928249889c969c963a450c5a9faad790ed
Author: xuxingliang <[email protected]>
AuthorDate: Tue Jul 9 18:05:53 2024 +0800

    sched/note: add wdog note for segger sysview
    
    Signed-off-by: xuxingliang <[email protected]>
---
 drivers/segger/note_sysview.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/segger/note_sysview.c b/drivers/segger/note_sysview.c
index a00dcbe8e1..a783925fde 100644
--- a/drivers/segger/note_sysview.c
+++ b/drivers/segger/note_sysview.c
@@ -79,6 +79,10 @@ static void note_sysview_heap(FAR struct note_driver_s *drv,
                               uint8_t event, FAR void *heap, FAR void *mem,
                               size_t size, size_t curused);
 #endif
+#ifdef CONFIG_SCHED_INSTRUMENTATION_WDOG
+static void note_sysview_wdog(FAR struct note_driver_s *drv, uint8_t event,
+                              FAR void *handler, FAR const void *arg);
+#endif
 
 /****************************************************************************
  * Private Data
@@ -120,7 +124,7 @@ static const struct note_driver_ops_s g_note_sysview_ops =
   note_sysview_irqhandler,    /* irqhandler */
 #endif
 #ifdef CONFIG_SCHED_INSTRUMENTATION_WDOG
-  NULL,                       /* wdog */
+  note_sysview_wdog,          /* wdog */
 #endif
 #ifdef CONFIG_SCHED_INSTRUMENTATION_HEAP
   note_sysview_heap,          /* heap */
@@ -389,6 +393,21 @@ static void note_sysview_heap(FAR struct note_driver_s 
*drv,
 }
 #endif
 
+#ifdef CONFIG_SCHED_INSTRUMENTATION_WDOG
+static void note_sysview_wdog(FAR struct note_driver_s *drv, uint8_t event,
+                              FAR void *handler, FAR const void *arg)
+{
+  if (event == NOTE_WDOG_ENTER)
+    {
+      SEGGER_SYSVIEW_RecordEnterTimer((uintptr_t)handler);
+    }
+  else if (event == NOTE_WDOG_LEAVE)
+    {
+      SEGGER_SYSVIEW_RecordExitTimer();
+    }
+}
+#endif
+
 /****************************************************************************
  * Public Functions
  ****************************************************************************/

Reply via email to