Add FreeBSD code to arc_summary and arcstat

Adding the FreeBSD code allows arc_summary and arcstat
to be used on FreeBSD.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
Closes #9641
This commit is contained in:
Ryan Moeller
2019-11-30 18:43:23 -05:00
committed by Brian Behlendorf
parent c54687cd23
commit 101f9b1771
3 changed files with 77 additions and 6 deletions
+14 -1
View File
@@ -55,7 +55,20 @@ from subprocess import Popen, PIPE
from decimal import Decimal as D
if sys.platform.startswith('linux'):
if sys.platform.startswith('freebsd'):
# Requires py27-sysctl on FreeBSD
import sysctl
def load_kstats(namespace):
"""Collect information on a specific subsystem of the ARC"""
base = 'kstat.zfs.misc.%s.' % namespace
return [(kstat.name, D(kstat.value)) for kstat in sysctl.filter(base)]
def load_tunables():
return dict((ctl.name, ctl.value) for ctl in sysctl.filter('vfs.zfs'))
elif sys.platform.startswith('linux'):
def load_kstats(namespace):
"""Collect information on a specific subsystem of the ARC"""