ZFS arcstats for Linux

If no pools are imported (ARC size == 0) or the
ZFS module is not in the kernel (/proc/spl/kstat/zfs/arcstats
does not exist), then the Meter reports "Unavailable".
This commit is contained in:
Ross Williams
2019-07-07 02:37:02 +00:00
parent a93edde1a2
commit 070fe90461
6 changed files with 130 additions and 23 deletions

View File

@ -67,6 +67,15 @@ typedef struct LinuxProcessList_ {
struct nl_sock *netlink_socket;
int netlink_family;
#endif
int zfsArcEnabled;
unsigned long long int memZfsArc;
unsigned long long int zfsArcMax;
unsigned long long int zfsArcMFU;
unsigned long long int zfsArcMRU;
unsigned long long int zfsArcAnon;
unsigned long long int zfsArcHeader;
unsigned long long int zfsArcOther;
} LinuxProcessList;
#ifndef PROCDIR
@ -81,6 +90,10 @@ typedef struct LinuxProcessList_ {
#define PROCMEMINFOFILE PROCDIR "/meminfo"
#endif
#ifndef PROCARCSTATSFILE
#define PROCARCSTATSFILE PROCDIR "/spl/kstat/zfs/arcstats"
#endif
#ifndef PROCTTYDRIVERSFILE
#define PROCTTYDRIVERSFILE PROCDIR "/tty/drivers"
#endif