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?
Asked
Active
Viewed 2,803 times
4

Andrew Grimm
- 78,473
- 57
- 200
- 338

user559484
- 41
- 1
- 2
1 Answers
4
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.

Gyan Gupta
- 986
- 8
- 15