xiaoxiang781216 commented on code in PR #8619: URL: https://github.com/apache/nuttx/pull/8619#discussion_r1115282242
########## drivers/note/note_driver.c: ########## @@ -259,7 +261,17 @@ static void note_common(FAR struct tcb_s *tcb, #else /* Save the LS 32-bits of the system timer in little endian order */ - sched_note_flatten(note->nc_systime, &systime, sizeof(systime)); +#ifdef CONFIG_SCHED_INSTRUMENTATION_PERFCOUNT + /* Use perf count as tv_nsec to achieve high -precision timestamp */ + + up_perf_convert(count, &ts); +# else + ts.tv_nsec = (systime % (1000 * 1000 / CONFIG_USEC_PER_TICK)) Review Comment: Let's remove systime? which is no difference from clock_systime_timespec. So change CONFIG_SCHED_INSTRUMENTATION_HIRES to CONFIG_SCHED_INSTRUMENTATION_PERFCOUNT and remove systime. ########## drivers/note/note_driver.c: ########## @@ -223,12 +223,14 @@ 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; - +#ifdef CONFIG_SCHED_INSTRUMENTATION_HIRES clock_systime_timespec(&ts); #else clock_t systime = clock_systime_ticks(); +# ifdef CONFIG_SCHED_INSTRUMENTATION_PERFCOUNT + uint32_t count = up_perf_gettime(); Review Comment: why call both clock_systime_ticks and up_perf_gettime? ########## sched/Kconfig: ########## @@ -979,6 +979,14 @@ config SCHED_INSTRUMENTATION_HIRES ---help--- Use higher resolution system timer for instrumentation. +if !SCHED_INSTRUMENTATION_HIRES +config SCHED_INSTRUMENTATION_PERFCOUNT Review Comment: split to the new patch -- 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