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


##########
drivers/note/Kconfig:
##########
@@ -36,6 +36,19 @@ config DRIVERS_NOTECTL
                If this option is selected, the instrumentation filter control 
device
                /dev/notectl is provided.
 
+config NOTE_GET_PERF_TIME

Review Comment:
   let's change to choice



##########
drivers/note/note_driver.c:
##########
@@ -217,7 +217,17 @@ static void note_common(FAR struct tcb_s *tcb,
       note->nc_pid = tcb->pid;
     }
 
+#if defined (CONFIG_NOTE_GET_PERF_TIME)

Review Comment:
   ```suggestion
   #if defined(CONFIG_NOTE_GET_PERF_TIME)
   ```



##########
drivers/note/note_driver.c:
##########
@@ -217,7 +217,17 @@ static void note_common(FAR struct tcb_s *tcb,
       note->nc_pid = tcb->pid;
     }
 
+#if defined (CONFIG_NOTE_GET_PERF_TIME)
   note->nc_systime = perf_gettime();
+
+#elif defined (CONFIG_NOTE_GET_CLOCK_TIME)
+  struct timespec ts;
+  clock_gettime(CLOCK_REALTIME, &ts);
+  note->nc_systime = ts.tv_sec * NSEC_PER_SEC + ts.tv_nsec;
+
+#else

Review Comment:
   remove



##########
drivers/note/Kconfig:
##########
@@ -36,6 +36,19 @@ config DRIVERS_NOTECTL
                If this option is selected, the instrumentation filter control 
device
                /dev/notectl is provided.
 
+config NOTE_GET_PERF_TIME
+       bool "Note get time config"
+       default y
+       ---help---
+               If this option is selected, then note get time from perf time
+
+config NOTE_GET_CLOCK_TIME

Review Comment:
   DRIVERS_NOTE_CLOCK_TIME



##########
drivers/note/Kconfig:
##########
@@ -36,6 +36,19 @@ config DRIVERS_NOTECTL
                If this option is selected, the instrumentation filter control 
device
                /dev/notectl is provided.
 
+config NOTE_GET_PERF_TIME

Review Comment:
   DRIVERS_NOTE_PERF_TIME



##########
drivers/note/note_driver.c:
##########
@@ -217,7 +217,17 @@ static void note_common(FAR struct tcb_s *tcb,
       note->nc_pid = tcb->pid;
     }
 
+#if defined (CONFIG_NOTE_GET_PERF_TIME)
   note->nc_systime = perf_gettime();
+
+#elif defined (CONFIG_NOTE_GET_CLOCK_TIME)
+  struct timespec ts;

Review Comment:
   doesn't allow define the variable in the middle of function



##########
drivers/note/note_driver.c:
##########
@@ -217,7 +217,17 @@ static void note_common(FAR struct tcb_s *tcb,
       note->nc_pid = tcb->pid;
     }
 
+#if defined (CONFIG_NOTE_GET_PERF_TIME)
   note->nc_systime = perf_gettime();
+
+#elif defined (CONFIG_NOTE_GET_CLOCK_TIME)

Review Comment:
   ```suggestion
   #elif defined(CONFIG_NOTE_GET_CLOCK_TIME)
   ```



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