summaryrefslogtreecommitdiffstats
path: root/solaris
diff options
context:
space:
mode:
authorsenjan <senjan@atlas.cz>2020-09-18 21:13:51 +0200
committercgzones <cgzones@googlemail.com>2020-09-21 13:54:45 +0200
commit543286256ef35eb2a41531bc894c7ded53ae9de4 (patch)
treee537ef8173d3802e508eccb2bdd7945cc4257592 /solaris
parent5ea13e7ea9ca19130d5114a745d337b052cf2199 (diff)
htop crashes on Solaris 11.4 due to missing ZFS ARC kstats
Diffstat (limited to 'solaris')
-rw-r--r--solaris/SolarisProcessList.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/solaris/SolarisProcessList.c b/solaris/SolarisProcessList.c
index 4e4d2828..45b7d902 100644
--- a/solaris/SolarisProcessList.c
+++ b/solaris/SolarisProcessList.c
@@ -202,8 +202,8 @@ static inline void SolarisProcessList_scanZfsArcstats(ProcessList* pl) {
int ksrphyserr = -1;
kstat_named_t *cur_kstat = NULL;
- if (spl->kd != NULL) { arcstats = kstat_lookup(spl->kd,"zfs",0,"arcstats"); }
- if (arcstats != NULL) { ksrphyserr = kstat_read(spl->kd,arcstats,NULL); }
+ if (spl->kd != NULL) { arcstats = kstat_lookup(spl->kd, "zfs", 0, "arcstats"); }
+ if (arcstats != NULL) { ksrphyserr = kstat_read(spl->kd, arcstats, NULL); }
if (ksrphyserr != -1) {
cur_kstat = kstat_data_lookup( arcstats, "size" );
spl->zfs.size = cur_kstat->value.ui64 / 1024;
@@ -213,19 +213,19 @@ static inline void SolarisProcessList_scanZfsArcstats(ProcessList* pl) {
spl->zfs.max = cur_kstat->value.ui64 / 1024;
cur_kstat = kstat_data_lookup( arcstats, "mfu_size" );
- spl->zfs.MFU = cur_kstat->value.ui64 / 1024;
+ spl->zfs.MFU = cur_kstat != NULL ? cur_kstat->value.ui64 / 1024 : 0;
cur_kstat = kstat_data_lookup( arcstats, "mru_size" );
- spl->zfs.MRU = cur_kstat->value.ui64 / 1024;
+ spl->zfs.MRU = cur_kstat != NULL ? cur_kstat->value.ui64 / 1024 : 0;
cur_kstat = kstat_data_lookup( arcstats, "anon_size" );
- spl->zfs.anon = cur_kstat->value.ui64 / 1024;
+ spl->zfs.anon = cur_kstat != NULL ? cur_kstat->value.ui64 / 1024 : 0;
cur_kstat = kstat_data_lookup( arcstats, "hdr_size" );
- spl->zfs.header = cur_kstat->value.ui64 / 1024;
+ spl->zfs.header = cur_kstat != NULL ? cur_kstat->value.ui64 / 1024 : 0;
cur_kstat = kstat_data_lookup( arcstats, "other_size" );
- spl->zfs.other = cur_kstat->value.ui64 / 1024;
+ spl->zfs.other = cur_kstat != NULL ? cur_kstat->value.ui64 / 1024 : 0;
if ((cur_kstat = kstat_data_lookup( arcstats, "compressed_size" )) != NULL) {
spl->zfs.compressed = cur_kstat->value.ui64 / 1024;

© 2014-2024 Faster IT GmbH | imprint | privacy policy