I'm currently trying to define a method for measuring the time during which a certain function will be executed (for example, pthread_create). Now, of course, these types of functions are extremely optimized to minimize time; so small that my timer, which uses gettimeofday in user space, which measures in microseconds, cannot adequately measure anything.
Usually, if I can mess around with the kernel, I would use something like get_cycles to measure the number of cycles as an indicator of performance. However, I did not find a way to do this in user space. Is there a way to use get_cycles (or the equivalent) or some other high precision timer that I could use in user space to measure extremely fast functions?
source share