aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/arcstat/arcstat.in
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-12-08 17:02:16 +0000
committerBrian Behlendorf <[email protected]>2020-12-10 15:28:31 -0800
commit513c1962003b4cb76d49054c6542b12b7ec0ebe0 (patch)
tree01805da044dc8c2507a08f43a2d2dbd9e3e858e6 /cmd/arcstat/arcstat.in
parente5f732edbb0d3242708442e14e033935399cf1bb (diff)
FreeBSD: Update usage of py-sysctl
py-sysctl now includes the CTLTYPE_NODE type nodes in the list returned by sysctl.filter() on FreeBSD head. It also provides descriptions now. Eliminate the subprocess call to get descriptions, and filter out the nodes so we only deal with values. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #11318
Diffstat (limited to 'cmd/arcstat/arcstat.in')
-rwxr-xr-xcmd/arcstat/arcstat.in5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/arcstat/arcstat.in b/cmd/arcstat/arcstat.in
index 40ab975c6..9e7c52a6c 100755
--- a/cmd/arcstat/arcstat.in
+++ b/cmd/arcstat/arcstat.in
@@ -144,13 +144,14 @@ pretty_print = True
if sys.platform.startswith('freebsd'):
- # Requires py27-sysctl on FreeBSD
+ # Requires py-sysctl on FreeBSD
import sysctl
def kstat_update():
global kstat
- k = sysctl.filter('kstat.zfs.misc.arcstats')
+ k = [ctl for ctl in sysctl.filter('kstat.zfs.misc.arcstats')
+ if ctl.type != sysctl.CTLTYPE_NODE]
if not k:
sys.exit(1)