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/02/23 14:30:15 UTC

[nuttx] branch master updated (8b4ecac6c2 -> 29a7d267fb)

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

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


    from 8b4ecac6c2 libc: Move math library from libs/libc/math to libs/libm/libm
     new 55ce5d0511 note: remove SCHED_INSTRUMENTATION_HIRES
     new 29a7d267fb note: correct systime with perf count

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Documentation/guides/tasktraceuser.rst |  4 ----
 drivers/note/note_driver.c             | 17 ++++++-----------
 include/nuttx/sched_note.h             | 13 +++++++------
 sched/Kconfig                          |  8 +++++---
 4 files changed, 18 insertions(+), 24 deletions(-)


[nuttx] 02/02: note: correct systime with perf count

Posted by xi...@apache.org.
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 29a7d267fbabb77e370cad05bbc2784c7259d715
Author: yinshengkai <yi...@xiaomi.com>
AuthorDate: Thu Feb 23 16:40:54 2023 +0800

    note: correct systime with perf count
    
    Signed-off-by: yinshengkai <yi...@xiaomi.com>
---
 drivers/note/note_driver.c | 7 +++++++
 sched/Kconfig              | 8 ++++++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/note/note_driver.c b/drivers/note/note_driver.c
index fd3181e5f7..d73bf506be 100644
--- a/drivers/note/note_driver.c
+++ b/drivers/note/note_driver.c
@@ -223,8 +223,15 @@ static void note_common(FAR struct tcb_s *tcb,
                         FAR struct note_common_s *note,
                         uint8_t length, uint8_t type)
 {
+#ifdef CONFIG_SCHED_INSTRUMENTATION_PERFCOUNT
+  struct timespec perftime;
+#endif
   struct timespec ts;
   clock_systime_timespec(&ts);
+#ifdef CONFIG_SCHED_INSTRUMENTATION_PERFCOUNT
+  up_perf_convert(up_perf_gettime(), &perftime);
+  ts.tv_nsec = perftime.tv_nsec;
+#endif
 
   /* Save all of the common fields */
 
diff --git a/sched/Kconfig b/sched/Kconfig
index cb90fca2a8..5f76c8ff79 100644
--- a/sched/Kconfig
+++ b/sched/Kconfig
@@ -973,6 +973,14 @@ config SCHED_INSTRUMENTATION_CPUSET
 	---help---
 		Monitor only CPUs in the bitset.  Bit 0=CPU0, Bit1=CPU1, etc.
 
+config SCHED_INSTRUMENTATION_PERFCOUNT
+	bool "Use perf count for instrumentation"
+	default n
+	---help---
+		Enabling this option will use perfcount as the clock source for tv_nsec
+		to achieve higher precision time.
+		This requires calling up_perf_init at system startup.
+
 config SCHED_INSTRUMENTATION_FILTER
 	bool "Instrumentation filter"
 	default n


[nuttx] 01/02: note: remove SCHED_INSTRUMENTATION_HIRES

Posted by xi...@apache.org.
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 55ce5d0511e4c927beb63a96af330e8581de7457
Author: yinshengkai <yi...@xiaomi.com>
AuthorDate: Thu Feb 23 16:31:02 2023 +0800

    note: remove SCHED_INSTRUMENTATION_HIRES
    
    Signed-off-by: yinshengkai <yi...@xiaomi.com>
---
 Documentation/guides/tasktraceuser.rst |  4 ----
 drivers/note/note_driver.c             | 12 ------------
 include/nuttx/sched_note.h             | 13 +++++++------
 sched/Kconfig                          |  6 ------
 4 files changed, 7 insertions(+), 28 deletions(-)

diff --git a/Documentation/guides/tasktraceuser.rst b/Documentation/guides/tasktraceuser.rst
index d5495fdc50..375d7d0e4a 100644
--- a/Documentation/guides/tasktraceuser.rst
+++ b/Documentation/guides/tasktraceuser.rst
@@ -42,10 +42,6 @@ The following configurations are configurable parameters for trace.
     - Bit 2 = Enable IRQ instrumentation
     - Bit 3 = Enable collecting syscall arguments
 
-- ``CONFIG_SCHED_INSTRUMENTATION_HIRES``
-
-  - If enabled, use higher resolution system timer for instrumentation.
-
 - ``CONFIG_DRIVERS_NOTE_TASKNAME_BUFSIZE``
 
   - Specify the task name buffer size in bytes.
diff --git a/drivers/note/note_driver.c b/drivers/note/note_driver.c
index 4594452572..fd3181e5f7 100644
--- a/drivers/note/note_driver.c
+++ b/drivers/note/note_driver.c
@@ -223,13 +223,8 @@ static void note_common(FAR struct tcb_s *tcb,
                         FAR struct note_common_s *note,
                         uint8_t length, uint8_t type)
 {
-#ifdef CONFIG_SCHED_INSTRUMENTATION_HIRES
   struct timespec ts;
-
   clock_systime_timespec(&ts);
-#else
-  clock_t systime = clock_systime_ticks();
-#endif
 
   /* Save all of the common fields */
 
@@ -240,15 +235,8 @@ static void note_common(FAR struct tcb_s *tcb,
   note->nc_cpu      = tcb->cpu;
 #endif
   sched_note_flatten(note->nc_pid, &tcb->pid, sizeof(tcb->pid));
-
-#ifdef CONFIG_SCHED_INSTRUMENTATION_HIRES
   sched_note_flatten(note->nc_systime_nsec, &ts.tv_nsec, sizeof(ts.tv_nsec));
   sched_note_flatten(note->nc_systime_sec, &ts.tv_sec, sizeof(ts.tv_sec));
-#else
-  /* Save the LS 32-bits of the system timer in little endian order */
-
-  sched_note_flatten(note->nc_systime, &systime, sizeof(systime));
-#endif
 }
 
 /****************************************************************************
diff --git a/include/nuttx/sched_note.h b/include/nuttx/sched_note.h
index 7a79e54423..9be8a950ba 100644
--- a/include/nuttx/sched_note.h
+++ b/include/nuttx/sched_note.h
@@ -217,12 +217,13 @@ struct note_common_s
 #endif
   uint8_t nc_pid[sizeof(pid_t)]; /* ID of the thread/task */
 
-#ifdef CONFIG_SCHED_INSTRUMENTATION_HIRES
-  uint8_t nc_systime_sec[sizeof(time_t)]; /* Time when note was buffered (sec) */
-  uint8_t nc_systime_nsec[sizeof(long)];  /* Time when note was buffered (nsec) */
-#else
-  uint8_t nc_systime[sizeof(clock_t)]; /* Time when note was buffered */
-#endif
+  /* Time when note was buffered (sec) */
+
+  uint8_t nc_systime_sec[sizeof(time_t)];
+
+  /* Time when note was buffered (nsec) */
+
+  uint8_t nc_systime_nsec[sizeof(long)];
 };
 
 /* This is the specific form of the NOTE_START note */
diff --git a/sched/Kconfig b/sched/Kconfig
index b274e6d8c0..cb90fca2a8 100644
--- a/sched/Kconfig
+++ b/sched/Kconfig
@@ -973,12 +973,6 @@ config SCHED_INSTRUMENTATION_CPUSET
 	---help---
 		Monitor only CPUs in the bitset.  Bit 0=CPU0, Bit1=CPU1, etc.
 
-config SCHED_INSTRUMENTATION_HIRES
-	bool "Use Hi-Res RTC for instrumentation"
-	default n
-	---help---
-		Use higher resolution system timer for instrumentation.
-
 config SCHED_INSTRUMENTATION_FILTER
 	bool "Instrumentation filter"
 	default n