diff options
Diffstat (limited to 'tapset')
-rw-r--r-- | tapset/timestamp.stp | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/tapset/timestamp.stp b/tapset/timestamp.stp index 8db0faef..5eb0bfcc 100644 --- a/tapset/timestamp.stp +++ b/tapset/timestamp.stp @@ -7,39 +7,79 @@ // Public License (GPL); either version 2, or (at your option) any // later version. +///<chapter id="timestamp_stp"> +/// <title>Timestamp Functions</title> +/// <para> +/// Each timestamp function returns a value to indicate when +/// the function is executed. +/// Thus, these returned values can be used to indicate +/// when an event occurs, provide an ordering for events, or compute +/// the amount of time elapsed between to time stamps. +/// </para> %{ #include <linux/time.h> %} - -// return processor cycle counter (if any) +///<formalpara> +/// <title>get_cycles:long()</title> +/// <indexterm><primary>get_cycles</primary></indexterm> +/// <para> +/// Return the processor cycle counter value, or 0 if unavailable. +/// </para> +///</formalpara> function get_cycles:long () %{ /* pure */ cycles_t c = get_cycles(); THIS->__retvalue = (int64_t) c; %} -// return in nanoseconds since epoch +///<formalpara> +/// <title>gettimeofday_ns:long ()</title> +/// <indexterm><primary>gettimeofday_ns</primary></indexterm> +/// <para> +/// Return the number of nanoseconds since the UNIX epoch. +/// </para> +///</formalpara> 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_ns(); %} -// return in microseconds since epoch +///<formalpara> +/// <title>gettimeofday_us:long ()</title> +/// <indexterm><primary>gettimeofday_us</primary></indexterm> +/// <para> +/// Return the number of microseconds since the UNIX epoch. +/// </para> +///</formalpara> function gettimeofday_us:long () { return gettimeofday_ns() / 1000; } -// return in milliseconds since epoch +///<formalpara> +/// <title>gettimeofday_ms:long ()</title> +/// <indexterm><primary>gettimeofday_ms</primary></indexterm> +/// <para> +/// Return the number of milliseconds since the UNIX epoch. +/// </para> +///</formalpara> function gettimeofday_ms:long () { return gettimeofday_ns() / 1000000; } -// return in seconds since epoch +///<formalpara> +/// <title>gettimeofday_s:long ()</title> +/// <indexterm><primary>gettimeofday_s</primary></indexterm> +/// <para> +/// Return the number of seconds since the UNIX epoch. +/// </para> +///</formalpara> function gettimeofday_s:long () { return gettimeofday_ns() / 1000000000; } // likewise jiffies, monotonic_clock ... + +///</chapter> |