On 31/10/13 19:22, David Ahern wrote:
On 10/31/13, 11:23 AM, Harald Servat wrote:Which is the relation between perf_clock() (or local_clock()) and clock_gettime (CLOCK_MONOTONIC, ). Are they the same? If not, is there a way to correlate them? Or alternatively, is it possible to call local_clock() from the userland?We still do not have a means of correlating perf_clock to time-of-day, monotonic or any other clock source. Still trying. Pawell Moll has a couple of patches posted -- one uses an ioctl to get perf_clock timestamps the other makes perf_clock accessible through clock_gettime. See attached. David
Hello,thank you David! Those patches are great! I decided to access perf clock through clock_gettime because I'm more used to this call since I used it before.
I understand that the patches are a bit hardcoded, right? I tried to #include "/usr/include/linux/time.h" after #include <time.h> but they seem to conflict. If I just extract the interesting bits (#define CLOCK_PERF) it seems to work. Is there a cleaner way to use this right now?
JFTR, I have written a very small app that demonstrate the usage of this clock_gettime + perf (attached). It is very interesting to see that the difference between the monotonic and the perf clock is rather similar. However, as time goes by, at least in my machine, perf clock seems to advance at a faster pace than the monotonic clock.
Best regards. -- WARNING / LEGAL TEXT: This message is intended only for the use of the individual or entity to which it is addressed and may contain information which is privileged, confidential, proprietary, or exempt from disclosure under applicable law. If you are not the intended recipient or the person responsible for delivering the message to the intended recipient, you are strictly prohibited from disclosing, distributing, copying, or in any way using this message. If you have received this communication in error, please notify the sender and destroy and delete any copies you may have received. http://www.bsc.es/disclaimer
perf-clock.tar.bz2
Description: application/bzip