summaryrefslogtreecommitdiffstats
path: root/tapset
diff options
context:
space:
mode:
authorfche <fche>2006-02-22 18:19:11 +0000
committerfche <fche>2006-02-22 18:19:11 +0000
commit602149dadba5e74e6de8b5a172a64b13dcce6f1d (patch)
tree8a1cd62702e6aa7e8366efd1fb64690074e0b224 /tapset
parent03d569d3e8ee6f405b8e8489eaaf325c774b822d (diff)
downloadsystemtap-steved-602149dadba5e74e6de8b5a172a64b13dcce6f1d.tar.gz
systemtap-steved-602149dadba5e74e6de8b5a172a64b13dcce6f1d.tar.xz
systemtap-steved-602149dadba5e74e6de8b5a172a64b13dcce6f1d.zip
2006-02-22 Frank Ch. Eigler <fche@elastic.org>
* stapfuncs.5.in: Document get_cycles(). * testsuite/buildok/timestamp.stp: Build it and its friends. 2006-02-22 Frank Ch. Eigler <fche@elastic.org> * timestamp.stp (get_cycles): New function.
Diffstat (limited to 'tapset')
-rw-r--r--tapset/ChangeLog4
-rw-r--r--tapset/timestamp.stp9
2 files changed, 12 insertions, 1 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog
index 00171e6b..012ed16f 100644
--- a/tapset/ChangeLog
+++ b/tapset/ChangeLog
@@ -1,3 +1,7 @@
+2006-02-22 Frank Ch. Eigler <fche@elastic.org>
+
+ * timestamp.stp (get_cycles): New function.
+
2006-02-21 Martin Hunt <hunt@redhat.com>
* context.stp: Fix definition of returnval(). Now the same as retval().
diff --git a/tapset/timestamp.stp b/tapset/timestamp.stp
index 009e1112..ee9478cb 100644
--- a/tapset/timestamp.stp
+++ b/tapset/timestamp.stp
@@ -1,5 +1,5 @@
// timestamp tapset
-// Copyright (C) 2005 Red Hat Inc.
+// Copyright (C) 2005-2006 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
@@ -12,6 +12,13 @@
%}
+// return processor cycle counter (if any)
+function get_cycles:long () %{
+ cycles_t c = get_cycles();
+ THIS->__retvalue = (int64_t) c;
+%}
+
+
// return in microseconds since epoch
function gettimeofday_us:long () %{
struct timeval tm;