From owner-svn-src-head@freebsd.org Mon May 21 06:39:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42785EE4F0D; Mon, 21 May 2018 06:39:54 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D1E7F6F48F; Mon, 21 May 2018 06:39:53 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id C7AE3C21A; Mon, 21 May 2018 06:39:53 +0000 (UTC) Date: Mon, 21 May 2018 06:39:53 +0000 From: Alexey Dokuchaev To: Bruce Evans Cc: Eitan Adler , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r333945 - head/usr.bin/top Message-ID: <20180521063953.GA70671@FreeBSD.org> References: <201805202319.w4KNJ9hj038452@repo.freebsd.org> <20180521094344.Q1053@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180521094344.Q1053@besplex.bde.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 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: Mon, 21 May 2018 06:39:54 -0000 On Mon, May 21, 2018 at 10:32:30AM +1000, Bruce Evans wrote: > ... > > if (smpmode && namelength > SMPUNAMELEN) > > namelength = SMPUNAMELEN; > > else if (namelength > UPUNAMELEN) > > But 33 is too large. It is much larger than the hard-coded maximum limits, > so it is never used, but is reduced to SMPNAMELEN = 13 or UPUNAMELEN = 15. > > So getting the correct value of about 8 is even harder than before, but > changing SMPNAMELEN to 4 works quite well -- "USERNAME" in the header is > then reduced to "USER" and space is made available for something useful > like the command name. Big +1. I didn't go as far as 4, but have to patch top(1) locally to use namelength = 8 and header format so it neatly looks like this: PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 844 danfe 2 21 0 114M 38836K select 0 49:39 3.82% Xorg 5836 danfe 12 20 0 101M 23020K select 0 38:19 2.26% deadbeef instead of our ugly, default this: vvvv PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 41086 danfe 1 20 0 13280K 3112K CPU1 1 0:00 0.09% top 751 root 1 20 0 10812K 596K select 2 16:53 0.03% powerd ^^^^^^^^^^ The amount of wasted space (shown above) is unjustified IMO. ./danfe