On Wed, Jul 25, 2012 at 10:09 AM, Nadav Har'El <[email protected]> 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?

You could try to post-process the output of strace -tt -T <cmd>
The times strace provide are fairly accurate but it does change the
process a bit (switching to the tracing process for any system call).

An alternative could be to use systemtap to collect the information
with less impact. systemtap lets you define a tracing logic for the
kernel, it will generate a kernel module implementing this logic that
you can load into the kernel. It still has impact but less than the
context switch to another process.

Baruch

_______________________________________________
Linux-il mailing list
[email protected]
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to