Linux-kernel mailing list archive 2000-06,: Re: keeping track of time spend in non-user space

# Re: keeping track of time spend in non-user space

Artur Skawina (skawina@geocities.com)
Sat, 12 Feb 2000 03:55:23 +0100

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Aman Singla: "Re: Scheduled Transfer Protocol on Linux"
- Previous message: willy@thepuffingroup.com: "Re: 'core' (patch)"
- Maybe in reply to: Sjaak Koot: "keeping track of time spend in non-user space"
- Next in thread: Mikael Pettersson: "Re: 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/

- Next message: Aman Singla: "Re: Scheduled Transfer Protocol on Linux"
- Previous message: willy@thepuffingroup.com: "Re: 'core' (patch)"
- Maybe in reply to: Sjaak Koot: "keeping track of time spend in non-user space"
- Next in thread: Mikael Pettersson: "Re: keeping track of time spend in non-user space"