diff --git a/drivers/note/note_driver.c b/drivers/note/note_driver.c index fd3181e5f7b..d73bf506be9 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 cb90fca2a8e..5f76c8ff793 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