note: correct systime with perf count

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai 2023-02-23 16:40:54 +08:00 committed by Xiang Xiao
parent 55ce5d0511
commit 29a7d267fb
2 changed files with 15 additions and 0 deletions

View File

@ -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 */

View File

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