开发者

How often are utime and stime fields in /proc/<pid>/task/<tid>/stat updated?

开发者 https://www.devze.com 2023-02-23 01:53 出处:网络
When I repeatedly check the values in /proc/<pid>/task/<tid>/stat on a Linux with kernel version > 2.6.2, where <pid> is a process ID, and <tid> is a thread ID, I noticed that

When I repeatedly check the values in /proc/<pid>/task/<tid>/stat on a Linux with kernel version > 2.6.2, where <pid> is a process ID, and <tid> is a thread ID, I noticed that the fields utime and stime开发者_运维问答 (#14 and #15) did not change every time. Do you know what rules the kernel uses to decide how often the thread stats is updated? Or is there anyway to check it?


stime is system time i.e time spent by process in kernel mode while utime is time spent in user mode. These values depend on scheduling of that particular process. There is no such interval defined for its update. They are quickly updated as the time spend in respective modes changes.

Process enters in kernel mode when a syscall happen.

0

精彩评论

暂无评论...
验证码 换一张
取 消