From owner-cvs-src@FreeBSD.ORG Mon May 16 04:57:34 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 DCF6516A4CE; Mon, 16 May 2005 04:57:34 +0000 (GMT) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 44DCC43D1F; Mon, 16 May 2005 04:57:34 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.0.87])j4G4vWrI026648; Mon, 16 May 2005 14:57:32 +1000 Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) j4G4vUZf005468; Mon, 16 May 2005 14:57:31 +1000 Date: Mon, 16 May 2005 14:57:31 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: "David O'Brien" In-Reply-To: <20050516032743.GA89903@dragon.NUXI.org> Message-ID: <20050516143822.D42751@delplex.bde.org> References: <200504161543.j3GFhclO075103@repoman.freebsd.org> <20050516001837.GA65506@dragon.NUXI.org> <20050516004059.GA15002@gothmog.gr> <20050516032743.GA89903@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: Giorgos Keramidas cc: cvs-all@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, 16 May 2005 04:57:35 -0000 On Sun, 15 May 2005, David O'Brien wrote: > On Mon, May 16, 2005 at 03:40:59AM +0300, Giorgos Keramidas wrote: >> On 2005-05-15 17:18, David O'Brien wrote: >>> >>> Please back machine.c back to revsion 1.69, ASAP. >>> The current top is redicious: > ..snip.. >> Your USERNAME column is too wide (12 columns). Do you happen to have >> very long names? > > The dovecot port adds a the 'dovecot-auth' user. > The top(1) code supports 13 character usernames on SMP systems and 15 on > UP systems. Your rev 1.70-1.71 changes failed to take that into account. Another bug in top is that it expands the USERNAME column to have enough space for the longest user name (clipped to 13 or 15 characters), even when the user(s) with the longest name have never run any processes. Another bug in at last old versions of top (machine.c 1.51) is that this support is broken if there is actually a user name of maximal length, due to essentially the same bug that brought this thread back to life: the header is not properly truncated; for a 15-character USERNAME column it gives a header length of 80, and on 80-column terminals with auto-wrap this causes the same horrible line wrap is for header lengths > 80 (but slightly uglier because the extra line doesn't even have anything on it): %%% 18 process 15391 running, 17 slee 0.03, 0.01, 0.00 up 0+00:28:54 14:37:01 CPU states: % user, % nice, % system, % interrupt, % idle Mem: 7516K A 0.0e, 17M I 0.0, 20M Wi 0.0 36K Cache 0.0M Buf, 957M F 100 Swap: 64 PID USERNAME PRI NICE SIZE RES STATE TIME WCPU CPU COMMAND 1 root 8 0 716K 368K wait 0:01 0.00% 0.00% init 551 bde 8 0 3200K 3072K wait 0:00 0.00% 0.00% bash ... %%% The extra line causes the screen to scroll, and this messes up the lines before the header. (I tried adding a 16-character user name to see if utilities handle the resulting non-strings in struct utmp. They do.) >> If that is true, would it be ok to wait 1-2 days until I have a >> machine.c version that prints USERNAME using only 8 columns instead of >> using arbitrarily long columns, like now? > > I don't know why to wait 1-2 days. I made the change in 1 minute. Or is > there debate if that change will be acceptable? If there isn't a debate > about it, let me know and I'll commit this diff. It is easy to add more bugs in 1 minute. Bruce