]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Don't zero td_runtime when billing thread CPU usage to the process;
authorRobert Watson <rwatson@FreeBSD.org>
Thu, 10 Jan 2008 22:11:20 +0000 (22:11 +0000)
committerRobert Watson <rwatson@FreeBSD.org>
Thu, 10 Jan 2008 22:11:20 +0000 (22:11 +0000)
commitd92909c1d40c7af132a1a01b2271b3d036addcec
tree521eeaf16fcaaa04187cb36d5416f01065cdf9a3
parenta3ab9923ff08afe687218832efbc49d46500c796
Don't zero td_runtime when billing thread CPU usage to the process;
maintain a separate td_incruntime to hold unbilled CPU usage for
the thread that has the previous properties of td_runtime.

When thread information is requested using the thread monitoring
sysctls, export thread td_runtime instead of process rusage runtime
in kinfo_proc.

This restores the display of individual ithread and other kernel
thread CPU usage since inception in ps -H and top -SH, as well for
libthr user threads, valuable debugging information lost with the
move to try kthreads since they are no longer independent processes.

There is universal agreement that we should rewrite the process and
thread export sysctls, but this commit gets things going a bit
better in the mean time.  Likewise, there are resevations about the
continued validity of statclock given the speed of modern processors.

Reviewed by: attilio, emaste, jhb, julian
sys/kern/init_main.c
sys/kern/kern_proc.c
sys/kern/kern_resource.c
sys/kern/kern_synch.c
sys/sys/proc.h