xiaoxiang781216 commented on a change in pull request #1377:
URL: https://github.com/apache/incubator-nuttx/pull/1377#discussion_r499261032



##########
File path: drivers/note/Kconfig
##########
@@ -55,6 +55,14 @@ config DRIVER_NOTERAM_BUFSIZE
        ---help---
                The size of the in-memory, circular instrumentation buffer (in 
bytes).
 
+config DRIVER_NOTERAM_DEFAULT_NOOVERWRITE
+       bool "Disable overwrite by default"
+       default n

Review comment:
       depend on DRIVER_NOTERAM?

##########
File path: sched/Kconfig
##########
@@ -1000,6 +1000,15 @@ config SCHED_INSTRUMENTATION_FILTER
                The filter logic can be configured by sched_note_filter APIs 
defined in
                include/nuttx/sched_note.h.
 
+config SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE
+       hex "Default instrumentation filter mode"
+       default 0
+       ---help---
+               Default mode of the instrumentation filter logic.
+                       Bit 0 = Enable instrumentation
+                       Bit 1 = Enable syscall instrumentation
+                       Bit 3 = Enable IRQ instrumentation

Review comment:
       should we change NOTE_FILTER_MODE_FLAG_IRQ to:
   ```
   #define NOTE_FILTER_MODE_FLAG_IRQ          (1 << 2) /* Enable IRQ 
instrumentaiton */
   ``

##########
File path: sched/Kconfig
##########
@@ -1000,6 +1000,15 @@ config SCHED_INSTRUMENTATION_FILTER
                The filter logic can be configured by sched_note_filter APIs 
defined in
                include/nuttx/sched_note.h.
 
+config SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE
+       hex "Default instrumentation filter mode"
+       default 0

Review comment:
       change 0 to 7 to keep the default behaviour same as before?

##########
File path: sched/sched/sched_note.c
##########
@@ -100,6 +133,150 @@ static void note_common(FAR struct tcb_s *tcb,
   note->nc_systime[3] = (uint8_t)((systime >> 24) & 0xff);
 }
 
+/****************************************************************************
+ * Name: note_isenabled
+ *
+ * Description:
+ *   Check whether the instrumentation is enabled.
+ *
+ * Input Parameters:
+ *   None
+ *
+ * Returned Value:
+ *   True is returned if the instrumentation is enabled.
+ *
+ ****************************************************************************/
+
+static inline int note_isenabled(void)
+{
+#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
+  if (!(g_note_filter.mode.flag & NOTE_FILTER_MODE_FLAG_ENABLE))
+    {
+      return false;
+    }
+
+#ifdef CONFIG_SMP
+  /* Ignore notes that are not in the set of monitored CPUs */
+
+  if ((g_note_filter.mode.cpuset & (1 << this_cpu())) == 0)
+    {
+      /* Not in the set of monitored CPUs.  Do not log the note. */
+
+      return false;
+    }
+#endif
+#endif
+
+  return true;
+}
+
+/****************************************************************************
+ * Name: note_isenabled_syscall
+ *
+ * Description:
+ *   Check whether the syscall instrumentation is enabled.
+ *
+ * Input Parameters:
+ *   nr - syscall number
+ *
+ * Returned Value:
+ *   True is returned if the instrumentation is enabled.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
+static inline int note_isenabled_syscall(int nr)
+{
+  if (!note_isenabled())
+    {
+      return false;
+    }
+
+#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER

Review comment:
       move before line 190 just like note_isenabled_irqhandler?




----------------------------------------------------------------
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.

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


Reply via email to