// timestamp tapset // Copyright (C) 2005 Red Hat Inc. // // This file is part of systemtap, and is free software. You can // 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. %{ #include %} // return in microseconds since epoch function gettimeofday_us:long () %{ struct timeval tm; do_gettimeofday (& tm); THIS->__retvalue = (tm.tv_sec * 1000000ULL) + (tm.tv_usec); %} // return in milliseconds since epoch function gettimeofday_ms:long () %{ struct timeval tm; do_gettimeofday (& tm); THIS->__retvalue = (tm.tv_sec * 1000ULL) + (tm.tv_usec / 1000); %} // return in seconds since epoch function gettimeofday_s:long () %{ struct timeval tm; do_gettimeofday (& tm); THIS->__retvalue = tm.tv_sec; %} // likewise jiffies, monotonic_clock ...