xiaoxiang781216 commented on code in PR #7984:
URL: https://github.com/apache/nuttx/pull/7984#discussion_r1062394664


##########
drivers/segger/sysview.c:
##########
@@ -333,16 +237,14 @@ void sched_note_resume(FAR struct tcb_s *tcb)
 #endif
 
 #ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
-void sched_note_irqhandler(int irq, FAR void *handler, bool enter)
+static void note_sysview_irqhandler(FAR struct note_driver_s *drv, int irq,
+                                    FAR void *handler, bool enter)
 {
-  if (!sysview_isenabled_irq(irq, enter))
-    {
-      return;
-    }
+  FAR struct note_sysview_driver_s *driver = drv;

Review Comment:
   need cast



##########
drivers/segger/sysview.c:
##########
@@ -365,63 +267,63 @@ void sched_note_irqhandler(int irq, FAR void *handler, 
bool enter)
             }
         }
 
-      g_sysview.irq[up_cpu_index()] = 0;
+      driver->irq[up_cpu_index()] = 0;
     }
 }
 #endif
 
 #ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
-void sched_note_syscall_enter(int nr, int argc, ...)
+static void note_sysview_syscall_enter(FAR struct note_driver_s *drv, int nr,
+                                       int argc, va_list *ap)
 {
+  FAR struct note_sysview_driver_s *driver = drv;
   nr -= CONFIG_SYS_RESERVED;
 
-  if (sysview_isenabled_syscall(nr) == 0)
-    {
-      return;
-    }
-
   /* Set the name marker if the current syscall nr is not active */
 
-  if (NOTE_FILTER_SYSCALLMASK_ISSET(nr, &g_sysview.syscall_marker) == 0)
+  if (NOTE_FILTER_SYSCALLMASK_ISSET(nr,
+      &driver->syscall_marker) == 0)

Review Comment:
   merge into one line



##########
drivers/segger/sysview.c:
##########
@@ -365,63 +267,63 @@ void sched_note_irqhandler(int irq, FAR void *handler, 
bool enter)
             }
         }
 
-      g_sysview.irq[up_cpu_index()] = 0;
+      driver->irq[up_cpu_index()] = 0;
     }
 }
 #endif
 
 #ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
-void sched_note_syscall_enter(int nr, int argc, ...)
+static void note_sysview_syscall_enter(FAR struct note_driver_s *drv, int nr,
+                                       int argc, va_list *ap)
 {
+  FAR struct note_sysview_driver_s *driver = drv;
   nr -= CONFIG_SYS_RESERVED;
 
-  if (sysview_isenabled_syscall(nr) == 0)
-    {
-      return;
-    }
-
   /* Set the name marker if the current syscall nr is not active */
 
-  if (NOTE_FILTER_SYSCALLMASK_ISSET(nr, &g_sysview.syscall_marker) == 0)
+  if (NOTE_FILTER_SYSCALLMASK_ISSET(nr,
+      &driver->syscall_marker) == 0)
     {
       /* Set the name marker */
 
       SEGGER_SYSVIEW_NameMarker(nr, g_funcnames[nr]);
 
       /* Mark the syscall active */
 
-      NOTE_FILTER_SYSCALLMASK_SET(nr, &g_sysview.syscall_marker);
+      NOTE_FILTER_SYSCALLMASK_SET(nr, &driver->syscall_marker);
 
       /* Use the Syscall "0" to identify whether the syscall is enabled,
        * if the host tool is closed abnormally, use this bit to clear
        * the active set.
        */
 
-      if (NOTE_FILTER_SYSCALLMASK_ISSET(0, &g_sysview.syscall_marker) == 0)
+      if (NOTE_FILTER_SYSCALLMASK_ISSET(0, &driver->syscall_marker) == 0)
         {
-          NOTE_FILTER_SYSCALLMASK_SET(0, &g_sysview.syscall_marker);
+          NOTE_FILTER_SYSCALLMASK_SET(0, &driver->syscall_marker);
         }
     }
 
   SEGGER_SYSVIEW_MarkStart(nr);
 }
 
-void sched_note_syscall_leave(int nr, uintptr_t result)
+static void note_sysview_syscall_leave(FAR struct note_driver_s *drv,
+                                       int nr, uintptr_t result)
 {
+  FAR struct note_sysview_driver_s *driver = drv;

Review Comment:
   cast



##########
drivers/segger/sysview.c:
##########
@@ -365,63 +267,63 @@ void sched_note_irqhandler(int irq, FAR void *handler, 
bool enter)
             }
         }
 
-      g_sysview.irq[up_cpu_index()] = 0;
+      driver->irq[up_cpu_index()] = 0;
     }
 }
 #endif
 
 #ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
-void sched_note_syscall_enter(int nr, int argc, ...)
+static void note_sysview_syscall_enter(FAR struct note_driver_s *drv, int nr,
+                                       int argc, va_list *ap)
 {
+  FAR struct note_sysview_driver_s *driver = drv;
   nr -= CONFIG_SYS_RESERVED;
 
-  if (sysview_isenabled_syscall(nr) == 0)
-    {
-      return;
-    }
-
   /* Set the name marker if the current syscall nr is not active */
 
-  if (NOTE_FILTER_SYSCALLMASK_ISSET(nr, &g_sysview.syscall_marker) == 0)
+  if (NOTE_FILTER_SYSCALLMASK_ISSET(nr,
+      &driver->syscall_marker) == 0)
     {
       /* Set the name marker */
 
       SEGGER_SYSVIEW_NameMarker(nr, g_funcnames[nr]);
 
       /* Mark the syscall active */
 
-      NOTE_FILTER_SYSCALLMASK_SET(nr, &g_sysview.syscall_marker);
+      NOTE_FILTER_SYSCALLMASK_SET(nr, &driver->syscall_marker);
 
       /* Use the Syscall "0" to identify whether the syscall is enabled,
        * if the host tool is closed abnormally, use this bit to clear
        * the active set.
        */
 
-      if (NOTE_FILTER_SYSCALLMASK_ISSET(0, &g_sysview.syscall_marker) == 0)
+      if (NOTE_FILTER_SYSCALLMASK_ISSET(0, &driver->syscall_marker) == 0)
         {
-          NOTE_FILTER_SYSCALLMASK_SET(0, &g_sysview.syscall_marker);
+          NOTE_FILTER_SYSCALLMASK_SET(0, &driver->syscall_marker);
         }
     }
 
   SEGGER_SYSVIEW_MarkStart(nr);
 }
 
-void sched_note_syscall_leave(int nr, uintptr_t result)
+static void note_sysview_syscall_leave(FAR struct note_driver_s *drv,
+                                       int nr, uintptr_t result)
 {
+  FAR struct note_sysview_driver_s *driver = drv;
   nr -= CONFIG_SYS_RESERVED;
 
-  if (sysview_isenabled_syscall(nr) == 0)
-    {
-      return;
-    }
-
-  if (NOTE_FILTER_SYSCALLMASK_ISSET(nr, &g_sysview.syscall_marker) != 0)
+  if (NOTE_FILTER_SYSCALLMASK_ISSET(nr,
+        &driver->syscall_marker) != 0)

Review Comment:
   merge with previous line



##########
drivers/segger/sysview.c:
##########
@@ -365,63 +267,63 @@ void sched_note_irqhandler(int irq, FAR void *handler, 
bool enter)
             }
         }
 
-      g_sysview.irq[up_cpu_index()] = 0;
+      driver->irq[up_cpu_index()] = 0;
     }
 }
 #endif
 
 #ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
-void sched_note_syscall_enter(int nr, int argc, ...)
+static void note_sysview_syscall_enter(FAR struct note_driver_s *drv, int nr,
+                                       int argc, va_list *ap)
 {
+  FAR struct note_sysview_driver_s *driver = drv;

Review Comment:
   add cast



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to