From a93edde1a21e533472b5d443002032260b5bd066 Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Sat, 6 Jul 2019 04:27:49 +0000 Subject: Support ZFS ARC stats on FreeBSD New meter displays same ARC stats as FreeBSD top(1). Can be extended to other platforms that support ZFS. Pulling kstat.zfs.misc.arcstats.c_max as the meter total, so the meter has a meaningful value to work up to. The Text meter displays, first, the maximum ARC size (Meter.total), then second, the total ARC used, using the difference between Meter.maxItems and Meter.curItems to "hide" the used value from the Bar and Graph drawing functions by using an index in Meter.values[] that is beyond curItems - 1, but less than maxItems - 1. --- Makefile.am | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 7d19600f..ad23d19b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,6 +36,10 @@ TasksMeter.h UptimeMeter.h TraceScreen.h UsersTable.h Vector.h Process.h \ AffinityPanel.h HostnameMeter.h OpenFilesScreen.h Affinity.h IncSet.h Action.h \ EnvScreen.h InfoScreen.h XAlloc.h +zfs_platform_sources = zfs/ZfsArcMeter.c + +zfs_platform_headers = zfs/ZfsArcMeter.h + all_platform_headers = # Linux @@ -68,13 +72,15 @@ freebsd_platform_headers = \ freebsd/FreeBSDProcessList.h \ freebsd/FreeBSDProcess.h \ freebsd/FreeBSDCRT.h \ - freebsd/Battery.h + freebsd/Battery.h \ + $(zfs_platform_headers) all_platform_headers += $(freebsd_platform_headers) if HTOP_FREEBSD myhtopplatsources = freebsd/Platform.c freebsd/FreeBSDProcessList.c \ -freebsd/FreeBSDProcess.c freebsd/FreeBSDCRT.c freebsd/Battery.c +freebsd/FreeBSDProcess.c freebsd/FreeBSDCRT.c freebsd/Battery.c \ +$(zfs_platform_sources) myhtopplatheaders = $(freebsd_platform_headers) endif -- cgit v1.2.3