Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 May 2018 06:39:53 +0000
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        Eitan Adler <eadler@freebsd.org>, 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>
In-Reply-To: <20180521094344.Q1053@besplex.bde.org>
References:  <201805202319.w4KNJ9hj038452@repo.freebsd.org> <20180521094344.Q1053@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180521063953.GA70671>