Re: libkse process stats breakage (Re: cvs commit: src/sys/amd64/ amd64 exception.S trap.c src/sys/amd64/include frame.h signal.h ucontext. h)

From: David Xu <davidxu_at_freebsd.org>
Date: Sun, 19 Oct 2003 10:26:58 +0800
Kris Kennaway wrote:

>On Tue, Oct 14, 2003 at 08:17:27PM -0700, Kris Kennaway wrote:
>  
>
>>On Wed, Oct 15, 2003 at 11:10:43AM +0800, David Xu wrote:
>>
>>    
>>
>>>The change you made to ucontext.h breaks libkse. :-(
>>>      
>>>
>>Speaking of libkse breakage: 
>>
>>10427 root      20    0 10500K  8380K kserel   6:44  0.00%  0.00%
>>    
>>
>python2.3
>  
>
>>10424 root      20    0  9292K  7280K kserel   4:43  0.00%  0.00%
>>    
>>
>python2.3
>  
>
>> 3523 kris      20    0 50924K 40996K kserel   2:32  0.00%  0.00%
>>    
>>
>MozillaFirebird-bin
>  
>
>> 
>>Those are threaded processes using libkse via libmap.conf, which are
>>using CPU but do not have any CPU% listed.  Scheduler is 4BSD, kernel
>>was built yesterday.
>>    
>>
>
>Any progress on fixing this?
>
>  
>
Following patch should give you a number to display.
Since a kse can move from a thread to another, you will
see all threads using same kse have same pctcpu number.

Index: sched_4bsd.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/sched_4bsd.c,v
retrieving revision 1.25
diff -u -r1.25 sched_4bsd.c
--- sched_4bsd.c    16 Oct 2003 21:13:14 -0000    1.25
+++ sched_4bsd.c    19 Oct 2003 02:10:53 -0000
_at__at_ -726,6 +726,8 _at__at_
     struct kse *ke;
 
     ke = td->td_kse;
+    if (ke == NULL)
+        ke = td->td_last_kse;
     if (ke)
         return (ke->ke_pctcpu);
 

>Kris
>
>  
>
Received on Sat Oct 18 2003 - 17:16:14 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:25 UTC