This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [rbraun at sceen dot net: [PATCH] Make __getclktck return 100 for the Hurd]
- From: Richard Braun <rbraun at sceen dot net>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: bug-hurd at gnu dot org, libc-alpha at sourceware dot org
- Date: Wed, 12 Jun 2013 01:05:05 +0200
- Subject: Re: [rbraun at sceen dot net: [PATCH] Make __getclktck return 100 for the Hurd]
- References: <20130611222607 dot GA2793 at mail dot sceen dot net> <20130611224917 dot E93042C07D at topped-with-meat dot com> <20130611225504 dot GA8246 at mail dot sceen dot net> <20130611225546 dot B6CA52C09F at topped-with-meat dot com>
On Tue, Jun 11, 2013 at 03:55:46PM -0700, Roland McGrath wrote:
> > The /proc file system is merely an example. Also, it's not internal to
> > libc, since it gets exported through sysconf(_SC_CLK_TCK).
>
> You'll have to explain what problem you think there is more thoroughly.
Basically, top doesn't report correct CPU times. This is caused by
sysconf() returning 1000000 while values read from /proc are true tick
counts, hence 100 per second at most. This discrepancy can be solved
either by making /proc scale its values, or making libc return the
actual number of ticks per second. I personally think the latter is
better for clarity, and also to limit overflows for long running
processes, although that's really secondary.
--
Richard Braun