From owner-cvs-src@FreeBSD.ORG Mon Apr 18 22:19:36 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C4AB716A4CE; Mon, 18 Apr 2005 22:19:36 +0000 (GMT) Received: from mailout2.pacific.net.au (mailout2.pacific.net.au [61.8.0.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1FD4543D39; Mon, 18 Apr 2005 22:19:36 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87])j3IMJQml015547; Tue, 19 Apr 2005 08:19:26 +1000 Received: from epsplex.bde.org (katana.zip.com.au [61.8.7.246]) j3IMJO0I001058; Tue, 19 Apr 2005 08:19:24 +1000 Date: Tue, 19 Apr 2005 08:19:24 +1000 (EST) From: Bruce Evans X-X-Sender: bde@epsplex.bde.org To: Giorgos Keramidas In-Reply-To: <20050418104310.GA13345@orion.daedalusnetworks.priv> Message-ID: <20050419075745.B1559@epsplex.bde.org> References: <200504161543.j3GFhclO075103@repoman.freebsd.org> <86acnyd2k7.fsf@xps.des.no> <20050416191436.G68941@fledge.watson.org> <863btq4k9m.fsf@xps.des.no> <20050417110321.GA78636@gothmog.gr> <20050417135844.GA792@gothmog.gr> <20050418104310.GA13345@orion.daedalusnetworks.priv> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed cc: Dag-Erling Sm?rgrav cc: src-committers@freebsd.org cc: Robert Watson cc: cvs-all@freebsd.org cc: cvs-src@freebsd.org Subject: Re: cvs commit: src/usr.bin/top machine.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Apr 2005 22:19:36 -0000 On Mon, 18 Apr 2005, Giorgos Keramidas wrote: > On 2005-04-18 15:57, Bruce Evans wrote: >> On Sun, 17 Apr 2005, Giorgos Keramidas wrote: >>> On 2005-04-17 23:01, Bruce Evans wrote: >>>> Just removing the CPU column doesn't seem right. ps has a -C flag >>>> to switch between WCPU and CPU. >>> >>> We can add a new toggle command to top, i.e. 'C', that toggles >>> between displaying WCPU or CPU. This should regain us a lot of the >>> space lost from COMMAND after I added THR. >> >> I like that. > > Unfortunately, David has already said he doesn't, so making such a > chance wouldn't be good enough, but thanks :) I think he doesn't really mean that. > ... > I'll add the C option to the right place in my local copy. Moving H too > is an option, but that should probably be done as part of a different > style-sweep of top, which has an amazing number of style bugs already. Note that it is not in KNF, so most changes towords KNF in it would be style bugs, and it's hard to tell what the style is. >> I thought that you would have to change the sorting method to switch >> between WCPU and CPU, but the existing sorting is only on CPU. It is >> just more bogus to sort on CPU while only displaying WCPU. > > Ah, yes. Good point. I thought about it for a while, but was > undecided. Changing the sort order needs a new sorting method, > but it's definitely something I can easily add. Maybe you can just change ki_pctcpu to the value that will be displayed, and not change the sorting method. (Maybe use an extension of the struct or a spare member of the struct to avoid abusing ki_pctcpu.) I sometimes want to look at ki_estcpu, which is an even rawer version of ki_pctcpu. (This is given by the CPU header and cpu keyword in ps. It's confusing that top has different headers -- its WCPU corresponds to ps's %CPU header and %cpu keyword, except with the C toggle in ps, its CPU corresponds to those.) The toggle is not so good for switching between more than 2 variants of CPU. Bruce