bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [address@hidden: [PATCH] Make __getclktck return 100 for the Hurd]


From: Roland McGrath
Subject: Re: [address@hidden: [PATCH] Make __getclktck return 100 for the Hurd]
Date: Tue, 11 Jun 2013 16:13:53 -0700 (PDT)

> 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.

In fact, that is not a "true tick count".  Most modern Linux kernels have
ticks at 1024Hz, for example.  The ABI for certain /proc/PID/* files is
that certain fields are in centiseconds.  That has nothing (except for an
historical relationship) to do with the actual frequency used in the kernel.

This is a bug in procfs, regardless.  If it's a good idea to change what
libc uses, then we'll change.  Any caller of times or clock (i.e. any
interface using clock_t) has to use sysconf (_SC_CLK_TCK) to know the
translation from "clock ticks" to units of real time.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]