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/01/05 14:05:01 UTC

[nuttx] 01/03: Revert "Sysview add prefix kconfig to add an option to decouple sched_note calls"

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

commit 4ba7624804b24f7da04140290bde1b4e4abe9a96
Author: yinshengkai <yi...@xiaomi.com>
AuthorDate: Thu Jan 5 18:15:06 2023 +0800

    Revert "Sysview add prefix kconfig to add an option to decouple sched_note calls"
    
    This reverts commit f72f7ebee08215bce2443a84c2173c4031297e0a.
---
 drivers/segger/Kconfig         |  6 -----
 drivers/segger/sysview.c       | 26 +++++++++++-----------
 include/nuttx/segger/sysview.h | 50 +-----------------------------------------
 3 files changed, 14 insertions(+), 68 deletions(-)

diff --git a/drivers/segger/Kconfig b/drivers/segger/Kconfig
index 54fe4c787f..a2a9b6b8cc 100644
--- a/drivers/segger/Kconfig
+++ b/drivers/segger/Kconfig
@@ -114,12 +114,6 @@ config SEGGER_SYSVIEW_RAM_BASE
 	---help---
 		The lowest RAM address used for IDs
 
-config SEGGER_SYSVIEW_PREFIX
-	bool "Segger note function prefix"
-	default ""
-	---help---
-		prefix sched_note functions with "sysview_" to call them indirectly
-
 endif
 
 endmenu # Segger RTT drivers
diff --git a/drivers/segger/sysview.c b/drivers/segger/sysview.c
index 0cc9d90b49..54b5159818 100644
--- a/drivers/segger/sysview.c
+++ b/drivers/segger/sysview.c
@@ -276,7 +276,7 @@ static inline int sysview_isenabled_syscall(int nr)
  *
  ****************************************************************************/
 
-void PREFIX(sched_note_start)(FAR struct tcb_s *tcb)
+void sched_note_start(FAR struct tcb_s *tcb)
 {
   if (!sysview_isenabled())
     {
@@ -287,7 +287,7 @@ void PREFIX(sched_note_start)(FAR struct tcb_s *tcb)
   sysview_send_taskinfo(tcb);
 }
 
-void PREFIX(sched_note_stop)(FAR struct tcb_s *tcb)
+void sched_note_stop(FAR struct tcb_s *tcb)
 {
   if (!sysview_isenabled())
     {
@@ -298,7 +298,7 @@ void PREFIX(sched_note_stop)(FAR struct tcb_s *tcb)
 }
 
 #ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
-void PREFIX(sched_note_suspend)(FAR struct tcb_s *tcb)
+void sched_note_suspend(FAR struct tcb_s *tcb)
 {
   if (!sysview_isenabled())
     {
@@ -311,7 +311,7 @@ void PREFIX(sched_note_suspend)(FAR struct tcb_s *tcb)
     }
 }
 
-void PREFIX(sched_note_resume)(FAR struct tcb_s *tcb)
+void sched_note_resume(FAR struct tcb_s *tcb)
 {
   if (!sysview_isenabled())
     {
@@ -333,7 +333,7 @@ void PREFIX(sched_note_resume)(FAR struct tcb_s *tcb)
 #endif
 
 #ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
-void PREFIX(sched_note_irqhandler)(int irq, FAR void *handler, bool enter)
+void sched_note_irqhandler(int irq, FAR void *handler, bool enter)
 {
   if (!sysview_isenabled_irq(irq, enter))
     {
@@ -371,7 +371,7 @@ void PREFIX(sched_note_irqhandler)(int irq, FAR void *handler, bool enter)
 #endif
 
 #ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
-void PREFIX(sched_note_syscall_enter)(int nr, int argc, ...)
+void sched_note_syscall_enter(int nr, int argc, ...)
 {
   nr -= CONFIG_SYS_RESERVED;
 
@@ -406,7 +406,7 @@ void PREFIX(sched_note_syscall_enter)(int nr, int argc, ...)
   SEGGER_SYSVIEW_MarkStart(nr);
 }
 
-void PREFIX(sched_note_syscall_leave)(int nr, uintptr_t result)
+void sched_note_syscall_leave(int nr, uintptr_t result)
 {
   nr -= CONFIG_SYS_RESERVED;
 
@@ -514,8 +514,8 @@ int sysview_initialize(void)
  *
  ****************************************************************************/
 
-void PREFIX(sched_note_filter_mode)(struct note_filter_mode_s *oldm,
-                                    struct note_filter_mode_s *newm)
+void sched_note_filter_mode(struct note_filter_mode_s *oldm,
+                            struct note_filter_mode_s *newm)
 {
   irqstate_t flags;
 
@@ -579,8 +579,8 @@ void PREFIX(sched_note_filter_mode)(struct note_filter_mode_s *oldm,
  ****************************************************************************/
 
 #ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
-void PREFIX(sched_note_filter_irq)(struct note_filter_irq_s *oldf,
-                                   struct note_filter_irq_s *newf)
+void sched_note_filter_irq(struct note_filter_irq_s *oldf,
+                           struct note_filter_irq_s *newf)
 {
   irqstate_t flags;
 
@@ -625,8 +625,8 @@ void PREFIX(sched_note_filter_irq)(struct note_filter_irq_s *oldf,
  ****************************************************************************/
 
 #ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
-void PREFIX(sched_note_filter_syscall)(struct note_filter_syscall_s *oldf,
-                                       struct note_filter_syscall_s *newf)
+void sched_note_filter_syscall(struct note_filter_syscall_s *oldf,
+                               struct note_filter_syscall_s *newf)
 {
   irqstate_t flags;
 
diff --git a/include/nuttx/segger/sysview.h b/include/nuttx/segger/sysview.h
index 129f38f391..08aae9ac13 100644
--- a/include/nuttx/segger/sysview.h
+++ b/include/nuttx/segger/sysview.h
@@ -26,17 +26,6 @@
  ****************************************************************************/
 
 #include <nuttx/config.h>
-#include <nuttx/sched.h>
-
-/****************************************************************************
- * Pre-processor Definitions
- ****************************************************************************/
-
-#ifdef CONFIG_SEGGER_SYSVIEW_PREFIX
-#  define PREFIX(fun) sysview ## _ ## fun
-#else
-#  define PREFIX(fun) fun
-#endif
 
 /****************************************************************************
  * Public Function Prototypes
@@ -58,43 +47,6 @@
 
 #ifdef CONFIG_SEGGER_SYSVIEW
 int sysview_initialize(void);
-
-#  ifdef CONFIG_SEGGER_SYSVIEW_PREFIX
-
-void PREFIX(sched_note_start)(struct tcb_s *tcb);
-
-void PREFIX(sched_note_stop)(struct tcb_s *tcb);
-
-void PREFIX(sched_note_suspend)(struct tcb_s *tcb);
-
-void PREFIX(sched_note_resume)(struct tcb_s *tcb);
-
-#    ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
-void PREFIX(sched_note_irqhandler)(int irq, void *handler, bool enter);
-#    endif
-
-#    ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
-void PREFIX(sched_note_syscall_enter)(int nr);
-void PREFIX(sched_note_syscall_leave)(int nr, uintptr_t result);
-#    endif
-
-#    ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
-void PREFIX(sched_note_filter_mode)(struct note_filter_mode_s *oldm,
-                            struct note_filter_mode_s *newm);
-#    endif
-
-#    ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
-void PREFIX(sched_note_filter_irq)(struct note_filter_irq_s *oldf,
-                           struct note_filter_irq_s *newf);
-#    endif
-
-#    ifdef CONFIG_SCHED_INSTRUMENTATION_SYSCALL
-void PREFIX(sched_note_filter_syscall)(struct note_filter_syscall_s *oldf,
-                               struct note_filter_syscall_s *newf);
-#    endif
-
-#  endif /* CONFIG_SEGGER_SYSVIEW_PREFIX */
-
-#endif /* CONFIG_SEGGER_SYSVIEW */
+#endif
 
 #endif /* __INCLUDE_NUTTX_SEGGER_SYSVIEW_H */