High-resolution user/system times?
Ariel Bar David
ori at bardavid.org
Wed Jul 25 10:25:10 IDT 2012
A quick Google search ended with this -
http://serverfault.com/questions/151109/bash-how-do-i-get-current-unix-time-in-milliseconds
,
so maybe running 'date +%s%N | cut -b1-13' before starting the process and
after it's finished will help...
Ori
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?
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20120725/16904c54/attachment.html>
More information about the Linux-il
mailing list