This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: using get_cycles() to get the real elapsed time


Li Guanglei <guanglei@cn.ibm.com> writes:

> [...]
> So we need deal with different Arches to get the elapsed time by
> using get_cycles()

Yes, eventually recreating the complexity of gettimeofday().

> BTW, get_cycles() will return 32-bit value for some architectures
> e.g ppc32, although the major architectures such as ppc64, x86,
> x86_64 will all return a 64-bit value. [...]

It's even worse than that: I gather some machines return a putatively
64-bit value, but the number within overflows after a few bits past 40.
So any user of get_cycles() must correct at least for
- change in frequency
- counter overflow
- cross-CPU drift

- FChE


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]