Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Feb 1998 17:13:34 +0100
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        dannyman <dannyman@sasquatch.dannyland.org>
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: Curious: "Timecounter"? 
Message-ID:  <3448.888596014@critter.freebsd.dk>
In-Reply-To: Your message of "Fri, 27 Feb 1998 09:51:15 CST." <19980227095115.05314@urh.uiuc.edu> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <19980227095115.05314@urh.uiuc.edu>, dannyman writes:
>arh0300 kernel log messages:
>> Timecounter "i8254"  frequency 1193182 Hz  cost 2524 ns
>> Timecounter "TSC"  frequency 99952423 Hz  cost 356 ns
>> wcd0: 0Kb/sec, caddy
>> wcd0: medium type unknown
>
>Wow, the new kernel compiling mechanism is kinda neat.
>
>I'm curious about these Timecounter lines.  Can anyone explain, in terms a
>fairly unsophisticated guy like me could understand, what these lines mean?

It means that the machine has two pieces of hardware it can use for
the construction of "time-of-day".

"frequency" should be pretty obvious, "cost" is how long time it takes
to read the counter, and consequently a measure of the overhead by using
that timecounter.

To get from the reading of the timecounters which is just a binary counter 
running at "frequency" to microtime() and/or nanotime() various scaled integer 
math is done.  You can find the relevant code in 
	sys/sys/time.h,
	sys/kern/kern_clock.c,
	sys/kern/kern_ntptime.c,
	sys/i386/isa/clock.c

--
Poul-Henning Kamp             FreeBSD coreteam member
phk@FreeBSD.ORG               "Real hackers run -current on their laptop."
"Drink MONO-tonic, it goes down but it will NEVER come back up!"

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3448.888596014>