Bug 237664 - [patch] systat -zarc to display cumulative rate and round down large numbers by SI units
Summary: [patch] systat -zarc to display cumulative rate and round down large numbers ...
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: patch
Depends on: 213310
Blocks:
  Show dependency treegraph
 
Reported: 2019-04-30 03:37 UTC by ota
Modified: 2020-06-07 16:44 UTC (History)
1 user (show)

See Also:


Attachments
systat -zarc improved (8.02 KB, patch)
2019-04-30 03:37 UTC, ota
no flags Details | Diff
systat -zarc improved 2 (8.59 KB, patch)
2019-05-01 07:02 UTC, ota
no flags Details | Diff
systat -zarc improved 3 (8.59 KB, patch)
2019-05-01 07:07 UTC, ota
no flags Details | Diff
systat -zarc improved 4 (9.56 KB, patch)
2019-05-01 22:22 UTC, ota
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ota 2019-04-30 03:37:24 UTC
Created attachment 204106 [details]
systat -zarc improved

Update to display cumulative rate and also make numebrs easier to read.

== OLD screen == 
                       Total     MFU     MRU    Anon     Hdr   L2Hdr   Other
     ZFS ARC            813M    555M    111M     81K   9821K      0K    137M

                                rate    hits  misses   total hits total misses
     arcstats                  : 89%    6714     761     36912905      3781817
     arcstats.demand_data      :  0%       0       0      6825292      1204922
     arcstats.demand_metadata  : 89%    6715     761     29924478      2508183
     arcstats.prefetch_data    :  0%       0       0            0            0
     arcstats.prefetch_metadata:  0%       0       0       163138        68712
     zfetchstats               :  0%       0       0            0            0
     arcstats.l2               :  0%       0       0            0            0
     vdev_cache_stats          :  0%       0       0            0            0






Disks  ada0   da0   cd0 pass0 pass1 pass2
KB/t   0.50  0.00  0.00  0.00  0.00  0.00
tps       0     0     0     0     0     0
MB/s   0.00  0.00  0.00  0.00  0.00  0.00
%busy     0     0     0     0     0     0

== NEW screen == 

                       Total     MFU     MRU    Anon     Hdr   L2Hdr   Other
     ZFS ARC            814M    556M    111M   32768   9823K       0    137M

                                Rate   Hits Misses | Total Rate   Hits Misses
     arcstats                  : 88%  41279   5260 |        90% 37209k  3809k
     arcstats.demand_data      :100%   4200      0 |        85%  6833k  1205k
     arcstats.demand_metadata  : 87%  36709   5260 |        92% 30213k  2535k
     arcstats.prefetch_data    :  0%      0      0 |         0%      0      0
     arcstats.prefetch_metadata:100%    370      0 |        70%   164k  68919
     zfetchstats               :  0%      0      0 |         0%      0      0
     arcstats.l2               :  0%      0      0 |         0%      0      0
     vdev_cache_stats          :  0%      0      0 |         0%      0      0






Disks  ada0   da0   cd0 pass0 pass1 pass2
KB/t   0.00  0.00  0.00  0.00  0.00  0.00
tps       0     0     0     0     0     0
MB/s   0.00  0.00  0.00  0.00  0.00  0.00
%busy     0     0     0     0     0     0
Comment 1 ota 2019-05-01 07:02:38 UTC
Created attachment 204133 [details]
systat -zarc improved 2

Fixed style.
Comment 2 ota 2019-05-01 07:07:37 UTC
Created attachment 204134 [details]
systat -zarc improved 3

Fixed another style.
Comment 3 ota 2019-05-01 22:22:18 UTC
Created attachment 204155 [details]
systat -zarc improved 4

Avoid wnd as function argument name as it is also a global variable name.
Few more style fixes.
Comment 4 commit-hook freebsd_committer 2020-05-11 20:35:33 UTC
A commit references this bug:

Author: mr
Date: Mon May 11 20:34:53 UTC 2020
New revision: 360919
URL: https://svnweb.freebsd.org/changeset/base/360919

Log:
  Patch systat -zarc to display cumulative rate and round down large numbers by SI units

  PR:		237664
  Submitted by:	ota@j.email.ne.jp
  MFC after:	2 weeks

Changes:
  head/usr.bin/systat/Makefile
  head/usr.bin/systat/extern.h
  head/usr.bin/systat/main.c
  head/usr.bin/systat/zarc.c
Comment 5 Michael Reifenberger freebsd_committer 2020-05-11 20:37:08 UTC
Hi,
committed to -current.

Thanks for providing!

greetings
---
mike
Comment 6 commit-hook freebsd_committer 2020-05-11 21:22:40 UTC
A commit references this bug:

Author: mr
Date: Mon May 11 21:22:16 UTC 2020
New revision: 360929
URL: https://svnweb.freebsd.org/changeset/base/360929

Log:
  Add missing sysput.c

  PR:		237664
  Submitted by:	ota@j.email.ne.jp
  Reported by:	imb, cy

Changes:
  head/usr.bin/systat/sysput.c
Comment 7 ota 2020-05-13 01:43:04 UTC
(In reply to Michael Reifenberger from comment #5)

Thank you for taking patches.

I have few more small fixes and improvements locally.
I will be nice if you can assist in the future, too.
Comment 8 ota 2020-05-14 02:40:00 UTC
(In reply to ota from comment #7)

Next patch is not on zarc and decided to create a new one.
It is https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246458
Comment 9 Michael Reifenberger freebsd_committer 2020-05-15 17:25:51 UTC
(In reply to ota from comment #7)
Hi,
yes of corse.
Please feel free to submit what you have.

Greetings
---
Mike
Comment 10 ota 2020-06-07 02:27:43 UTC
(In reply to Michael Reifenberger from comment #9)

Hi Michael.

I'm wondering if you could merge the series of systat changes to 12-STABLE.
Comment 11 commit-hook freebsd_committer 2020-06-07 16:42:29 UTC
A commit references this bug:

Author: mr
Date: Sun Jun  7 16:42:05 UTC 2020
New revision: 361896
URL: https://svnweb.freebsd.org/changeset/base/361896

Log:
  MFC r360919,r360929,r361084:

  Patch systat -zarc to display cumulative rate and round down large numbers by SI units

  Introduce sysputpage() to display large page size with human readable format.
    Using UI units allows to fit larger numbers in columns.
    Stop calling v_page_size - this is a value that doesn't change at runtime.
    Renamed WINDOW *wnd to *wd to avoid conflict with global *wnd variable.
    Use bit-shift to convert page size to byte.

  PR:		237664, 246458
  Submitted by:	ota@j.email.ne.jp

Changes:
_U  stable/12/
  stable/12/usr.bin/systat/Makefile
  stable/12/usr.bin/systat/extern.h
  stable/12/usr.bin/systat/fetch.c
  stable/12/usr.bin/systat/main.c
  stable/12/usr.bin/systat/sysput.c
  stable/12/usr.bin/systat/vmstat.c
  stable/12/usr.bin/systat/zarc.c
Comment 12 Michael Reifenberger freebsd_committer 2020-06-07 16:44:48 UTC
Hi,
it's MFC'd now.

I havn't checked if the change is apropriate for FreeBSD-11 too.

Thanks for your work!