summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjistone <jistone>2006-04-07 19:29:42 +0000
committerjistone <jistone>2006-04-07 19:29:42 +0000
commita5102b6751067a3345fc96727e1a753915f982ae (patch)
tree34b068d32967cbfcd71921847458a4484d39463f
parent6b5c6447ae8d0eed1065ef56bc483eed737e3b9e (diff)
downloadsystemtap-steved-a5102b6751067a3345fc96727e1a753915f982ae.tar.gz
systemtap-steved-a5102b6751067a3345fc96727e1a753915f982ae.tar.xz
systemtap-steved-a5102b6751067a3345fc96727e1a753915f982ae.zip
Reverting change - xtime_lock is not exported on FC5 kernel
-rw-r--r--tapset/ChangeLog7
-rw-r--r--tapset/timestamp.stp63
2 files changed, 9 insertions, 61 deletions
diff --git a/tapset/ChangeLog b/tapset/ChangeLog
index 90e6af3e..bdad3877 100644
--- a/tapset/ChangeLog
+++ b/tapset/ChangeLog
@@ -1,10 +1,3 @@
-2006-04-07 Josh Stone <joshua.i.stone@intel.com>
-
- PR2525
- * timestamp.stp (__check_xtime_lock): check if xtime is available
- (gettimeofday_s, gettimeofday_ms, gettimeofday_us): error out if
- called when xtime is not available, to avoid deadlock
-
2006-03-06 Martin Hunt <hunt@redhat.com>
* system.stp: New tapset.
diff --git a/tapset/timestamp.stp b/tapset/timestamp.stp
index 43fb4703..ee9478cb 100644
--- a/tapset/timestamp.stp
+++ b/tapset/timestamp.stp
@@ -1,6 +1,5 @@
// timestamp tapset
// Copyright (C) 2005-2006 Red Hat Inc.
-// Copyright (C) 2006 Intel Corporation.
//
// 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
@@ -10,23 +9,6 @@
%{
#include <linux/time.h>
-
-/* Try to determine the status of xtime_lock.
- * Returns: zero if xtime_lock was found valid for reading
- * non-zero if we waited too long for availability
- */
-static inline int __check_xtime_lock(void)
-{
- unsigned numtrylock = 0;
- unsigned seq = read_seqbegin(&xtime_lock);
- while (read_seqretry(&xtime_lock, seq)) {
- if (++numtrylock >= MAXTRYLOCK)
- return 1;
- ndelay(TRYLOCKDELAY);
- seq = read_seqbegin(&xtime_lock);
- }
- return 0;
-}
%}
@@ -39,50 +21,23 @@ function get_cycles:long () %{
// return in microseconds since epoch
function gettimeofday_us:long () %{
- if (__check_xtime_lock())
- {
- /* TODO: is there a way to approximate gettimeofday? */
- CONTEXT->last_error = "unable to call do_gettimeofday";
- THIS->__retvalue = 0LL;
- }
- else
- {
- struct timeval tm;
- do_gettimeofday (& tm);
- THIS->__retvalue = (tm.tv_sec * 1000000ULL) + (tm.tv_usec);
- }
+ struct timeval tm;
+ do_gettimeofday (& tm);
+ THIS->__retvalue = (tm.tv_sec * 1000000ULL) + (tm.tv_usec);
%}
// return in milliseconds since epoch
function gettimeofday_ms:long () %{
- if (__check_xtime_lock())
- {
- /* TODO: is there a way to approximate gettimeofday? */
- CONTEXT->last_error = "unable to call do_gettimeofday";
- THIS->__retvalue = 0LL;
- }
- else
- {
- struct timeval tm;
- do_gettimeofday (& tm);
- THIS->__retvalue = (tm.tv_sec * 1000ULL) + (tm.tv_usec / 1000);
- }
+ struct timeval tm;
+ do_gettimeofday (& tm);
+ THIS->__retvalue = (tm.tv_sec * 1000ULL) + (tm.tv_usec / 1000);
%}
// return in seconds since epoch
function gettimeofday_s:long () %{
- if (__check_xtime_lock())
- {
- /* TODO: is there a way to approximate gettimeofday? */
- CONTEXT->last_error = "unable to call do_gettimeofday";
- THIS->__retvalue = 0LL;
- }
- else
- {
- struct timeval tm;
- do_gettimeofday (& tm);
- THIS->__retvalue = tm.tv_sec;
- }
+ struct timeval tm;
+ do_gettimeofday (& tm);
+ THIS->__retvalue = tm.tv_sec;
%}
// likewise jiffies, monotonic_clock ...