diff options
author | John M. Calandrino <jmc@jupiter-cs.cs.unc.edu> | 2007-02-15 14:44:21 -0500 |
---|---|---|
committer | John M. Calandrino <jmc@jupiter-cs.cs.unc.edu> | 2007-02-15 14:44:21 -0500 |
commit | 439e318f179943bf7302b1b3cf24eedce9ed90f0 (patch) | |
tree | 7ebf4382d3218c1a9de628d3284a1a3a0f51fbb0 /kernel | |
parent | 4e3c8553d2ec06106c131236f2fec3d7cdd960c3 (diff) |
Local commit of current state of my attempt to log quantum sync info.
Tried to read the amount of time since the last global timer interrupt
occurred and log that time on all processors using TRACE, but I think locks
are causing me grief, because the system instead hangs.
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/timer.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index c2a8ccfc28..1d42f52cad 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -737,6 +737,30 @@ static inline s64 __get_nsec_offset(void) | |||
737 | return ns_offset; | 737 | return ns_offset; |
738 | } | 738 | } |
739 | 739 | ||
740 | /* | ||
741 | * Public, non-inline version of the above function, used within | ||
742 | * local timer interrupt handler to get an idea of the current | ||
743 | * timestamp without locking. (We can't lock and are only reading, | ||
744 | * so it can only hurt us, not others.) | ||
745 | */ | ||
746 | s64 public_get_nsec_offset(void) | ||
747 | { | ||
748 | cycle_t cycle_now, cycle_delta; | ||
749 | s64 ns_offset; | ||
750 | |||
751 | /* read clocksource: */ | ||
752 | cycle_now = clocksource_read(clock); | ||
753 | |||
754 | /* calculate the delta since the last update_wall_time: */ | ||
755 | cycle_delta = (cycle_now - clock->cycle_last) & clock->mask; | ||
756 | |||
757 | /* convert to nanoseconds: */ | ||
758 | ns_offset = cyc2ns(clock, cycle_delta); | ||
759 | |||
760 | return ns_offset; | ||
761 | } | ||
762 | EXPORT_SYMBOL(public_get_nsec_offset); | ||
763 | |||
740 | /** | 764 | /** |
741 | * __get_realtime_clock_ts - Returns the time of day in a timespec | 765 | * __get_realtime_clock_ts - Returns the time of day in a timespec |
742 | * @ts: pointer to the timespec to be set | 766 | * @ts: pointer to the timespec to be set |