From owner-freebsd-bugs@FreeBSD.ORG Wed Aug 16 13:06:55 2006 Return-Path: X-Original-To: freebsd-bugs@FreeBSD.org Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8FD3016A4DF for ; Wed, 16 Aug 2006 13:06:55 +0000 (UTC) (envelope-from bde@zeta.org.au) Received: from mailout1.pacific.net.au (mailout1.pacific.net.au [61.8.0.84]) by mx1.FreeBSD.org (Postfix) with ESMTP id 233B443D53 for ; Wed, 16 Aug 2006 13:06:54 +0000 (GMT) (envelope-from bde@zeta.org.au) Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id BE9A2329FDC; Wed, 16 Aug 2006 23:06:52 +1000 (EST) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailproxy2.pacific.net.au (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k7GD6oYO010802; Wed, 16 Aug 2006 23:06:51 +1000 Date: Wed, 16 Aug 2006 23:06:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Giorgos Keramidas In-Reply-To: <200608151230.k7FCUNf3014171@freefall.freebsd.org> Message-ID: <20060816225021.R37670@delplex.bde.org> References: <200608151230.k7FCUNf3014171@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-bugs@FreeBSD.org Subject: Re: bin/101975: [PATCH] Adding percents in /usr/src/usr.bin/systat/pigs.c X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Aug 2006 13:06:55 -0000 [Private reply] Hi Giorgos, > On 2006-08-14 14:54, bsd@forbrazil.com.br wrote: > > Sorry, but i'm only based in 'systat -swaps', where shows it: > > Disk 1K-blocks Used /0% /10% /20% /30% /40% /50% /60% /70% /80% /90% /100% > > ad0s1 8388480 1076 X > > There is no % after 100 in "systat -swap". Precisely because all those > % characters push the line length up to almost 80 characters and this > would overflow 80x25 terminal lines. The truncation seems to depend on whether swap is configured. With no swap configured, the display is a mess and looks like "...10\n0. It looks like it started with 100% and truncated to 100 but was still too long so the line wrapped. I suspect that it truncates at 80 columns and wraps at 79 columns. With 1 swap device configured, this display is less of a mess and looks like "...10\n. I suspect that it still mistruncates and wraps, but the line for the first swap device starts at column 1 and overwrites the garbage. It seems unlikely that the scale is correct with the %'s expanding things. It's hard to tell -- I never use swap on systems with more than 64MB of memory, and most systems have lots of swap and use epsilon% of it. > I'm not sure it's worth repeating the same 'hack' in other screens, but > I'd certainly prefer any of: > > Disk 1K-blocks Used /0 /10 /20 /30 /40 /50 /60 /70 /80 /90 /100% > Disk 1K-blocks Used /0% /10 /20 /30 /40 /50 /60 /70 /80 /90 /100 % at the end looks good. Some other displays use "%foo N1...Nk" instead of foo "N1%...Nk%" to save space. Looking at the pigs display reminded me that it shows bogus idle percentages. On an idle machine with N CPUs, after warming up it shows taking about 100/(N+1)% and N idle threads also taking 100/(N+1)%. top -S shows the idle threads correctly as taking almost 100%. I think the problem is that it doesn't understand the per-cpu idle thread. It might also not understand idle priority threads. Bruce