Re: better resolution for getrusage()?

Matti E Aarnio (mea@mea.cc.utu.fi)
Sat, 2 Mar 1996 20:35:21 +0200 (EET)


...
> I asked because I just implemented some profiling in XEmacs, and I
> was trying to figure out a way to get more accurate timings. If
> getrusage() had so much overhead, it might not be useful, but it
> would still help immensely if there were a way of getting SIGPROF's
> to occur more than 100 times per second.
>
> If I change HZ to 1000 and recompile my kernel, will this work?

At Alphas the HZ is 1024 (or sometimes 997).
At all other systems it appears to be 100.

> How about a way to change this without recompiling the kernel?
> E.g.
>
> -- make HZ be a variable instead of a preprocessor constant.
> -- add a system call (callable by root only, of course) that
> changes the frequency of the system clock.

A boot-time parameter would make sense, but runtime
changein would not -- all timers set before the change
would misbehave.

> I have no idea how difficult this would be, i.e. if it would wreak
> havoc on some device drivers.
>
> ben

/Matti Aarnio <mea@utu.fi>