diff options
author | Ross Williams <ross@ross-williams.net> | 2019-09-03 18:26:02 +0000 |
---|---|---|
committer | Ross Williams <ross@ross-williams.net> | 2019-09-03 18:44:19 +0000 |
commit | 613556faebd16325da8c9057c81f39a2410d803f (patch) | |
tree | 306b082cf7a0e28878dec4f2097eed842963674b /solaris | |
parent | e450b586368750e771746ef3e2f5a070962dfd28 (diff) |
Support for ZFS Compressed ARC statistics
Diffstat (limited to 'solaris')
-rw-r--r-- | solaris/Platform.c | 8 | ||||
-rw-r--r-- | solaris/Platform.h | 2 | ||||
-rw-r--r-- | solaris/SolarisProcessList.c | 10 |
3 files changed, 20 insertions, 0 deletions
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; diff --git a/solaris/Platform.h b/solaris/Platform.h index 62757ff7..3b5aef86 100644 --- a/solaris/Platform.h +++ b/solaris/Platform.h @@ -62,6 +62,8 @@ void Platform_setSwapValues(Meter* this); void Platform_setZfsArcValues(Meter* this); +void Platform_setZfsCompressedArcValues(Meter* this); + char* Platform_getProcessEnv(pid_t pid); #endif diff --git a/solaris/SolarisProcessList.c b/solaris/SolarisProcessList.c index b6bc6f5d..d62ea1d4 100644 --- a/solaris/SolarisProcessList.c +++ b/solaris/SolarisProcessList.c @@ -263,6 +263,16 @@ static inline void SolarisProcessList_scanZfsArcstats(ProcessList* pl) { cur_kstat = kstat_data_lookup( arcstats, "other_size" ); spl->zfs.other = cur_kstat->value.ui64 / 1024; + + if ((cur_kstat = kstat_data_lookup( arcstats, "compressed_size" )) != NULL) { + spl->zfs.compressed = cur_kstat->value.ui64 / 1024; + spl->zfs.isCompressed = 1; + + cur_kstat = kstat_data_lookup( arcstats, "uncompressed_size" ); + spl->zfs.uncompressed = cur_kstat->value.ui64 / 1024; + } else { + spl->zfs.isCompressed = 0; + } } } |