You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/10/17 01:07:12 UTC

[nuttx] branch master updated: note: remove remaining event code

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 58c6b60df5 note: remove remaining event code
58c6b60df5 is described below

commit 58c6b60df50ed43f8da39da0d78f46e477be82de
Author: yinshengkai <yi...@xiaomi.com>
AuthorDate: Mon Oct 16 11:05:17 2023 +0800

    note: remove remaining event code
    
    Some event-related codes were missed in the previous modification and have not been deleted.
    
    Signed-off-by: yinshengkai <yi...@xiaomi.com>
---
 drivers/note/note_driver.c       | 19 +++++++++----------
 drivers/note/noteram_driver.c    |  9 ++++++---
 include/nuttx/note/note_driver.h |  7 +++----
 include/nuttx/sched_note.h       | 26 ++++++++++++--------------
 4 files changed, 30 insertions(+), 31 deletions(-)

diff --git a/drivers/note/note_driver.c b/drivers/note/note_driver.c
index a67d68cbcc..7187af929e 100644
--- a/drivers/note/note_driver.c
+++ b/drivers/note/note_driver.c
@@ -89,13 +89,12 @@
   ((drv)->ops->irqhandler(drv, irq, handler, enter), true))
 #define note_string(drv, ip, buf)                                            \
   ((drv)->ops->string && ((drv)->ops->string(drv, ip, buf), true))
-#define note_dump(drv, ip, buf, len)                                         \
-  ((drv)->ops->dump && ((drv)->ops->dump(drv, ip, event, buf, len), true))
+#define note_event(drv, ip, event, buf, len)                                 \
+  ((drv)->ops->event && ((drv)->ops->event(drv, ip, event, buf, len), true))
 #define note_vprintf(drv, ip, fmt, va)                                       \
   ((drv)->ops->vprintf && ((drv)->ops->vprintf(drv, ip, fmt, va), true))
-#define note_vbprintf(drv, ip, event, fmt, va)                               \
-  ((drv)->ops->vbprintf &&                                                   \
-  ((drv)->ops->vbprintf(drv, ip, event, fmt, va), true))
+#define note_vbprintf(drv, ip, fmt, va)                                      \
+  ((drv)->ops->vbprintf && ((drv)->ops->vbprintf(drv, ip, fmt, va), true))
 
 /****************************************************************************
  * Private Types
@@ -1413,7 +1412,7 @@ void sched_note_event_ip(uint32_t tag, uintptr_t ip, uint8_t event,
 
   for (driver = g_note_drivers; *driver; driver++)
     {
-      if (note_dump(*driver, ip, buf, len))
+      if (note_event(*driver, ip, event, buf, len))
         {
           continue;
         }
@@ -1501,7 +1500,7 @@ void sched_note_vprintf_ip(uint32_t tag, uintptr_t ip,
     }
 }
 
-void sched_note_vbprintf_ip(uint32_t tag, uintptr_t ip, uint8_t event,
+void sched_note_vbprintf_ip(uint32_t tag, uintptr_t ip,
                             FAR const char *fmt, va_list va)
 {
   FAR struct note_binary_s *note;
@@ -1546,7 +1545,7 @@ void sched_note_vbprintf_ip(uint32_t tag, uintptr_t ip, uint8_t event,
 
   for (driver = g_note_drivers; *driver; driver++)
     {
-      if (note_vbprintf(*driver, ip, event, fmt, va))
+      if (note_vbprintf(*driver, ip, fmt, va))
         {
           continue;
         }
@@ -1728,12 +1727,12 @@ void sched_note_printf_ip(uint32_t tag, uintptr_t ip,
   va_end(va);
 }
 
-void sched_note_bprintf_ip(uint32_t tag, uintptr_t ip, uint8_t event,
+void sched_note_bprintf_ip(uint32_t tag, uintptr_t ip,
                            FAR const char *fmt, ...)
 {
   va_list va;
   va_start(va, fmt);
-  sched_note_vbprintf_ip(tag, ip, event, fmt, va);
+  sched_note_vbprintf_ip(tag, ip, fmt, va);
   va_end(va);
 }
 #endif /* CONFIG_SCHED_INSTRUMENTATION_DUMP */
diff --git a/drivers/note/noteram_driver.c b/drivers/note/noteram_driver.c
index dcfdfdcb5f..e366067200 100644
--- a/drivers/note/noteram_driver.c
+++ b/drivers/note/noteram_driver.c
@@ -978,6 +978,9 @@ static int noteram_dump_one(FAR uint8_t *p, FAR struct lib_outstream_s *s,
         FAR struct note_binary_s *nbi = (FAR struct note_binary_s *)p;
         char c = note->nc_type == NOTE_DUMP_BEGIN ? 'B' : 'E';
         int len = note->nc_length - sizeof(struct note_binary_s);
+        uintptr_t ip;
+
+        noteram_dump_unflatten(&ip, nbi->nbi_ip, sizeof(ip));
         ret += noteram_dump_header(s, &nbi->nbi_cmn, ctx);
         if (len > 0)
           {
@@ -987,7 +990,7 @@ static int noteram_dump_one(FAR uint8_t *p, FAR struct lib_outstream_s *s,
         else
           {
             ret += lib_sprintf(s, "tracing_mark_write: %c|%d|%pS\n",
-                               c, pid, (FAR void *)nbi->nbi_ip);
+                               c, pid, (FAR void *)ip);
           }
       }
       break;
@@ -1023,8 +1026,8 @@ static int noteram_dump_one(FAR uint8_t *p, FAR struct lib_outstream_s *s,
 
         noteram_dump_unflatten(&ip, nbi->nbi_ip, sizeof(ip));
 
-        ret += lib_sprintf(s, "tracing_mark_write: 0x%" PRIdPTR
-                           ": count=%u", ip, count);
+        ret += lib_sprintf(s, "tracing_mark_write: %pS: count=%u",
+                           (FAR void *)ip, count);
         for (i = 0; i < count; i++)
           {
             ret += lib_sprintf(s, " 0x%x", nbi->nbi_data[i]);
diff --git a/include/nuttx/note/note_driver.h b/include/nuttx/note/note_driver.h
index 66d52bde06..8e1de97037 100644
--- a/include/nuttx/note/note_driver.h
+++ b/include/nuttx/note/note_driver.h
@@ -92,13 +92,12 @@ struct note_driver_ops_s
 #ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
   CODE void (*string)(FAR struct note_driver_s *drv, uintptr_t ip,
                       FAR const char *buf);
-  CODE void (*dump)(FAR struct note_driver_s *drv, uintptr_t ip,
-                    uint8_t event, FAR const void *buf, size_t len);
+  CODE void (*event)(FAR struct note_driver_s *drv, uintptr_t ip,
+                     uint8_t event, FAR const void *buf, size_t len);
   CODE void (*vprintf)(FAR struct note_driver_s *drv, uintptr_t ip,
                        FAR const char *fmt, va_list va) printf_like(3, 0);
   CODE void (*vbprintf)(FAR struct note_driver_s *drv, uintptr_t ip,
-                        uint8_t event, FAR const char *fmt,
-                        va_list va) printf_like(4, 0);
+                        FAR const char *fmt, va_list va) printf_like(3, 0);
 #endif
 };
 
diff --git a/include/nuttx/sched_note.h b/include/nuttx/sched_note.h
index 933536ac30..2ba0d48920 100644
--- a/include/nuttx/sched_note.h
+++ b/include/nuttx/sched_note.h
@@ -129,17 +129,16 @@
         sched_note_string_ip(tag, SCHED_NOTE_IP, buf)
 #define sched_note_event(tag, event, buf, len) \
         sched_note_event_ip(tag, SCHED_NOTE_IP, event, buf, len)
-#define sched_note_dump(tag, event, buf, len) \
-        sched_note_event(tag, SCHED_NOTE_IP, NOTE_DUMP_BINARY, buf, len)
+#define sched_note_dump(tag, buf, len) \
+        sched_note_event_ip(tag, SCHED_NOTE_IP, NOTE_DUMP_BINARY, buf, len)
 #define sched_note_vprintf(tag, fmt, va) \
         sched_note_vprintf_ip(tag, SCHED_NOTE_IP, fmt, va)
-#define sched_note_vbprintf(tag, event, fmt, va) \
-        sched_note_vbprintf_ip(tag, SCHED_NOTE_IP, event, fmt, va)
+#define sched_note_vbprintf(tag, fmt, va) \
+        sched_note_vbprintf_ip(tag, SCHED_NOTE_IP, fmt, va)
 #define sched_note_printf(tag, fmt, ...) \
         sched_note_printf_ip(tag, SCHED_NOTE_IP, fmt, ##__VA_ARGS__)
-#define sched_note_bprintf(tag, event, fmt, ...) \
-        sched_note_bprintf_ip(tag, SCHED_NOTE_IP, event, \
-                              fmt, ##__VA_ARGS__)
+#define sched_note_bprintf(tag, fmt, ...) \
+        sched_note_bprintf_ip(tag, SCHED_NOTE_IP, fmt, ##__VA_ARGS__)
 #define sched_note_counter(tag, name, value) \
         sched_note_counter_ip(tag, SCHED_NOTE_IP, name, value)
 
@@ -543,13 +542,12 @@ void sched_note_event_ip(uint32_t tag, uintptr_t ip, uint8_t event,
                         FAR const void *buf, size_t len);
 void sched_note_vprintf_ip(uint32_t tag, uintptr_t ip, FAR const char *fmt,
                            va_list va) printf_like(3, 0);
-void sched_note_vbprintf_ip(uint32_t tag, uintptr_t ip, uint8_t event,
-                            FAR const char *fmt,
-                            va_list va) printf_like(4, 0);
+void sched_note_vbprintf_ip(uint32_t tag, uintptr_t ip, FAR const char *fmt,
+                            va_list va) printf_like(3, 0);
 void sched_note_printf_ip(uint32_t tag, uintptr_t ip,
                           FAR const char *fmt, ...) printf_like(3, 4);
-void sched_note_bprintf_ip(uint32_t tag, uintptr_t ip, uint8_t event,
-                           FAR const char *fmt, ...) printf_like(4, 5);
+void sched_note_bprintf_ip(uint32_t tag, uintptr_t ip,
+                           FAR const char *fmt, ...) printf_like(3, 4);
 
 static inline void sched_note_counter_ip(uint32_t tag, uintptr_t ip,
                                          FAR const char *name,
@@ -564,9 +562,9 @@ static inline void sched_note_counter_ip(uint32_t tag, uintptr_t ip,
 #  define sched_note_string_ip(t,ip,b)
 #  define sched_note_event_ip(t,ip,e,b,l)
 #  define sched_note_vprintf_ip(t,ip,f,v)
-#  define sched_note_vbprintf_ip(t,ip,e,f,v)
+#  define sched_note_vbprintf_ip(t,ip,f,v)
 #  define sched_note_printf_ip(t,ip,f,...)
-#  define sched_note_bprintf_ip(t,ip,e,f,...)
+#  define sched_note_bprintf_ip(t,ip,f,...)
 #  define sched_note_counter_ip(t,ip,n,v)
 #endif /* CONFIG_SCHED_INSTRUMENTATION_DUMP */