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: "Stone, Joshua I" <joshua dot i dot stone at intel dot com>
- To: "Li Guanglei" <guanglei at cn dot ibm dot com>, <systemtap at sourceware dot org>
- Cc: "Paul Mackerras" <pmac at au1 dot ibm dot com>, <ananth at in dot ibm dot com>, "Anton Blanchard" <antonb at au1 dot ibm dot com>, <guij at cn dot ibm dot com>, "Jim Keniston" <jkenisto at us dot ibm dot com>, <paulus at ozlabs dot au dot ibm dot com>, "Vara Prasad" <prasadav at us dot ibm dot com>, "Jose Santos" <jrs at us dot ibm dot com>
- Date: Tue, 8 Aug 2006 11:36:05 -0700
- Subject: RE: using get_cycles() to get the real elapsed time
On Monday, August 07, 2006 10:24 PM, Li Guanglei wrote:
>> Another question: Does anybody know how to call sched_clock() in a
>> kernel module? insmod complains of unknown symbol of sched_clock
Since there's no EXPORT_SYMBOL, it's not part of the kernel ABI, and
thus the symbol won't be resolved when you insert the module. One could
probably link it manually, using a function pointer and a kallsyms
lookup. This goes against the purpose of the ABI and EXPORTs though,
and would make us very bad kernel citizens. Better to ask for the
export, or improve our own _stp_gettimeofday_us.
We could also add a new function to our runtime for simple timestamps,
inspired by sched_clock, which gives a stable timebase that's not
necessarily sync'ed with gettimeofday. Most usages are concerned with
relative time anyway, rather than absolute.
Josh