[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
do_gettimeofday().
Victor,
How come I can't get the time of day from the kernel? If I use
do_gettimeofday(), eventually the system will hang. It may not happen
right away, but it will hang. I'm trying to time external events and
record the exact time an interrupt comes in and the only way to compare
that time to other events and to other systems is to have the exact
system time. The clock_gettime() routine returns something close to
the real system clock time, but then proceeds to gain time at the rate of
35,000 nsecs/sec. That's probably due to a miss calibration in the cpu HZ
value. I have looked over the rtl_time.c file and can see where you 'sync'
the CLOCK_REALTIME to the results of a do_gettimeofday() call, but then
there doesn't seem to be any other 'tweeks' to the time to keep it in
sync. So, while the clock_gettime() produces a nice monotonic clock, it
bear little resemblance to actual time.
So, how do I get the time of day from the kernel?
Thanks for you help,
Tom
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_/_/_/_/ _/_/ _/_/ _/_/_/_/_/ _/_/_/_/ Thomas W. Folkers
_/ _/ _/ _/ _/ _/ _/ _/ Telescope Operations Mgr.
_/_/_/_/ _/ _/ _/ _/ _/ _/ Sub-Millimeter Telescope
_/ _/ _/ _/ _/ _/ Kitt Peak 12M Radio Telescope
_/ _/ _/ _/ _/ _/ 933 N. Cherry Ave. Rm. 486
_/_/_/_/ _/ _/ _/ _/_/_/_/ Tucson, Arizona 85721
------------------------------------------- email: tfolkers@as.arizona.edu
------------------------------------------ Voice: (520) 626-7837
-- http://maisel.as.arizona.edu:8080/ --- Fax: 621-5554 Pager: 446-0760
-- http://kp12m.as.arizona.edu/ --- Mobil: 909-1113 Home: 742-9279
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~