From 602149dadba5e74e6de8b5a172a64b13dcce6f1d Mon Sep 17 00:00:00 2001 From: fche Date: Wed, 22 Feb 2006 18:19:11 +0000 Subject: 2006-02-22 Frank Ch. Eigler * stapfuncs.5.in: Document get_cycles(). * testsuite/buildok/timestamp.stp: Build it and its friends. 2006-02-22 Frank Ch. Eigler * timestamp.stp (get_cycles): New function. --- tapset/timestamp.stp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tapset/timestamp.stp') 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; -- cgit