From 5780cc7f8208ebca519d6e076fe403b1220ab865 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Mon, 23 Feb 2009 14:22:38 -0800 Subject: Add selective use of _stp_time_init/kill (PR9822) Our gettimeofday runtime has frequent wakeups to stay in sync with kernel time, but this is wasted effort if gettimeofday is not used in the script. This patch moves the calls to _stp_time_init and _stp_time_kill into begin and end/error probes, which only get pulled in if one of the gettimeofday variants is called. --- tapset/timestamp.stp | 43 ------------------------------------------- 1 file changed, 43 deletions(-) (limited to 'tapset/timestamp.stp') diff --git a/tapset/timestamp.stp b/tapset/timestamp.stp index 29763cb9..ce8f7558 100644 --- a/tapset/timestamp.stp +++ b/tapset/timestamp.stp @@ -7,10 +7,6 @@ // Public License (GPL); either version 2, or (at your option) any // later version. -%{ -#include -%} - /** * sfunction get_cycles - Processor cycle count. * @@ -21,43 +17,4 @@ function get_cycles:long () %{ /* pure */ THIS->__retvalue = (int64_t) c; %} - -/** - * sfunction gettimeofday_ns - Number of nanoseconds since UNIX epoch. - * - * Return the number of nanoseconds since the UNIX 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_ns(); -%} - -/** - * sfunction gettimeofday_us - Number of microseconds since UNIX epoch. - * - * Return the number of microseconds since the UNIX epoch. - */ -function gettimeofday_us:long () { - return gettimeofday_ns() / 1000; -} - -/** - * sfunction gettimeofday_ms - Number of milliseconds since UNIX epoch. - * - * Return the number of milliseconds since the UNIX epoch. - */ -function gettimeofday_ms:long () { - return gettimeofday_ns() / 1000000; -} - -/** - * sfunction gettimeofday_s - Number of seconds since UNIX epoch. - * - * Return the number of seconds since the UNIX epoch. - */ -function gettimeofday_s:long () { - return gettimeofday_ns() / 1000000000; -} - // likewise jiffies, monotonic_clock ... -- cgit From a67f272c3b053b26cb263f2eb661cb080c41575a Mon Sep 17 00:00:00 2001 From: ddomingo Date: Mon, 16 Mar 2009 14:21:51 +1000 Subject: fixed format of non-grabbable comments (for Tapset Reference Guide), added tapsetdescription for man page generator (in development) --- tapset/timestamp.stp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tapset/timestamp.stp') diff --git a/tapset/timestamp.stp b/tapset/timestamp.stp index ce8f7558..0b9d350a 100644 --- a/tapset/timestamp.stp +++ b/tapset/timestamp.stp @@ -6,7 +6,11 @@ // redistribute it and/or modify it under the terms of the GNU General // Public License (GPL); either version 2, or (at your option) any // later version. - +// +// Each timestamp function returns a value to indicate when a function is executed. These +//returned values can then be used to indicate when an event occurred, provide an ordering for events, +//or compute the amount of time elapsed between two time stamps. +// /** * sfunction get_cycles - Processor cycle count. * -- cgit