This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Monitoring cpu time in us (or even ns?)
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: corpaul <c dot bezemer at tudelft dot nl>
- Cc: systemtap at sourceware dot org
- Date: Tue, 22 Oct 2013 14:48:26 -0400
- Subject: Re: Monitoring cpu time in us (or even ns?)
- Authentication-results: sourceware.org; auth=none
- References: <1382451127616-248214 dot post at n7 dot nabble dot com>
c.bezemer wrote:
> I am probably completely overlooking this in the docs, but how can I
> monitor the time spent within a function?
One general approach is to have a function.return probe that measures
elapsed time with something like
probe FOO.function(BAR).return {
time_spent_within_function = gettimeofday_us()-
@entry(gettimeofday_us())
/* ... */
}
> I have tried using task_utime() and task_stime() but these appear to
> give results in ms
Those functions return the values as stored by the kernel; systemtap
is not rounding them off.
> [...] How can I get these times in us or even ns?
(At times so small, the probe effect (q.v.) will impact measurements.)
- FChE