* 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.
+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.
.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
+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().
// 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;
--- /dev/null
+#! stap -p4
+
+probe begin {
+ log(string(get_cycles() + gettimeofday_us() +
+ gettimeofday_ms() + gettimeofday_s()))
+}