lkml.org 
[lkml]   [2000]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: keeping track of time spend in non-user space
Sjaak Koot wrote:
>
> I am using linux kernel 2.2.13 on a Pentium PC.
>
> I would like to keep track of the CPU time in user space of a process or
> task. The user/system time currently implemented is not accurate enough,
> its resolution is 10 ms.
>
> The idea was to keep track when a process enters/leaves the kernel space
> and use the time stamp counter to measure the amount of time spend in
> the kernel and substract this from the wall clock time. Note that I would like
> to know the CPU time in user space for each process separately.
>
> Anyone already implemented this ?

Jan Astalos <astalos@tuke.sk> has some patches which make use of the TSC
for precise time accounting.
On 586/686 you could use the MSRs to get exact user/kernel cycle numbers
too, but i'm afraid that would be way to slow to be acceptable as a
generic solution (a lot extra cycles per every ctx switch).



-
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/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.048 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site