From 070fe90461182743fabb029415fc1bc59be14f3f Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Sun, 7 Jul 2019 02:37:02 +0000 Subject: 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". --- linux/LinuxProcessList.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'linux/LinuxProcessList.h') diff --git a/linux/LinuxProcessList.h b/linux/LinuxProcessList.h index f30b487d..749231e1 100644 --- a/linux/LinuxProcessList.h +++ b/linux/LinuxProcessList.h @@ -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 -- cgit v1.2.3 From a88d2e313df7f5f2b781d5b14ffe0e7710018c10 Mon Sep 17 00:00:00 2001 From: Ross Williams Date: Sun, 7 Jul 2019 23:27:00 +0000 Subject: Refactor common OpenZFS sysctl access Darwin and FreeBSD export zfs kstats through the same APIs, so moving functions into a common file. --- linux/LinuxProcessList.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'linux/LinuxProcessList.h') diff --git a/linux/LinuxProcessList.h b/linux/LinuxProcessList.h index 749231e1..353fe603 100644 --- a/linux/LinuxProcessList.h +++ b/linux/LinuxProcessList.h @@ -19,6 +19,7 @@ in the source distribution for its full text. #include "ProcessList.h" +#include "zfs/ZfsArcStats.h" extern long long btime; @@ -68,14 +69,7 @@ typedef struct LinuxProcessList_ { 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; + ZfsArcStats zfs; } LinuxProcessList; #ifndef PROCDIR -- cgit v1.2.3