summaryrefslogtreecommitdiffstats
path: root/cmd/arc_summary
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/arc_summary')
-rw-r--r--cmd/arc_summary/Makefile.am14
-rwxr-xr-xcmd/arc_summary/arc_summary2 (renamed from cmd/arc_summary/arc_summary.py)14
-rwxr-xr-xcmd/arc_summary/arc_summary3 (renamed from cmd/arc_summary/arc_summary3.py)6
3 files changed, 24 insertions, 10 deletions
diff --git a/cmd/arc_summary/Makefile.am b/cmd/arc_summary/Makefile.am
index ac7b0d48d..a83edffad 100644
--- a/cmd/arc_summary/Makefile.am
+++ b/cmd/arc_summary/Makefile.am
@@ -1 +1,13 @@
-dist_bin_SCRIPTS = arc_summary.py arc_summary3.py
+EXTRA_DIST = arc_summary2 arc_summary3
+
+if USING_PYTHON_2
+dist_bin_SCRIPTS = arc_summary2
+install-exec-hook:
+ mv $(DESTDIR)$(bindir)/arc_summary2 $(DESTDIR)$(bindir)/arc_summary
+endif
+
+if USING_PYTHON_3
+dist_bin_SCRIPTS = arc_summary3
+install-exec-hook:
+ mv $(DESTDIR)$(bindir)/arc_summary3 $(DESTDIR)$(bindir)/arc_summary
+endif
diff --git a/cmd/arc_summary/arc_summary.py b/cmd/arc_summary/arc_summary2
index 642c94b69..ab4a3c574 100755
--- a/cmd/arc_summary/arc_summary.py
+++ b/cmd/arc_summary/arc_summary2
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
#
# $Id: arc_summary.pl,v 388:e27800740aa2 2011-07-08 02:53:29Z jhell $
#
@@ -35,6 +35,8 @@
# Note some of this code uses older code (eg getopt instead of argparse,
# subprocess.Popen() instead of subprocess.run()) because we need to support
# some very old versions of Python.
+#
+
"""Print statistics on the ZFS Adjustable Replacement Cache (ARC)
Provides basic information on the ARC, its efficiency, the L2ARC (if present),
@@ -1005,7 +1007,7 @@ def zfs_header():
def usage():
"""Print usage information"""
- sys.stdout.write("Usage: arc_summary.py [-h] [-a] [-d] [-p PAGE]\n\n")
+ sys.stdout.write("Usage: arc_summary [-h] [-a] [-d] [-p PAGE]\n\n")
sys.stdout.write("\t -h, --help : "
"Print this help message and exit\n")
sys.stdout.write("\t -a, --alternate : "
@@ -1018,10 +1020,10 @@ def usage():
"should be an integer between 1 and " +
str(len(unSub)) + "\n\n")
sys.stdout.write("Examples:\n")
- sys.stdout.write("\tarc_summary.py -a\n")
- sys.stdout.write("\tarc_summary.py -p 4\n")
- sys.stdout.write("\tarc_summary.py -ad\n")
- sys.stdout.write("\tarc_summary.py --page=2\n")
+ sys.stdout.write("\tarc_summary -a\n")
+ sys.stdout.write("\tarc_summary -p 4\n")
+ sys.stdout.write("\tarc_summary -ad\n")
+ sys.stdout.write("\tarc_summary --page=2\n")
def main():
diff --git a/cmd/arc_summary/arc_summary3.py b/cmd/arc_summary/arc_summary3
index e70f2a35e..e67cd90f7 100755
--- a/cmd/arc_summary/arc_summary3.py
+++ b/cmd/arc_summary/arc_summary3
@@ -346,7 +346,7 @@ def get_version(request):
error_msg = '(ERROR: "{0}" requested)'.format(request)
return error_msg
- # The original arc_summary.py called /sbin/modinfo/{spl,zfs} to get
+ # The original arc_summary called /sbin/modinfo/{spl,zfs} to get
# the version information. We switch to /sys/module/{spl,zfs}/version
# to make sure we get what is really loaded in the kernel
command = ["cat", "/sys/module/{0}/version".format(request)]
@@ -374,7 +374,7 @@ def print_header():
"""
# datetime is now recommended over time but we keep the exact formatting
- # from the older version of arc_summary.py in case there are scripts
+ # from the older version of arc_summary in case there are scripts
# that expect it in this way
daydate = time.strftime(DATE_FORMAT)
spc_date = LINE_LENGTH-len(daydate)
@@ -586,7 +586,7 @@ def section_archits(kstats_dict):
# For some reason, anon_hits can turn negative, which is weird. Until we
# have figured out why this happens, we just hide the problem, following
- # the behavior of the original arc_summary.py
+ # the behavior of the original arc_summary.
if anon_hits >= 0:
prt_i2('Anonymously used:',
f_perc(anon_hits, arc_stats['hits']), f_hits(anon_hits))