Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Mar 2005 14:13:54 -0600
From:      Jon Noack <noackjr@alumni.rice.edu>
To:        Pete French <petefrench@ticketswitch.com>
Cc:        stable@FreeBSD.ORG
Subject:   Re: Just a sanity check before I sumbit a buig report
Message-ID:  <4231FC02.8050205@alumni.rice.edu>
In-Reply-To: <E1D9mka-000P9Q-1Y@dilbert.firstcallgroup.co.uk>
References:  <E1D9mka-000P9Q-1Y@dilbert.firstcallgroup.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Pete French wrote:
>>Why does sysconf(_SC_CLK_TCK) always returns 128?  Check out sysconf() 
>>in src/lib/libc/gen/sysconf.c (lines 83-84 of rev. 1.10):
> 
> [follow through of code showing it is defined as a constant snipped]
> 
>>To determine how stathz can vary, we'll have to dig deeper.  Check out 
>>initclocks() in src/sys/kern/kern_clock.c (lines 196-213 of rev. 
>>1.105.2.11):
> 
> [follow through of code showing it depends on apm_attach() snipped]
> 
> Thanks for that, most instructive! So the conclusion appears to be that
> sysconf(_SC_CLK_TCK) is doing the wrong thing by returning a constant then ?
> Thanks, I'll submit a pr about it. Do you mind if I attach your email to
> it to show the follow through of the code ? I havent looked at it myself in
> that much depth.

sysconf(3) states that _SC_CLK_TCK is the "frequency of the statistics 
clock in ticks per second."  Considering this value varies, returning a 
constant is wrong.  Feel free to attach my email on the PR.

Also, have you verified that apm is enabled and listed with "flags 0x20" 
in the kernel config(s) of the problematic system(s)?

Jon



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