diff options
Diffstat (limited to 'tapset')
-rw-r--r-- | tapset/ChangeLog | 7 | ||||
-rw-r--r-- | tapset/timestamp.stp | 15 |
2 files changed, 17 insertions, 5 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 4e53cc01..ba79be66 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,10 @@ +2006-09-20 Josh Stone <joshua.i.stone@intel.com> + + PR 3233 + * timestamp.stp (gettimeofday_ns): New function + (gettimeofday_us, gettimeofday_ms, gettimeofday_s): + Use gettimeofday_ns as the base unit. + 2006-09-19 Li Guanglei <guanglei@cn.ibm.com> From Gui Jian <guijian@cn.ibm.com> diff --git a/tapset/timestamp.stp b/tapset/timestamp.stp index d0c89df8..8db0faef 100644 --- a/tapset/timestamp.stp +++ b/tapset/timestamp.stp @@ -20,21 +20,26 @@ function get_cycles:long () %{ /* pure */ %} -// return in microseconds since epoch -function gettimeofday_us:long () %{ /* pure */ +// return in nanoseconds since epoch +function gettimeofday_ns:long () %{ /* pure */ /* NOTE: we can't use do_gettimeofday because we could be called from a * context where xtime_lock is already held. See bug #2525. */ - THIS->__retvalue = _stp_gettimeofday_us(); + THIS->__retvalue = _stp_gettimeofday_ns(); %} +// return in microseconds since epoch +function gettimeofday_us:long () { + return gettimeofday_ns() / 1000; +} + // return in milliseconds since epoch function gettimeofday_ms:long () { - return gettimeofday_us() / 1000; + return gettimeofday_ns() / 1000000; } // return in seconds since epoch function gettimeofday_s:long () { - return gettimeofday_us() / 1000000; + return gettimeofday_ns() / 1000000000; } // likewise jiffies, monotonic_clock ... |