Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Oct 2003 10:26:58 +0800
From:      David Xu <davidxu@freebsd.org>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        current@freebsd.org
Subject:   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)
Message-ID:  <3F91F672.4050308@freebsd.org>
In-Reply-To: <20031019014017.GA26106@rot13.obsecurity.org>
References:  <20031019014017.GA26106@rot13.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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
@@ -726,6 +726,8 @@
     struct kse *ke;
 
     ke = td->td_kse;
+    if (ke == NULL)
+        ke = td->td_last_kse;
     if (ke)
         return (ke->ke_pctcpu);
 

>Kris
>
>  
>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F91F672.4050308>