]> sourceware.org Git - systemtap.git/commitdiff
2006-02-22 Frank Ch. Eigler <fche@elastic.org>
authorfche <fche>
Wed, 22 Feb 2006 18:19:11 +0000 (18:19 +0000)
committerfche <fche>
Wed, 22 Feb 2006 18:19:11 +0000 (18:19 +0000)
* 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.

ChangeLog
stapfuncs.5.in
tapset/ChangeLog
tapset/timestamp.stp
testsuite/buildok/timestamp.stp [new file with mode: 0755]

index 31edfa56cee0acbdf2430d36a0173331671212a7..4f1bdc0e483851c6ade97791a37c7d7e1f12d4ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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>
 
        PR 2293.
index 04ada825b809dbc1f99076d2cd90d0178ce97678..e133799345a987c307e5d8306fd48630fdad8ea1 100644 (file)
@@ -94,6 +94,9 @@ Return 1 if string s1 contains string s2, returns 0 otherwise.
 
 .SS TIMESTAMP
 .TP
+get_cycles:long ()
+Return the processor cycle counter value, or 0 if unavailable.
+.TP
 gettimeofday_us:long ()
 Return the number of microseconds since the UNIX epoch.
 .TP
index 00171e6bb5bad6c88be99ff23e18b842fe9bae1c..012ed16faef15389c2b0f41f886506c6cfd20f5b 100644 (file)
@@ -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().
index 009e1112b2f15a1bc0dd6cacf85e50ba99879407..ee9478cbca3fd2cba6f8be68add2e27d33f16d8c 100644 (file)
@@ -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
 %}
 
 
+// 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;
diff --git a/testsuite/buildok/timestamp.stp b/testsuite/buildok/timestamp.stp
new file mode 100755 (executable)
index 0000000..f273262
--- /dev/null
@@ -0,0 +1,6 @@
+#! stap -p4
+
+probe begin {
+  log(string(get_cycles() + gettimeofday_us() +
+             gettimeofday_ms() + gettimeofday_s()))
+}
This page took 0.035582 seconds and 5 git commands to generate.