High-resolution user/system times?

High-resolution user/system times?

Oleg Goldshmidt pub at goldshmidt.org
Wed Jul 25 11:04:20 IDT 2012


On Wed, Jul 25, 2012 at 10:09 AM, Nadav Har'El <nyh at math.technion.ac.il>wrote:

> Hi, as you know the time(1) command, and the times(2) system call is
> able to separate a process's running time into "user" and "system" time,
> measuring the CPU time in user space and kernel space respectively.
>
> However, these only have a jiffy (often 1/250 seconds) resultion.
>
> I'm now trying to measure a process running around 3 milliseconds, less
> than one jiffy, and I still want to understand how much of it is spent in
> user space, and how much of it is spent in kernel space (e.g., handling on
> minor page faults caused by this process). Does anybody have any idea what
> I
> can use to do that, preferably without modifying the Linux kernel?
>

man 2 getrusage ?

>
> Before anyone asks, no - I cannot cause this 3 milliseconds to take 3
> seconds by looping 1000 times, because this will completely change the
> behavior (e.g., page faults) caused by the process. Also, I have full
> control of the machine, so any mechanism which measures CPU usage in the
> whole machine instead of just one specific process would also be fine.
>
> Any ideas would be valued.
>
> Nadav.
>
> --
> Nadav Har'El                        |        Wednesday, Jul 25 2012, 6 Av
> 5772
> nyh at math.technion.ac.il
> |-----------------------------------------
> Phone +972-523-790466, ICQ 13349191 |I am not a complete idiot - some
> parts
> http://nadav.harel.org.il           |are missing.
>
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>



-- 
Oleg Goldshmidt | oleg at goldshmidt.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20120725/7c6df9a2/attachment.html>


More information about the Linux-il mailing list