Re: better resolution for getrusage()?

mucci@cs.utk.edu
Thu, 29 Feb 1996 16:57:57 -0500


--------- Received message begins Here ---------

> Ben Wing wrote:
> >
> > It would sure be nice if getrusage() had microsecond resolution like
> > gettimeofday() did. How hard would this be to add?
>
> Very.
>
> Moreover the overhead would be significant. The guts of a
> gettimeofday() call takes around 17us. On the other had this might
> be worth it for some people.....

Perhaps for a future version of linux we could look into the
idea of a "kernel status page" that gets mapped into the user process
by the C library. I know OSF/1 and HPUX do this...this information can
be accessed by a single instruction. gettimeofday() is very important
to many networking applications that timestamp messages...for machines
that are really slow I have a nice hack that mmaps the _time symbol of
/dev/kmem into my process. On a sun4c I can read the clock in a few us.
vs 33us. However, no-one ever has access to /dev/kmem so...:-(

-Phil

/*%\ Philip J. Mucci | GRA in C.S. | [xxx cool stuff censored xxx] /%*\
|%*| under Dr. Jack Dongarra | George Washington grew hemp! |*%|
\*%/ http://www.cs.utk.edu/~mucci ===== HPC / PVM / Active Messages \%*/