summaryrefslogtreecommitdiffstats
path: root/tapset
diff options
context:
space:
mode:
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;