|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /usr/share/systemtap/tapset/ |
Upload File : |
// 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
// Public License (GPL); either version 2, or (at your option) any
// later version.
%{
#include <linux/time.h>
%}
// return processor cycle counter (if any)
function get_cycles:long () %{ /* pure */
cycles_t c = get_cycles();
THIS->__retvalue = (int64_t) c;
%}
// 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_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_ns() / 1000000;
}
// return in seconds since epoch
function gettimeofday_s:long () {
return gettimeofday_ns() / 1000000000;
}
// likewise jiffies, monotonic_clock ...