From owner-svn-src-head@freebsd.org Wed Jul 25 14:05:19 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 DF281104BE5A; Wed, 25 Jul 2018 14:05:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E9937F9E6; Wed, 25 Jul 2018 14:05:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5D6DA1B2D4; Wed, 25 Jul 2018 14:05:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6PE5I7J001398; Wed, 25 Jul 2018 14:05:18 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6PE5Inf001397; Wed, 25 Jul 2018 14:05:18 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201807251405.w6PE5Inf001397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Wed, 25 Jul 2018 14:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336707 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 336707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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: Wed, 25 Jul 2018 14:05:19 -0000 Author: eadler Date: Wed Jul 25 14:05:17 2018 New Revision: 336707 URL: https://svnweb.freebsd.org/changeset/base/336707 Log: top(1): increase number of columns for memory The original intention was 4 columns but with a usable a result. In practice this was not the case. Increase the number of columns to 5 until humanize_number learns alternative ways of presenting the number. Requested by: many Ref D15801 Modified: head/usr.bin/top/machine.c head/usr.bin/top/utils.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Wed Jul 25 13:27:20 2018 (r336706) +++ head/usr.bin/top/machine.c Wed Jul 25 14:05:17 2018 (r336707) @@ -388,7 +388,7 @@ format_header(const char *uname_field) sbuf_printf(header, "%*s", ps.jail ? TOP_JID_LEN : 0, ps.jail ? " JID" : ""); sbuf_printf(header, " %-*.*s ", namelength, namelength, uname_field); - sbuf_cat(header, "THR PRI NICE SIZE RES "); + sbuf_cat(header, "THR PRI NICE SIZE RES "); if (ps.swap) { sbuf_printf(header, "%*s ", TOP_SWAP_LEN - 1, "SWAP"); } @@ -1064,8 +1064,8 @@ format_next_process(struct handle * xhandle, char *(*g sbuf_printf(procbuf, "%3d ", pp->ki_pri.pri_level - PZERO); sbuf_printf(procbuf, "%4s", format_nice(pp)); - sbuf_printf(procbuf, "%6s ", format_k(PROCSIZE(pp))); - sbuf_printf(procbuf, "%5s ", format_k(pagetok(pp->ki_rssize))); + sbuf_printf(procbuf, "%7s ", format_k(PROCSIZE(pp))); + sbuf_printf(procbuf, "%6s ", format_k(pagetok(pp->ki_rssize))); if (ps.swap) { sbuf_printf(procbuf, "%*s ", TOP_SWAP_LEN - 1, Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Wed Jul 25 13:27:20 2018 (r336706) +++ head/usr.bin/top/utils.c Wed Jul 25 14:05:17 2018 (r336707) @@ -297,7 +297,7 @@ format_k(int64_t amt) ret = retarray[index]; index = (index + 1) % NUM_STRINGS; - humanize_number(ret, 5, amt * 1024, "", HN_AUTOSCALE, HN_NOSPACE); + humanize_number(ret, 6, amt * 1024, "", HN_AUTOSCALE, HN_NOSPACE); return (ret); }