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

raiden00 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 cef56fbdb6 drivers/segger: inline note_sysview_get_timestamp
cef56fbdb6 is described below

commit cef56fbdb6da388b7b5674dc190922858217cac4
Author: xuxingliang <xuxingli...@xiaomi.com>
AuthorDate: Tue Jul 9 16:30:20 2024 +0800

    drivers/segger: inline note_sysview_get_timestamp
    
    Avoid another layer of function call to get time.
    
    Signed-off-by: xuxingliang <xuxingli...@xiaomi.com>
---
 drivers/segger/config/SEGGER_SYSVIEW_Conf.h | 20 +++++++++++++++++++-
 drivers/segger/note_sysview.c               | 13 -------------
 2 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/drivers/segger/config/SEGGER_SYSVIEW_Conf.h 
b/drivers/segger/config/SEGGER_SYSVIEW_Conf.h
index de7e9cf6ef..46264a531f 100644
--- a/drivers/segger/config/SEGGER_SYSVIEW_Conf.h
+++ b/drivers/segger/config/SEGGER_SYSVIEW_Conf.h
@@ -26,6 +26,7 @@
  ****************************************************************************/
 
 #include <nuttx/config.h>
+#include <nuttx/clock.h>
 
 /****************************************************************************
  * Pre-processor Definitions
@@ -55,6 +56,16 @@
 
 #define SEGGER_SYSVIEW_CPU_CACHE_LINE_SIZE 
CONFIG_SEGGER_RTT_CPU_CACHE_LINE_SIZE
 
+/****************************************************************************
+ * Name: note_sysview_get_timestamp
+ *
+ * Description:
+ *   Retrieve a system timestamp for SYSVIEW events.
+ *
+ ****************************************************************************/
+
+#define note_sysview_get_timestamp() perf_gettime()
+
 /****************************************************************************
  * Public Data
  ****************************************************************************/
@@ -72,8 +83,15 @@ extern "C"
  * Public Function Prototypes
  ****************************************************************************/
 
+/****************************************************************************
+ * Name: note_sysview_get_interrupt_id
+ *
+ * Description:
+ *   Retrieve the Id of the currently active interrupt.
+ *
+ ****************************************************************************/
+
 unsigned int note_sysview_get_interrupt_id(void);
-unsigned long note_sysview_get_timestamp(void);
 
 #undef EXTERN
 #if defined(__cplusplus)
diff --git a/drivers/segger/note_sysview.c b/drivers/segger/note_sysview.c
index 9814c7575f..e190452cf9 100644
--- a/drivers/segger/note_sysview.c
+++ b/drivers/segger/note_sysview.c
@@ -454,19 +454,6 @@ unsigned int note_sysview_get_interrupt_id(void)
   return g_note_sysview_driver.irq[this_cpu()];
 }
 
-/****************************************************************************
- * Name: note_sysview_get_timestamp
- *
- * Description:
- *   Retrieve a system timestamp for SYSVIEW events.
- *
- ****************************************************************************/
-
-unsigned long note_sysview_get_timestamp(void)
-{
-  return perf_gettime();
-}
-
 /****************************************************************************
  * Name: note_sysview_initialize
  *

Reply via email to