Linux timekeeping question (cc
@jstultzJohn Stultz):
These two writeups of a recent OpenJDK change seem to suggest that Java people are trying to do fairly fine-grained timing measurements with the Linux "thread user time" clock (CPUCLOCK_VIRT) that excludes time spent in the kernel:
https://norlinder.nu/posts/User-CPU-Time-JVM/
https://questdb.com/blog/jvm-current-thread-user-time/ (by @jerrinotJaromir Hamala)
Is my understanding correct that this only works well for measuring small time intervals if the expensive full-dynticks context tracking machinery is runtime-enabled, and otherwise you'd have a large amount of randomness in measurements based on whether periodic ticks happen to occur while the thread is in the middle of a syscall?
It seems to me like measuring the cost of operations with CLOCK_THREAD_CPUTIME_ID would generally be a better idea than trying to use a CPUCLOCK_VIRT clock, even if you're not actually interested in the cost of handling syscalls/faults...
