Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into upstream-20140124
Browse files Browse the repository at this point in the history
Raw merge, no compile checks yet.

Conflicts:
	cmd/Makefile.am
	cmd/mount_zfs/Makefile.am
	cmd/mount_zfs/mount_zfs.c
	cmd/zdb/Makefile.am
	cmd/zfs/Makefile.am
	cmd/zfs/zfs_main.c
	cmd/zhack/Makefile.am
	cmd/zinject/Makefile.am
	cmd/zpool/Makefile.am
	cmd/zpool/zpool_vdev.c
	cmd/zstreamdump/Makefile.am
	cmd/ztest/Makefile.am
	cmd/ztest/ztest.c
	config/Rules.am
	config/kernel.m4
	include/sys/arc.h
	include/sys/dsl_pool.h
	include/sys/fs/zfs.h
	include/sys/zfs_context.h
	include/sys/zfs_ioctl.h
	include/sys/zfs_vfsops.h
	include/sys/zfs_znode.h
	include/sys/zio.h
	include/sys/zpl.h
	lib/libefi/Makefile.am
	lib/libefi/rdwr_efi.c
	lib/libshare/libshare.c
	lib/libshare/smb.c
	lib/libspl/Makefile.am
	lib/libspl/getexecname.c
	lib/libspl/gethrtime.c
	lib/libspl/getmntany.c
	lib/libspl/include/sys/file.h
	lib/libspl/include/sys/kstat.h
	lib/libspl/include/sys/mnttab.h
	lib/libspl/include/sys/param.h
	lib/libspl/include/sys/stat.h
	lib/libspl/include/sys/sysmacros.h
	lib/libzfs/libzfs_dataset.c
	lib/libzfs/libzfs_pool.c
	lib/libzfs/libzfs_sendrecv.c
	lib/libzfs/libzfs_util.c
	lib/libzpool/Makefile.am
	man/man8/zpool.8
	module/nvpair/nvpair.c
	module/zfs/Makefile.in
	module/zfs/arc.c
	module/zfs/dbuf.c
	module/zfs/dmu.c
	module/zfs/dsl_deleg.c
	module/zfs/dsl_dir.c
	module/zfs/dsl_pool.c
	module/zfs/spa_history.c
	module/zfs/spa_misc.c
	module/zfs/txg.c
	module/zfs/vdev.c
	module/zfs/vdev_disk.c
	module/zfs/vdev_file.c
	module/zfs/vdev_label.c
	module/zfs/vdev_missing.c
	module/zfs/vdev_queue.c
	module/zfs/zfs_acl.c
	module/zfs/zfs_ctldir.c
	module/zfs/zfs_dir.c
	module/zfs/zfs_ioctl.c
	module/zfs/zfs_log.c
	module/zfs/zfs_onexit.c
	module/zfs/zfs_replay.c
	module/zfs/zfs_sa.c
	module/zfs/zfs_vfsops.c
	module/zfs/zfs_vnops.c
	module/zfs/zfs_znode.c
	module/zfs/zio.c
	module/zfs/zio_checksum.c
	module/zfs/zpl_ctldir.c
	module/zfs/zpl_super.c
	module/zfs/zvol.c
  • Loading branch information
lundman committed Jan 24, 2014
2 parents 35f1f44 + 01b738f commit fdbc078
Show file tree
Hide file tree
Showing 286 changed files with 14,535 additions and 5,697 deletions.
4 changes: 4 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ install-data-local:
endif


checkstyle:
@find ${top_srcdir} -name '*.[hc]' ! -name 'zfs_config.*' \
! -name '*.mod.c' -type f -exec scripts/cstyle.pl {} \+

ctags:
$(RM) $(top_srcdir)/tags
find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags
Expand Down
45 changes: 22 additions & 23 deletions cmd/arcstat/arcstat.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,18 @@

v = {}
hdr = ["time", "read", "miss", "miss%", "dmis", "dm%", "pmis", "pm%", "mmis",
"mm%", "arcsz", "c"]
"mm%", "arcsz", "c"]
xhdr = ["time", "mfu", "mru", "mfug", "mrug", "eskip", "mtxmis", "rmis",
"dread", "pread", "read"]
"dread", "pread", "read"]
sint = 1 # Default interval is 1 second
count = 1 # Default count is 1
hdr_intr = 20 # Print header every 20 lines of output
opfile = None
sep = " " # Default separator is 2 spaces
version = "0.4"
l2exist = False
cmd = ("Usage: arcstat [-hvx] [-f fields] [-o file] [-s string] [interval "
"[count]]\n")
cmd = ("Usage: arcstat.py [-hvx] [-f fields] [-o file] [-s string] [interval "
"[count]]\n")
cur = {}
d = {}
out = None
Expand All @@ -129,17 +129,17 @@ def usage():
sys.stderr.write("%s\n" % cmd)
sys.stderr.write("\t -h : Print this help message\n")
sys.stderr.write("\t -v : List all possible field headers and definitions"
"\n")
"\n")
sys.stderr.write("\t -x : Print extended stats\n")
sys.stderr.write("\t -f : Specify specific fields to print (see -v)\n")
sys.stderr.write("\t -o : Redirect output to the specified file\n")
sys.stderr.write("\t -s : Override default field separator with custom "
"character or string\n")
"character or string\n")
sys.stderr.write("\nExamples:\n")
sys.stderr.write("\tarcstat -o /tmp/a.log 2 10\n")
sys.stderr.write("\tarcstat -s \",\" -o /tmp/a.log 2 10\n")
sys.stderr.write("\tarcstat -v\n")
sys.stderr.write("\tarcstat -f time,hit%,dh%,ph%,mh% 1\n")
sys.stderr.write("\tarcstat.py -o /tmp/a.log 2 10\n")
sys.stderr.write("\tarcstat.py -s \",\" -o /tmp/a.log 2 10\n")
sys.stderr.write("\tarcstat.py -v\n")
sys.stderr.write("\tarcstat.py -f time,hit%,dh%,ph%,mh% 1\n")
sys.stderr.write("\n")

sys.exit(1)
Expand Down Expand Up @@ -191,7 +191,7 @@ def prettynum(sz, scale, num=0):
return "%s" % num

# Rounding error, return 0
elif num > 0 and num < 1:
elif 0 < num < 1:
num = 0

while num > scale and index < 5:
Expand All @@ -217,7 +217,7 @@ def print_values():
sys.stdout.write("%s%s" % (
prettynum(cols[col][0], cols[col][1], v[col]),
sep
))
))
sys.stdout.write("\n")


Expand Down Expand Up @@ -259,10 +259,10 @@ def init():
"columns"
]
)

except getopt.error, msg:
except getopt.error as msg:
sys.stderr.write(msg)
usage()
opts = None

for opt, arg in opts:
if opt in ('-x', '--extended'):
Expand Down Expand Up @@ -326,17 +326,16 @@ def init():
usage()

if len(incompat) > 0:
sys.stderr.write("Incompatible field specified! -- %s\n" % (
incompat,
))
sys.stderr.write("Incompatible field specified! -- %s\n" %
incompat)
usage()

if opfile:
try:
out = open(opfile, "w")
sys.stdout = out

except:
except IOError:
sys.stderr.write("Cannot open %s for writing\n" % opfile)
sys.exit(1)

Expand All @@ -346,7 +345,7 @@ def calculate():
global v
global l2exist

v = {}
v = dict()
v["time"] = time.strftime("%H:%M:%S", time.localtime())
v["hits"] = d["hits"] / sint
v["miss"] = d["misses"] / sint
Expand All @@ -363,16 +362,16 @@ def calculate():

v["phit"] = (d["prefetch_data_hits"] + d["prefetch_metadata_hits"]) / sint
v["pmis"] = (d["prefetch_data_misses"] +
d["prefetch_metadata_misses"]) / sint
d["prefetch_metadata_misses"]) / sint

v["pread"] = v["phit"] + v["pmis"]
v["ph%"] = 100 * v["phit"] / v["pread"] if v["pread"] > 0 else 0
v["pm%"] = 100 - v["ph%"] if v["pread"] > 0 else 0

v["mhit"] = (d["prefetch_metadata_hits"] +
d["demand_metadata_hits"]) / sint
d["demand_metadata_hits"]) / sint
v["mmis"] = (d["prefetch_metadata_misses"] +
d["demand_metadata_misses"]) / sint
d["demand_metadata_misses"]) / sint

v["mread"] = v["mhit"] + v["mmis"]
v["mh%"] = 100 * v["mhit"] / v["mread"] if v["mread"] > 0 else 0
Expand All @@ -399,7 +398,7 @@ def calculate():
v["l2bytes"] = d["l2_read_bytes"] / sint


def sighandler(*args):
def sighandler():
sys.exit(0)


Expand Down
2 changes: 2 additions & 0 deletions cmd/dbufstat/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin_SCRIPTS = dbufstat.py
EXTRA_DIST = $(bin_SCRIPTS)
Loading

0 comments on commit fdbc078

Please sign in to comment.