lkml.org 
[lkml]   [2001]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: How to know HZ from userspace?
> On Wed, Jun 06, 2001 at 08:09:33PM +0200, Tomas Telensky wrote:
> > > Hi!
> > >
> > > Is there any way to read out the compile-time HZ value of the kernel?
> >
> > Why simply #include <asm/param.h>?
>
> because the include file doesn't say anything about the HZ value of
> the currently running kernel, but only about some kernel source somewhere
> on your harddrive?

This _SHOULD_ correspond on each linux instalation. But if you would
distribute a binary to other people it's a problem.

(note that I'm running an rc script, which sets the symlink /usr/src/linux
properly at boottime ... this should be everywhere)

There is also one way how to guess HZ - calibrate :-)))
Recently I've done more difficult thing - I not only guess the HZ value, I
also guess the time when the tick comes. But it uses a bit of statistics and
may be inaccurate on loaded systems. And you need TSC :-)

Tomas

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:54    [W:0.040 / U:1.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site