From owner-freebsd-current@FreeBSD.ORG Sat Oct 18 19:16:14 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 467A816A4B3; Sat, 18 Oct 2003 19:16:14 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1EAC43FA3; Sat, 18 Oct 2003 19:16:13 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h9J2G6FY051706; Sat, 18 Oct 2003 19:16:07 -0700 (PDT) (envelope-from davidxu@freebsd.org) Message-ID: <3F91F672.4050308@freebsd.org> Date: Sun, 19 Oct 2003 10:26:58 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5b) Gecko/20031004 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Kennaway References: <20031019014017.GA26106@rot13.obsecurity.org> In-Reply-To: <20031019014017.GA26106@rot13.obsecurity.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: David Xu 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) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Oct 2003 02:16:14 -0000 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 > > >