From owner-svn-src-head@freebsd.org Tue Aug 8 13:56:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FE46DB4FF0; Tue, 8 Aug 2017 13:56:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id C47386342B; Tue, 8 Aug 2017 13:56:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 32CAF104AEEA; Tue, 8 Aug 2017 23:55:53 +1000 (AEST) Date: Tue, 8 Aug 2017 23:55:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Emmanuel Vadot cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r322252 - head/usr.bin/vmstat In-Reply-To: <201708081218.v78CIBvL068413@repo.freebsd.org> Message-ID: <20170808225104.I3528@besplex.bde.org> References: <201708081218.v78CIBvL068413@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=Q9sN3FMeAAAA:8 a=IM31cjteyJiYWX7TRqIA:9 a=wIYqAnBEUc7iLIlU:21 a=DlAg6Rs7D7Kog30i:21 a=CjuIK1q_8ugA:10 a=mnDzqiP7QBHErLppGYsC:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Aug 2017 13:56:01 -0000 On Tue, 8 Aug 2017, Emmanuel Vadot wrote: > Log: > vmstat: Always emit a space after the free-memory column > > When displaying in non-human form, if the free-memory number > is large (more than 7 digits), there is no space between it and > the page fault column. > > PR: 221290 > Submitted by: Josuah Demangeon (Original version) > > Modified: > head/usr.bin/vmstat/vmstat.c > > Modified: head/usr.bin/vmstat/vmstat.c > ============================================================================== > --- head/usr.bin/vmstat/vmstat.c Tue Aug 8 11:49:36 2017 (r322251) > +++ head/usr.bin/vmstat/vmstat.c Tue Aug 8 12:18:11 2017 (r322252) > @@ -832,6 +832,7 @@ dovmstat(unsigned int interval, int reps) > xo_emit(" "); > xo_emit("{:free-memory/%7d}", > vmstat_pgtok(total.t_free)); > + xo_emit(" "); > } > xo_emit("{:total-page-faults/%5lu} ", > (unsigned long)rate(sum.v_vm_faults - This seems to break the formatting. There was a negative amount of space available for expansion, and since the header was not expanded to match its alignment with the fields is more random than before. With -h, the width was 80 columns, giving ugly line wrap on 80-column terminals with auto-wrap. Now it is 81 columns, giving uglier line wrap on all 80- column terminals. The bugs were mostly in the first line of the header: - the second line of the header was correct for vmstat -h - for vmstat without -h, the second line of the header was apparently broken by a change like the one here, that added a space after the "r b w" fields without adding one in the "r b w" header - most of the fields in the first line of the header are misaligned with the second lone. Many have drifted 3 to the left of where the were in a sort of center-justified place. Some of these might have actually been intended to be left justified, but had an off by +1 error. Now these have an error of off by -2 relative to left justifications. Only the "memory" header in the first line is better than in old versions. It is now left justified. Left justifying all headers in the first line is probably best. I couldn't find a good way to delimit the right hand side of the extents of the headers in the first line. The second line of the headers already uses right justification consistently and this works well. Bruce