Re: accurate timing

Oliver Xymoron (oxymoron@waste.org)
Wed, 8 Sep 1999 10:43:49 -0500 (CDT)


On Wed, 8 Sep 1999, Jose Miguel Pereira Tavares wrote:

> On Wed, 08 Sep 1999, Oliver Xymoron wrote:
> >On Tue, 7 Sep 1999, Virginie Galtier wrote:
> >
> >> Is it possible to know the time spent by a process into the processor
> >> with a better accuracy than jiffies (100 jiffies in one second)?
> >
> >Not in general. You can recompile with a faster HZ, however.
>
> Or you could take a look into the APIC of the pentium and
> pentium-pro (and after). Althoug most pentium MB don't enable the APIC
> (so probably only if you are using a p6 could you use it).

Actually, the right way to do it is with the cycle counting register,
adding code to the system call entry and exit points. And you need to add
some more smarts for things that sleep, probably in switchto. But this of
course adds overhead and requires changing the code.

This also doesn't get to the question of how to account for interrupts,
networking, etc.

--
 "Love the dolphins," she advised him. "Write by W.A.S.T.E.." 

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