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


##########
include/nuttx/sched_note.h:
##########
@@ -205,6 +251,27 @@ enum note_type_e
 #endif
 };
 
+enum note_tag_e
+{
+  NOTE_TAG_ALWAYS = 0,
+  NOTE_TAG_ARCH,
+  NOTE_TAG_APP,
+  NOTE_TAG_AUDIO,
+  NOTE_TAG_BOARD,
+  NOTE_TAG_CRYPTO,
+  NOTE_TAG_DRIVERS,
+  NOTE_TAG_FS,
+  NOTE_TAG_MM,
+  NOTE_TAG_NETWORK,

Review Comment:
   NOTE_TAG_NET



##########
include/nuttx/sched_note.h:
##########
@@ -439,6 +506,13 @@ struct note_filter_irq_s
 };
 #endif
 
+#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
+struct note_filter_dump_s

Review Comment:
   tag



##########
include/nuttx/sched_note.h:
##########
@@ -673,16 +747,16 @@ void sched_note_filter_irq(FAR struct note_filter_irq_s 
*oldf,
 #  define sched_note_syscall_enter(n,a,...)
 #  define sched_note_syscall_leave(n,r)
 #  define sched_note_irqhandler(i,h,e)
-#  define sched_note_string(ip,b)
-#  define sched_note_dump(ip,e,b,l)
-#  define sched_note_vprintf(ip,f,v)
-#  define sched_note_vbprintf(ip,e,f,v)
-#  define sched_note_printf(ip,f,...)
-#  define sched_note_bprintf(ip,e,f,...)
+#  define sched_note_string(t,ip,b)
+#  define sched_note_dump(t,ip,e,b,l)
+#  define sched_note_vprintf(t,ip,f,v)
+#  define sched_note_vbprintf(t,ip,e,f,v)
+#  define sched_note_printf(t,ip,f,...)
+#  define sched_note_bprintf(t,ip,e,f,...)
 
 #endif /* CONFIG_SCHED_INSTRUMENTATION */
 
-#define sched_note_begin(ip) sched_note_string(ip, "B")
-#define sched_note_end(ip) sched_note_string(ip, "E")
+#define sched_note_begin(tag, ip) sched_note_string(NOTE_TAG_ALWAYS, ip, "B")
+#define sched_note_end(tag, ip) sched_note_string(NOTE_TAG_ALWAYS, ip, "E")

Review Comment:
   NOTE_TAG_ALWAYS->tag



##########
include/nuttx/sched_note.h:
##########
@@ -439,6 +506,13 @@ struct note_filter_irq_s
 };
 #endif
 
+#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
+struct note_filter_dump_s
+{
+  uint8_t dump_mask[(NOTE_TAG_MAX + 7) / 8];

Review Comment:
   tag_mask



##########
drivers/note/note_driver.c:
##########
@@ -99,6 +99,9 @@
 struct note_filter_s
 {
   struct note_filter_mode_s mode;
+#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
+  struct note_filter_dump_s dump_mask;

Review Comment:
   dump_ to tag_



##########
include/nuttx/sched_note.h:
##########
@@ -114,25 +127,50 @@
 #  define SCHED_NOTE_IP \
           ({SCHED_NOTE_LABEL: (uintptr_t)&&SCHED_NOTE_LABEL;})
 #  define SCHED_NOTE_STRING(buf) \
-          sched_note_string(SCHED_NOTE_IP, buf)
+          sched_note_string(NOTE_TAG_ALWAYS, SCHED_NOTE_IP, buf)
 #  define SCHED_NOTE_DUMP(event, buf, len) \
-          sched_note_dump(SCHED_NOTE_IP, event, buf, len)
+          sched_note_dump(NOTE_TAG_ALWAYS, SCHED_NOTE_IP, event, buf, len)
 #  define SCHED_NOTE_VPRINTF(fmt, va) \
-          sched_note_vprintf(SCHED_NOTE_IP, fmt, va)
+          sched_note_vprintf(NOTE_TAG_ALWAYS, SCHED_NOTE_IP, fmt, va)
 #  define SCHED_NOTE_VBPRINTF(event, fmt, va) \
-          sched_note_vbprintf(SCHED_NOTE_IP, event, fmt, va)
+          sched_note_vbprintf(NOTE_TAG_ALWAYS, SCHED_NOTE_IP, \
+                              event, fmt, va)
 #  define SCHED_NOTE_PRINTF(fmt, ...) \
-          sched_note_printf(SCHED_NOTE_IP, fmt, ##__VA_ARGS__)
+          sched_note_printf(NOTE_TAG_ALWAYS, SCHED_NOTE_IP, \
+                            fmt, ##__VA_ARGS__)
 #  define SCHED_NOTE_BPRINTF(event, fmt, ...) \
-          sched_note_bprintf(SCHED_NOTE_IP, event, fmt, ##__VA_ARGS__)
+          sched_note_bprintf(NOTE_TAG_ALWAYS, SCHED_NOTE_IP, \
+                             event, fmt, ##__VA_ARGS__)
 #  define SCHED_NOTE_BEGINEX(str) \
-          sched_note_printf(SCHED_NOTE_IP, "B|%d|%s", gettid(), str)
+          sched_note_printf(NOTE_TAG_ALWAYS, SCHED_NOTE_IP, \
+                            "B|%d|%s", gettid(), str)
 #  define SCHED_NOTE_ENDEX(str) \
-          sched_note_printf(SCHED_NOTE_IP, "E|%d|%s", gettid(), str)
+          sched_note_printf(NOTE_TAG_ALWAYS, SCHED_NOTE_IP, \
+                            "E|%d|%s", gettid(), str)
 #  define SCHED_NOTE_BEGIN() \
-          sched_note_begin(SCHED_NOTE_IP)
-#  define SCHED_NOTE_END() \
-          sched_note_end(SCHED_NOTE_IP)
+          sched_note_begin(NOTE_TAG_ALWAYS, SCHED_NOTE_IP)
+#define SCHED_NOTE_END() \
+          sched_note_end(NOTE_TAG_ALWAYS, SCHED_NOTE_IP)
+#  define SCHED_NOTE_STRING_WITH_TAG(buf) \

Review Comment:
   remove WITH_TAG, let's always add tag as the first argument



##########
drivers/note/note_driver.c:
##########
@@ -1870,6 +1874,52 @@ void sched_note_filter_irq(FAR struct note_filter_irq_s 
*oldf,
 
 #endif /* CONFIG_SCHED_INSTRUMENTATION_FILTER */
 
+/****************************************************************************
+ * Name: sched_note_filter_dump
+ *
+ * Description:
+ *   Set and get syscall filter setting
+ *   (Same as NOTECTL_GETDUMPFILTER / NOTECTL_SETDUMPFILTER ioctls)
+ *
+ * Input Parameters:
+ *   oldf - A writable pointer to struct note_filter_dump_s to get
+ *          current dump filter setting
+ *          If 0, no data is written.
+ *   newf - A read-only pointer to struct note_filter_dump_s of the
+ *          new dump filter setting
+ *          If 0, the setting is not updated.
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
+void sched_note_filter_dump(FAR struct note_filter_dump_s *oldf,

Review Comment:
   dump->tag



##########
include/nuttx/trace.h:
##########
@@ -1,4 +1,3 @@
-

Review Comment:
   move to the second patch



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

Reply via email to