freebsd-dev/module/zfs
Tony Hutter 193a37cb24 Add -lhHpw options to "zpool iostat" for avg latency, histograms, & queues
Update the zfs module to collect statistics on average latencies, queue sizes,
and keep an internal histogram of all IO latencies.  Along with this, update
"zpool iostat" with some new options to print out the stats:

-l: Include average IO latencies stats:

 total_wait     disk_wait    syncq_wait    asyncq_wait  scrub
 read  write   read  write   read  write   read  write   wait
-----  -----  -----  -----  -----  -----  -----  -----  -----
    -   41ms      -    2ms      -   46ms      -    4ms      -
    -    5ms      -    1ms      -    1us      -    4ms      -
    -    5ms      -    1ms      -    1us      -    4ms      -
    -      -      -      -      -      -      -      -      -
    -   49ms      -    2ms      -   47ms      -      -      -
    -      -      -      -      -      -      -      -      -
    -    2ms      -    1ms      -      -      -    1ms      -
-----  -----  -----  -----  -----  -----  -----  -----  -----
  1ms    1ms    1ms  413us   16us   25us      -    5ms      -
  1ms    1ms    1ms  413us   16us   25us      -    5ms      -
  2ms    1ms    2ms  412us   26us   25us      -    5ms      -
    -    1ms      -  413us      -   25us      -    5ms      -
    -    1ms      -  460us      -   29us      -    5ms      -
196us    1ms  196us  370us    7us   23us      -    5ms      -
-----  -----  -----  -----  -----  -----  -----  -----  -----

-w: Print out latency histograms:

sdb           total           disk         sync_queue      async_queue
latency    read   write    read   write    read   write    read   write   scrub
-------  ------  ------  ------  ------  ------  ------  ------  ------  ------
1ns           0       0       0       0       0       0       0       0       0
...
33us          0       0       0       0       0       0       0       0       0
66us          0       0     107    2486       2     788      12      12       0
131us         2     797     359    4499      10     558     184     184       6
262us        22     801     264    1563      10     286     287     287      24
524us        87     575      71   52086      15    1063     136     136      92
1ms         152    1190       5   41292       4    1693     252     252     141
2ms         245    2018       0   50007       0    2322     371     371     220
4ms         189    7455      22  162957       0    3912    6726    6726     199
8ms         108    9461       0  102320       0    5775    2526    2526      86
17ms         23   11287       0   37142       0    8043    1813    1813      19
34ms          0   14725       0   24015       0   11732    3071    3071       0
67ms          0   23597       0    7914       0   18113    5025    5025       0
134ms         0   33798       0     254       0   25755    7326    7326       0
268ms         0   51780       0      12       0   41593   10002   10002       0
537ms         0   77808       0       0       0   64255   13120   13120       0
1s            0  105281       0       0       0   83805   20841   20841       0
2s            0   88248       0       0       0   73772   14006   14006       0
4s            0   47266       0       0       0   29783   17176   17176       0
9s            0   10460       0       0       0    4130    6295    6295       0
17s           0       0       0       0       0       0       0       0       0
34s           0       0       0       0       0       0       0       0       0
69s           0       0       0       0       0       0       0       0       0
137s          0       0       0       0       0       0       0       0       0
-------------------------------------------------------------------------------

-h: Help

-H: Scripted mode. Do not display headers, and separate fields by a single
    tab instead of arbitrary space.

-q: Include current number of entries in sync & async read/write queues,
    and scrub queue:

 syncq_read    syncq_write   asyncq_read  asyncq_write   scrubq_read
 pend  activ   pend  activ   pend  activ   pend  activ   pend  activ
-----  -----  -----  -----  -----  -----  -----  -----  -----  -----
    0      0      0      0     78     29      0      0      0      0
    0      0      0      0     78     29      0      0      0      0
    0      0      0      0      0      0      0      0      0      0
    -      -      -      -      -      -      -      -      -      -
    0      0      0      0      0      0      0      0      0      0
    -      -      -      -      -      -      -      -      -      -
    0      0      0      0      0      0      0      0      0      0
-----  -----  -----  -----  -----  -----  -----  -----  -----  -----
    0      0    227    394      0     19      0      0      0      0
    0      0    227    394      0     19      0      0      0      0
    0      0    108     98      0     19      0      0      0      0
    0      0     19     98      0      0      0      0      0      0
    0      0     78     98      0      0      0      0      0      0
    0      0     19     88      0      0      0      0      0      0
-----  -----  -----  -----  -----  -----  -----  -----  -----  -----

-p: Display numbers in parseable (exact) values.

Also, update iostat syntax to allow the user to specify specific vdevs
to show statistics for.  The three options for choosing pools/vdevs are:

Display a list of pools:
    zpool iostat ... [pool ...]

Display a list of vdevs from a specific pool:
    zpool iostat ... [pool vdev ...]

Display a list of vdevs from any pools:
    zpool iostat ... [vdev ...]

Lastly, allow zpool command "interval" value to be floating point:
    zpool iostat -v 0.5

Signed-off-by: Tony Hutter <hutter2@llnl.gov
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4433
2016-05-12 12:36:32 -07:00
..
arc.c OpenZFS 6672 - arc_reclaim_thread() should use gethrtime() 2016-05-06 09:35:52 -07:00
blkptr.c
bplist.c
bpobj.c
bptree.c Illumos 5960, 5925 2016-01-08 15:08:19 -08:00
bqueue.c Allow 16M send/recv blocks 2016-01-08 20:23:23 -05:00
dbuf_stats.c
dbuf.c Illumos 6844 - dnode_next_offset can detect fictional holes 2016-04-27 16:24:15 -07:00
ddt_zap.c
ddt.c
dmu_diff.c Illumos 5960, 5925 2016-01-08 15:08:19 -08:00
dmu_object.c Illumos 6370 - ZFS send fails to transmit some holes 2016-03-10 14:25:22 -08:00
dmu_objset.c Add support for asynchronous zvol minor operations 2016-03-10 09:49:22 -08:00
dmu_send.c Reduce stack usage of dmu_recv_stream function 2016-05-11 12:14:24 -07:00
dmu_traverse.c Illumos 6370 - ZFS send fails to transmit some holes 2016-03-10 14:25:22 -08:00
dmu_tx.c Illumos 4950 - files sometimes can't be removed from a full filesystem 2016-01-21 16:59:30 -08:00
dmu_zfetch.c Illumos 6281 - prefetching should apply to 1MB reads 2016-01-12 13:51:27 -08:00
dmu.c Illumos 4950 - files sometimes can't be removed from a full filesystem 2016-01-21 16:59:30 -08:00
dnode_sync.c Illumos 5960, 5925 2016-01-08 15:08:19 -08:00
dnode.c Illumos 5987 - zfs prefetch code needs work 2016-01-12 09:02:33 -08:00
dsl_bookmark.c
dsl_dataset.c Add support for asynchronous zvol minor operations 2016-03-10 09:49:22 -08:00
dsl_deadlist.c Handle damaged blk_birth in dsl_deadlist_insert() 2015-12-15 16:12:31 -08:00
dsl_deleg.c
dsl_destroy.c Add support for asynchronous zvol minor operations 2016-03-10 09:49:22 -08:00
dsl_dir.c Add support for asynchronous zvol minor operations 2016-03-10 09:49:22 -08:00
dsl_pool.c
dsl_prop.c Illumos 6681 - zfs list burning lots of time in dodefault() via dsl_prop_* 2016-03-15 18:46:44 -07:00
dsl_scan.c Illumos 6537 - Panic on zpool scrub with DEBUG kernel 2016-02-05 11:29:32 -08:00
dsl_synctask.c
dsl_userhold.c
fm.c Illumos 5045 - use atomic_{inc,dec}_* instead of atomic_add_* 2016-01-15 15:38:36 -08:00
gzip.c
lz4.c
lzjb.c
Makefile.in Add pn_alloc()/pn_free() functions 2016-04-21 09:49:25 -07:00
metaslab.c gcc build error: -Wbool-compare in metaslab.c 2016-03-30 09:36:51 -07:00
multilist.c Identify locks flagged by lockdep 2015-12-22 10:21:33 -08:00
pathname.c Add pn_alloc()/pn_free() functions 2016-04-21 09:49:25 -07:00
range_tree.c
refcount.c
rrwlock.c
sa.c Prevent SA length overflow 2015-12-30 13:20:12 -08:00
sha256.c
spa_boot.c
spa_config.c OpenZFS 6736 - ZFS per-vdev ZAPs 2016-05-02 14:27:45 -07:00
spa_errlog.c
spa_history.c
spa_misc.c Change KM_SLEEP to TQ_SLEEP in spa_deadman() 2016-03-09 10:41:31 -08:00
spa_stats.c
spa.c Add -lhHpw options to "zpool iostat" for avg latency, histograms, & queues 2016-05-12 12:36:32 -07:00
space_map.c Illumos 5960, 5925 2016-01-08 15:08:19 -08:00
space_reftree.c
trace.c
txg.c Increase default user space stack size 2016-01-13 13:55:12 -08:00
uberblock.c
unique.c
vdev_cache.c Illumos 5045 - use atomic_{inc,dec}_* instead of atomic_add_* 2016-01-15 15:38:36 -08:00
vdev_disk.c Add -lhHpw options to "zpool iostat" for avg latency, histograms, & queues 2016-05-12 12:36:32 -07:00
vdev_file.c
vdev_label.c Add -lhHpw options to "zpool iostat" for avg latency, histograms, & queues 2016-05-12 12:36:32 -07:00
vdev_mirror.c FreeBSD r256956: Improve ZFS N-way mirror read performance by using load and locality information. 2016-02-26 11:24:35 -08:00
vdev_missing.c
vdev_queue.c FreeBSD r256956: Improve ZFS N-way mirror read performance by using load and locality information. 2016-02-26 11:24:35 -08:00
vdev_raidz.c
vdev_root.c
vdev.c Add -lhHpw options to "zpool iostat" for avg latency, histograms, & queues 2016-05-12 12:36:32 -07:00
zap_leaf.c
zap_micro.c OpenZFS 6842 - Fix empty xattr dir causing lockup 2016-05-10 10:38:21 -07:00
zap.c OpenZFS 6842 - Fix empty xattr dir causing lockup 2016-05-10 10:38:21 -07:00
zfeature_common.c
zfeature.c
zfs_acl.c Fix atime handling and relatime 2016-04-05 18:54:55 -07:00
zfs_byteswap.c
zfs_ctldir.c Kill znode->z_gen field 2016-05-02 11:22:31 -07:00
zfs_debug.c
zfs_dir.c Fix atime handling and relatime 2016-04-05 18:54:55 -07:00
zfs_fm.c Remove wrong ASSERT in annotate_ecksum 2016-02-17 10:43:02 -08:00
zfs_fuid.c
zfs_ioctl.c OpenZFS 6286 - ZFS internal error when set large block on bootfs 2016-05-05 16:19:12 -07:00
zfs_log.c
zfs_onexit.c
zfs_replay.c Add pn_alloc()/pn_free() functions 2016-04-21 09:49:25 -07:00
zfs_rlock.c
zfs_sa.c Kill znode->z_gen field 2016-05-02 11:22:31 -07:00
zfs_vfsops.c Fix zsb->z_hold_mtx deadlock 2016-01-15 15:33:45 -08:00
zfs_vnops.c Kill znode->z_gen field 2016-05-02 11:22:31 -07:00
zfs_znode.c Kill znode->z_gen field 2016-05-02 11:22:31 -07:00
zil.c
zio_checksum.c
zio_compress.c
zio_inject.c Fix zpool_scrub_* test cases 2016-03-30 09:30:34 -07:00
zio.c Add -lhHpw options to "zpool iostat" for avg latency, histograms, & queues 2016-05-12 12:36:32 -07:00
zle.c
zpl_ctldir.c
zpl_export.c
zpl_file.c Fix atime handling and relatime 2016-04-05 18:54:55 -07:00
zpl_inode.c Add pn_alloc()/pn_free() functions 2016-04-21 09:49:25 -07:00
zpl_super.c
zpl_xattr.c Linux 4.5 compat: Use xattr_handler->name for acl 2016-04-25 08:42:08 -07:00
zrlock.c
zvol.c Fix lock order inversion with zvol_open() 2016-03-10 09:53:36 -08:00