This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: using get_cycles() to get the real elapsed time
- From: "Jose R. Santos" <jrs at us dot ibm dot com>
- To: Roland McGrath <roland at redhat dot com>
- Cc: "Frank Ch. Eigler" <fche at redhat dot com>, Li Guanglei <guanglei at cn dot ibm dot com>, "systemtap at sourceware dot org" <systemtap at sourceware dot org>
- Date: Sun, 06 Aug 2006 19:01:39 -0500
- Subject: Re: using get_cycles() to get the real elapsed time
- References: <20060806205111.AAF9218007E@magilla.sf.frob.com>
- Reply-to: jrs at us dot ibm dot com
Roland McGrath wrote:
sched_clock is used by the scheduler and POSIX CPU clocks/timers, which
have the same requirements of being accurate and cheap. It returns ns.
It can be called from interrupt level. Its implementation is already
hardware-specific and is get_cycles with appropriate adjustments or
something else with nice properties for the particular hardware.
I think this is in all likelihood the best interface to use, if the
hrtimer stuff is not.
Thanks for the info. We will definitely give it a try.
-JRS