blob: 009e1112b2f15a1bc0dd6cacf85e50ba99879407 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// 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 <linux/time.h>
%}
// 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 ...
|