[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Time spent in user mode and system mode.



Hello,

Cyril Roelandt, le Tue 09 Oct 2012 03:21:36 +0200, a écrit :
> $ ./getter && ./procinfo && ./task_info
> System 1900, User 300
> System 192000, User 300
> System 0, User 0

task_info is not surprising: see the error you are getting: you can not
directly get the task info from the kernel without being privileged.
With privileges, you get the same as procinfo. As pino suggested, getter
probably doesn't include the idle task.

> $ head -1 /proc/stat
> cpu  2884 0 0 195460 0 0 0 0 0

Note that this is in ticks, not in seconds, and procfs does not
currently accounts system mode (see the source code), it's all taken as
user mode.

Samuel


Reply to: