how to get actual cpu usage of a proces in linux-2.6.18.8
In recent linux kernels task structure has sum_exec_runtime field and it
shows almost the actual cpu usage but in old kernels such as 2.6.18.8, it
doesn't exist. In old kernels task structure has utime and stime fields
too, but those fields don't show the actual usage. For example when I run
a process which has spend some cpu and then sleeps 1 in a infinite loop,
those fields change very slowly and they do not show small usages.
No comments:
Post a Comment