lkml.org 
[lkml]   [2008]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[RFC PATCH 09/23 -v4] time keeping add cycle_raw for actual incrementation
The get_monotonic_cycles needs to produce a monotonic counter as output.

This patch adds a cycle_raw to produce an accumulative counter.
Unfortunately there is already an cycle_accumulate variable, but that is
used to avoid clock source overflow and can also be decremented
(probably that name should be changed and we should use that for this
patch).


Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: John Stultz <johnstul@us.ibm.com>

---
include/linux/clocksource.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Index: linux-mcount.git/include/linux/clocksource.h
===================================================================
--- linux-mcount.git.orig/include/linux/clocksource.h 2008-01-17 20:33:37.000000000 -0500
+++ linux-mcount.git/include/linux/clocksource.h 2008-01-17 20:33:40.000000000 -0500
@@ -87,7 +87,7 @@ struct clocksource {
* more than one cache line.
*/
struct {
- cycle_t cycle_last, cycle_accumulated;
+ cycle_t cycle_last, cycle_accumulated, cycle_raw;
} ____cacheline_aligned_in_smp;

u64 xtime_nsec;
@@ -204,6 +204,7 @@ static inline void clocksource_accumulat
cycle_t offset = (now - cs->cycle_last) & cs->mask;
cs->cycle_last = now;
cs->cycle_accumulated += offset;
+ cs->cycle_raw += offset;
}

/**
--


\
 
 \ /
  Last update: 2008-01-21 16:29    [from the cache]
©2003-2011 Jasper Spaans