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: Li Guanglei <guanglei at cn dot ibm dot com>
- To: Roland McGrath <roland at redhat dot com>
- Cc: "Frank Ch. Eigler" <fche at redhat dot com>, "systemtap at sourceware dot org" <systemtap at sourceware dot org>
- Date: Mon, 07 Aug 2006 14:19:46 +0800
- Subject: Re: using get_cycles() to get the real elapsed time
- Organization: IBM CSTL
- References: <20060806205111.AAF9218007E@magilla.sf.frob.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.
I tried to call sched_clock() from embedded c codes but failed. insmod
give a error of "stap_4265: Unknown symbol sched_clock". I think the
reason is that sched_clock() isn't exported by EXPORT_SYMBOL().
- Guanglei