diff options
Diffstat (limited to 'tapset')
-rw-r--r-- | tapset/ChangeLog | 5 | ||||
-rw-r--r-- | tapset/timestamp.stp | 23 |
2 files changed, 15 insertions, 13 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog index 1a15f4a9..edf521c8 100644 --- a/tapset/ChangeLog +++ b/tapset/ChangeLog @@ -1,3 +1,8 @@ +2006-06-21 Josh Stone <joshua.i.stone@intel.com> + + * timestamp.stp (gettimeofday_us, gettimeofday_ms, gettimeofday_s): + Convert to using the runtime-provided _stp_gettimeofday_us(). + 2006-06-19 Martin Hunt <hunt@redhat.com> * syscalls.stp: Make the 16-bit calls optional. diff --git a/tapset/timestamp.stp b/tapset/timestamp.stp index 67e2e73a..d0c89df8 100644 --- a/tapset/timestamp.stp +++ b/tapset/timestamp.stp @@ -1,5 +1,6 @@ // timestamp tapset // Copyright (C) 2005-2006 Red Hat Inc. +// Copyright (C) 2006 Intel Corporation. // // 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 @@ -21,23 +22,19 @@ function get_cycles:long () %{ /* pure */ // return in microseconds since epoch function gettimeofday_us:long () %{ /* pure */ - struct timeval tm; - do_gettimeofday (& tm); - THIS->__retvalue = (tm.tv_sec * 1000000ULL) + (tm.tv_usec); + /* 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(); %} // return in milliseconds since epoch -function gettimeofday_ms:long () %{ /* pure */ - struct timeval tm; - do_gettimeofday (& tm); - THIS->__retvalue = (tm.tv_sec * 1000ULL) + (tm.tv_usec / 1000); -%} +function gettimeofday_ms:long () { + return gettimeofday_us() / 1000; +} // return in seconds since epoch -function gettimeofday_s:long () %{ /* pure */ - struct timeval tm; - do_gettimeofday (& tm); - THIS->__retvalue = tm.tv_sec; -%} +function gettimeofday_s:long () { + return gettimeofday_us() / 1000000; +} // likewise jiffies, monotonic_clock ... |