Bug 251655

Summary: [patch] systat -swap to improve readability and fix display issues
Product: Base System Reporter: ota
Component: binAssignee: Michael Reifenberger <mr>
Status: Closed FIXED    
Severity: Affects Only Me CC: mr
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
systat swap improvments patch none

Description ota 2020-12-07 00:09:07 UTC
Created attachment 220333 [details]
systat swap improvments patch

Improve size readability.
Preserve more space for swap devise name.
Prevent line overflow with long devise name.
Don't draw a bar when swap is not used at all.
Simplify and optimize code.
Change the label to end at end of 100%.

= new version ==================================================================
                    /0   /1   /2   /3   /4   /5   /6   /7   /8   /9   /10
     Load Average

Device/Path       Size  Used |0%  /10  /20  /30  /40  |  60\  70\  80\  90\ 100|
ada0s1b          2048M 2045M XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
md0                40M     0
zvol/sys/tempora 1024M     0
Total            3112M 2045M XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX










Disks   md0  ada0  ada1  ada2   cd0 pass0 pass1 pass2 pass3
KB/t   0.00 10.67  0.00  0.00  0.00  0.00  0.00  0.00  0.00
tps       0     2     0     0     0     1     0     0     0
MB/s   0.00  0.02  0.00  0.00  0.00  0.00  0.00  0.00  0.00
================================================================================


= old version ==================================================================
                    /0   /1   /2   /3   /4   /5   /6   /7   /8   /9   /10
     Load Average

Disk                   1K-blocks    Used /0%  /10  /20  /30  /40  /50  /60  /70
ada0s1b                  2097024 2094488 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXX                40832       0 X
zvol/sys/temporary_swap  1048448       0 X
Total                    3186304 2094488 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX










Disks   md0  ada0  ada1  ada2   cd0 pass0 pass1 pass2 pass3
KB/t   0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
tps       0     0     0     0     0     0     0     0     0
MB/s   0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00  0.00
%busy     0     0     0     0     0     0     0     0     0
================================================================================
Comment 1 ota 2020-12-07 00:25:08 UTC
https://reviews.freebsd.org/D27496
Comment 2 commit-hook freebsd_committer freebsd_triage 2021-02-15 19:29:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8d06c3e7a40831ac139d83b85b282206229b426f

commit 8d06c3e7a40831ac139d83b85b282206229b426f
Author:     Michael Reifenberger <mr@FreeBSD.org>
AuthorDate: 2021-02-15 19:23:32 +0000
Commit:     Michael Reifenberger <mr@FreeBSD.org>
CommitDate: 2021-02-15 19:23:32 +0000

    Improve size readability.
    Preserve more space for swap devise names.
    Prevent line overflow with long devise name.
    Don't draw a bar when swap is not used at all.
    Simplify and optimize code.
    Change the label to end at end of 100%.
    PR:             251655
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D27496

 lib/libc/gen/getbsize.3 |   5 +--
 usr.bin/systat/extern.h |   1 +
 usr.bin/systat/swap.c   | 116 +++++++++++++-----------------------------------
 usr.bin/systat/sysput.c |  21 ++++++---
 4 files changed, 51 insertions(+), 92 deletions(-)
Comment 3 Michael Reifenberger freebsd_committer freebsd_triage 2021-02-15 19:33:08 UTC
Committed to main.

Thanks for providing the Patch!
Comment 4 commit-hook freebsd_committer freebsd_triage 2021-04-21 19:15:34 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=70a2e9a3d447f4dcabb96a5782d09ef94ffda9fb

commit 70a2e9a3d447f4dcabb96a5782d09ef94ffda9fb
Author:     Michael Reifenberger <mr@FreeBSD.org>
AuthorDate: 2021-02-15 19:23:32 +0000
Commit:     Michael Reifenberger <mr@FreeBSD.org>
CommitDate: 2021-04-21 19:11:36 +0000

    Improve size readability.
    Preserve more space for swap devise names.
    Prevent line overflow with long devise name.
    Don't draw a bar when swap is not used at all.
    Simplify and optimize code.
    Change the label to end at end of 100%.
    PR:             251655
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D27496

    (cherry picked from commit 8d06c3e7a40831ac139d83b85b282206229b426f)

 lib/libc/gen/getbsize.3 |   5 +--
 usr.bin/systat/extern.h |   1 +
 usr.bin/systat/swap.c   | 116 +++++++++++++-----------------------------------
 usr.bin/systat/sysput.c |  21 ++++++---
 4 files changed, 51 insertions(+), 92 deletions(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2021-04-21 19:19:36 UTC
A commit in branch stable/12 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=9d75c569b42b6f7b8459e5d39258485d519fe78f

commit 9d75c569b42b6f7b8459e5d39258485d519fe78f
Author:     Michael Reifenberger <mr@FreeBSD.org>
AuthorDate: 2021-02-15 19:23:32 +0000
Commit:     Michael Reifenberger <mr@FreeBSD.org>
CommitDate: 2021-04-21 19:17:05 +0000

    Improve size readability.
    Preserve more space for swap devise names.
    Prevent line overflow with long devise name.
    Don't draw a bar when swap is not used at all.
    Simplify and optimize code.
    Change the label to end at end of 100%.
    PR:             251655
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D27496

    (cherry picked from commit 8d06c3e7a40831ac139d83b85b282206229b426f)

 lib/libc/gen/getbsize.3 |   5 +--
 usr.bin/systat/extern.h |   1 +
 usr.bin/systat/swap.c   | 116 +++++++++++++-----------------------------------
 usr.bin/systat/sysput.c |  21 ++++++---
 4 files changed, 51 insertions(+), 92 deletions(-)
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2021-05-21 00:21:38 UTC
^Triage: assign to committer that resolved.