Just a sanity check before I sumbit a buig report

Pete French petefrench at ticketswitch.com
Thu Mar 10 03:13:08 PST 2005

> 'sysctl kern.clockrate' will return this information if you don't want to
> write a program to do it for you :)

I was just using the code from time(1). Inteesring though - heres the

kern.clockrate: { hz = 100, tick = 10000, tickadj = 5, profhz = 100, stathz = 100 }

So that thinks stathz is 100, but sysconf(_SC_CLK_TCK) is returning 128!

> What are the two machines?  stathz is 128 on i386, 100 on sparc64, and 130
> on amd64. Or thats the defaults at least.

These are all i386 machines - I have a number of them, all running 4.11.
I can take the same a.out and run it on all of them - on some both
numbers are 128, on other the numbers are 100 and 128.

If I go to one where both the calls return 128 though, the output
of 'sysctl kern.clockrate' is this:

kern.clockrate: { hz = 100, tick = 10000, tickadj = 5, profhz = 1024, stathz = 128 }

So, it looks like theres a bug in sysconf(_SC_CLK_TCK) possibly ? because
it seems to be always returning 128, regardless of the value of stathz
as returned by 'sysctl kern.clockrate'

I can reproduce this on a number of machines BTW - the only things they have in
common is that I wrote their kernel config files at various points in time...


More information about the freebsd-stable mailing list