From b3b37b84e8336b47c4cbbeae2d4f21ba5c266144 Mon Sep 17 00:00:00 2001 From: Ameer Hamza Date: Tue, 30 Apr 2024 01:28:50 +0500 Subject: [PATCH] Fix arcstats for FreeBSD after zfetch support Reviewed-by: Brian Behlendorf Reviewed-by: Alexander Motin Signed-off-by: Ameer Hamza Closes #16141 --- cmd/arcstat.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/arcstat.in b/cmd/arcstat.in index 220f343b5b..c4f10a1d6d 100755 --- a/cmd/arcstat.in +++ b/cmd/arcstat.in @@ -200,6 +200,8 @@ if sys.platform.startswith('freebsd'): k = [ctl for ctl in sysctl.filter('kstat.zfs.misc.arcstats') if ctl.type != sysctl.CTLTYPE_NODE] + k += [ctl for ctl in sysctl.filter('kstat.zfs.misc.zfetchstats') + if ctl.type != sysctl.CTLTYPE_NODE] if not k: sys.exit(1) @@ -211,8 +213,12 @@ if sys.platform.startswith('freebsd'): continue name, value = s.name, s.value - # Trims 'kstat.zfs.misc.arcstats' from the name - kstat[name[24:]] = int(value) + + if "arcstats" in name: + # Trims 'kstat.zfs.misc.arcstats' from the name + kstat[name[24:]] = int(value) + else: + kstat["zfetch_" + name[27:]] = int(value) elif sys.platform.startswith('linux'): def kstat_update():