From ff6914e4ad4b78749bcee5471a33ef206b0a7d03 Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Mon, 8 Jul 2019 02:43:39 +0000 Subject: ZFS arcstats for Solaris --- solaris/Platform.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'solaris/Platform.c') diff --git a/solaris/Platform.c b/solaris/Platform.c index a29fcb47..8084d1fd 100644 --- a/solaris/Platform.c +++ b/solaris/Platform.c @@ -17,6 +17,7 @@ in the source distribution for its full text. #include "ClockMeter.h" #include "HostnameMeter.h" #include "UptimeMeter.h" +#include "zfs/ZfsArcMeter.h" #include "SolarisProcess.h" #include "SolarisProcessList.h" @@ -122,6 +123,7 @@ MeterClass* Platform_meterTypes[] = { &RightCPUsMeter_class, &LeftCPUs2Meter_class, &RightCPUs2Meter_class, + &ZfsArcMeter_class, &BlankMeter_class, NULL }; @@ -220,6 +222,23 @@ void Platform_setSwapValues(Meter* this) { this->values[0] = pl->usedSwap; } +void Platform_setZfsArcValues(Meter* this) { + SolarisProcessList* spl = (SolarisProcessList*) this->pl; + + this->total = spl->zfs.max; + this->values[0] = spl->zfs.MFU; + this->values[1] = spl->zfs.MRU; + this->values[2] = spl->zfs.anon; + this->values[3] = spl->zfs.header; + this->values[4] = spl->zfs.other; + + // "Hide" the last value so it can + // only be accessed by index and is not + // displayed by the Bar or Graph style + Meter_setItems(this, 5); + this->values[5] = spl->zfs.size; +} + static int Platform_buildenv(void *accum, struct ps_prochandle *Phandle, uintptr_t addr, const char *str) { envAccum *accump = accum; (void) Phandle; -- cgit v1.2.3 From e450b586368750e771746ef3e2f5a070962dfd28 Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Tue, 3 Sep 2019 18:21:33 +0000 Subject: Refactor openzfs_sysctl_init() and ZfsArcMeter... openzfs_sysctl_init() now returns void instead of int. The ZfsArcStats->enabled flag is set inside the init function now, instead of having to be set from its return value. Preparation for more flag setting in Compressed ARC commit. ZfsArcMeter_readStats() added and all Meter->values[] setting moved to it, eliminating duplicated code in {darwin,freebsd,linux,solaris}/Platform.c. --- solaris/Platform.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'solaris/Platform.c') diff --git a/solaris/Platform.c b/solaris/Platform.c index 8084d1fd..74ae14ec 100644 --- a/solaris/Platform.c +++ b/solaris/Platform.c @@ -225,18 +225,7 @@ void Platform_setSwapValues(Meter* this) { void Platform_setZfsArcValues(Meter* this) { SolarisProcessList* spl = (SolarisProcessList*) this->pl; - this->total = spl->zfs.max; - this->values[0] = spl->zfs.MFU; - this->values[1] = spl->zfs.MRU; - this->values[2] = spl->zfs.anon; - this->values[3] = spl->zfs.header; - this->values[4] = spl->zfs.other; - - // "Hide" the last value so it can - // only be accessed by index and is not - // displayed by the Bar or Graph style - Meter_setItems(this, 5); - this->values[5] = spl->zfs.size; + ZfsArcMeter_readStats(this, &(spl->zfs)); } static int Platform_buildenv(void *accum, struct ps_prochandle *Phandle, uintptr_t addr, const char *str) { -- cgit v1.2.3 From 613556faebd16325da8c9057c81f39a2410d803f Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Tue, 3 Sep 2019 18:26:02 +0000 Subject: Support for ZFS Compressed ARC statistics --- solaris/Platform.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'solaris/Platform.c') diff --git a/solaris/Platform.c b/solaris/Platform.c index 74ae14ec..7dcfe323 100644 --- a/solaris/Platform.c +++ b/solaris/Platform.c @@ -18,6 +18,7 @@ in the source distribution for its full text. #include "HostnameMeter.h" #include "UptimeMeter.h" #include "zfs/ZfsArcMeter.h" +#include "zfs/ZfsCompressedArcMeter.h" #include "SolarisProcess.h" #include "SolarisProcessList.h" @@ -124,6 +125,7 @@ MeterClass* Platform_meterTypes[] = { &LeftCPUs2Meter_class, &RightCPUs2Meter_class, &ZfsArcMeter_class, + &ZfsCompressedArcMeter_class, &BlankMeter_class, NULL }; @@ -228,6 +230,12 @@ void Platform_setZfsArcValues(Meter* this) { ZfsArcMeter_readStats(this, &(spl->zfs)); } +void Platform_setZfsCompressedArcValues(Meter* this) { + SolarisProcessList* spl = (SolarisProcessList*) this->pl; + + ZfsCompressedArcMeter_readStats(this, &(spl->zfs)); +} + static int Platform_buildenv(void *accum, struct ps_prochandle *Phandle, uintptr_t addr, const char *str) { envAccum *accump = accum; (void) Phandle; -- cgit v1.2.3