/proc Hz jiffies and clock_t

From: space (space_at_nospam.com)
Date: 10/15/04


Date: Fri, 15 Oct 2004 16:07:51 +0530

Hi,

How exactly are
jiffies / HZ / USER_HZ / CLOCKS_PER_SEC &
clock_t related ?

I found that some new kernels, even those that are not
2.5 or 2.6 uses clock_t as the basic time reporting units
for /proc / pid / stat &
      /proc / stat.

I have some old code that uses these proc files.
At the time the cpu resources used to be reported
in jiffies (2.4.18 & below kernels as far as i know)

A search back in time in linux newsgroups showed me
many arguments involving HZ / USER_HZ vs sysconf
/ uptime errors / process start time errors etc, around
the time of 2.5.x kernel

But none of them tells me why exactly the time units have
been changed. (my parse error)

There seems to be some issues in exposing the HZ to the
normal user. I saw some args involving everyone including
linus, callahan, cox etc etc.

What exactly is the whole issue and how has it has been
solved now ?

And from what version are these changes encorporated
into the kernel ? (I saw these changes in RH EL 3 for eg)

Without the above information, how does the procps
package know that the time reported is in jiffies or
clock_t's ?

I was thinking of using the presence of the group time fields
for NPTL threads as an indication of the time unit shifts,
since it is in indication of the presence of 2.6 era
patches.

If not, how else do i sense how the cpu information time units ?

Thanks in advance
Arun

ps: procps-list@redhat seemed to be the only mailing list
         for procps & it seems to bounce my mails
    Robert love's procps page http://tech9.net/rml/procps/
            seems to be down
    Havent yet tried the new procps list maintained at sourceforge