summaryrefslogtreecommitdiffstats
path: root/tapset/timestamp.stp
blob: ce8f7558c738d32520a54bf95be7382bc957995e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 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.

/**
 * sfunction get_cycles - Processor cycle count.
 *
 *  Return the processor cycle counter value, or 0 if unavailable.
 */
function get_cycles:long () %{ /* pure */
  cycles_t c = get_cycles();
  THIS->__retvalue = (int64_t) c;
%}

// likewise jiffies, monotonic_clock ...