--- old/usr/src/cmd/mdb/common/modules/zfs/zfs.c	Mon Aug  5 17:15:11 2019
+++ new/usr/src/cmd/mdb/common/modules/zfs/zfs.c	Mon Aug  5 17:15:11 2019
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2019 Nexenta Systems, Inc.
  * Copyright (c) 2011, 2016 by Delphix. All rights reserved.
  * Copyright (c) 2017, Joyent, Inc.  All rights reserved.
  */
@@ -344,63 +344,241 @@
 	 * egrep "^[a-z0-9_]+ [a-z0-9_]+( =.*)?;" *.c | cut -d ' ' -f 2
 	 */
 	static const char *params[] = {
-		"arc_reduce_dnlc_percent",
 		"arc_lotsfree_percent",
-		"zfs_dirty_data_max",
-		"zfs_dirty_data_sync",
-		"zfs_delay_max_ns",
-		"zfs_delay_min_dirty_percent",
-		"zfs_delay_scale",
-		"zfs_vdev_max_active",
-		"zfs_vdev_sync_read_min_active",
-		"zfs_vdev_sync_read_max_active",
-		"zfs_vdev_sync_write_min_active",
-		"zfs_vdev_sync_write_max_active",
-		"zfs_vdev_async_read_min_active",
-		"zfs_vdev_async_read_max_active",
-		"zfs_vdev_async_write_min_active",
-		"zfs_vdev_async_write_max_active",
-		"zfs_vdev_scrub_min_active",
-		"zfs_vdev_scrub_max_active",
-		"zfs_vdev_async_write_active_min_dirty_percent",
-		"zfs_vdev_async_write_active_max_dirty_percent",
+		"arc_pages_pp_reserve",
+		"arc_reduce_dnlc_percent",
+		"arc_swapfs_reserve",
+		"arc_zio_arena_free_shift",
+		"dbuf_cache_hiwater_pct",
+		"dbuf_cache_lowater_pct",
+		"dbuf_cache_max_bytes",
+		"dbuf_cache_shift",
+		"dbuf_metadata_cache_max_bytes",
+		"dbuf_metadata_cache_overflow",
+		"dbuf_metadata_cache_shift",
+		"ddt_zap_indirect_blockshift",
+		"ddt_zap_leaf_blockshift",
+		"ditto_same_vdev_distance_shift",
+		"dmu_find_threads",
+		"dmu_rescan_dnode_threshold",
+		"dsl_scan_delay_completion",
+		"fzap_default_block_shift",
+		"krrp_debug",
+		"l2arc_feed_again",
+		"l2arc_feed_min_ms",
+		"l2arc_feed_secs",
+		"l2arc_headroom",
+		"l2arc_headroom_boost",
+		"l2arc_noprefetch",
+		"l2arc_norw",
+		"l2arc_rebuild_enabled",
+		"l2arc_write_boost",
+		"l2arc_write_max",
+		"last_free_memory",
+		"last_free_reason",
+		"metaslab_aliquot",
+		"metaslab_alloc_dva_algorithm",
+		"metaslab_bias_enabled",
+		"metaslab_debug_load",
+		"metaslab_debug_unload",
+		"metaslab_df_alloc_threshold",
+		"metaslab_df_free_pct",
+		"metaslab_fragmentation_factor_enabled",
+		"metaslab_gang_bang",
+		"metaslab_lba_weighting_enabled",
+		"metaslab_load_pct",
+		"metaslab_min_alloc_size",
+		"metaslab_ndf_clump_shift",
+		"metaslab_preload_enabled",
+		"metaslab_preload_limit",
+		"metaslab_trace_enabled",
+		"metaslab_trace_max_entries",
+		"metaslab_unload_delay",
+		"metaslabs_per_vdev",
+		"nms_worm_transition_time",
+		"rrw_tsd_key",
+		"send_holes_without_birth_time",
 		"spa_asize_inflation",
+		"spa_avg_stat_update_ticks",
+		"spa_load_verify_data",
+		"spa_load_verify_maxinflight",
+		"spa_load_verify_metadata",
+		"spa_max_replication_override",
+		"spa_min_latency_delta",
+		"spa_min_slop",
+		"spa_mode_global",
+		"spa_namespace_lock",
+		"spa_obj_mtx_sz",
+		"spa_rotor_load_adjusting",
+		"spa_rotor_use_weight",
+		"spa_slop_shift",
+		"spa_special_factor",
+		"spa_special_to_normal_delta",
+		"spa_special_to_normal_ratio",
+		"spa_static_routing_percentage",
+		"space_map_blksz",
+		"vdev_mirror_shift",
+		"vdev_raidz_default_to_general",
+		"wbc_arc_enabled",
+		"wbc_force_trigger",
+		"wbc_idle_delay_ms",
+		"wbc_max_move_tasks_count",
+		"wbc_min_move_tasks_count",
+		"wbc_mv_cancel_threshold_cap",
+		"wbc_mv_cancel_threshold_initial",
+		"wbc_mv_cancel_threshold_step",
+		"wbc_spa_util_high_wm",
+		"wbc_spa_util_low_wm",
+		"wbc_throttle_move_delay_ms",
+		"wbc_update_statistics_interval_ms",
+		"wbc_window_roll_delay_ms",
+		"zcr_blksz_max",
+		"zcr_blksz_min",
+		"zfs_abd_chunk_size",
+		"zfs_abd_scatter_enabled",
+		"zfs_arc_average_blocksize",
+		"zfs_arc_ddt_limit",
+		"zfs_arc_evict_batch_limit",
+		"zfs_arc_grow_retry",
 		"zfs_arc_max",
+		"zfs_arc_meta_limit",
+		"zfs_arc_meta_min",
 		"zfs_arc_min",
-		"arc_shrink_shift",
-		"zfs_mdcomp_disable",
-		"zfs_prefetch_disable",
-		"zfetch_max_streams",
-		"zfetch_min_sec_reap",
-		"zfetch_block_cap",
-		"zfetch_array_rd_sz",
+		"zfs_arc_p_min_shift",
+		"zfs_arc_segregate_ddt",
+		"zfs_arc_shrink_shift",
+		"zfs_commit_timeout_pct",
+		"zfs_compressed_arc_enabled",
+		"zfs_condense_pct",
+		"zfs_dbgmsg_maxsize",
+		"zfs_dbgmsg_size",
+		"zfs_dbuf_evict_key",
+		"zfs_ddt_byte_ceiling",
+		"zfs_ddt_limit_type",
+		"zfs_ddts_msize",
+		"zfs_deadman_checktime_ms",
+		"zfs_deadman_enabled",
+		"zfs_deadman_synctime_ms",
+		"zfs_dedup_prefetch",
 		"zfs_default_bs",
 		"zfs_default_ibs",
-		"metaslab_aliquot",
-		"reference_tracking_enable",
-		"reference_history",
-		"spa_max_replication_override",
-		"spa_mode_global",
+		"zfs_delay_max_ns",
+		"zfs_delay_min_dirty_percent",
+		"zfs_delay_resolution_ns",
+		"zfs_delay_scale",
+		"zfs_dequeue_run_bonus_ms",
+		"zfs_dirty_data_max",
+		"zfs_dirty_data_max_max",
+		"zfs_dirty_data_max_percent",
+		"zfs_dirty_data_sync",
+		"zfs_do_async_free",
+		"zfs_fastflush",
 		"zfs_flags",
-		"zfs_txg_timeout",
-		"zfs_vdev_cache_max",
-		"zfs_vdev_cache_size",
-		"zfs_vdev_cache_bshift",
-		"vdev_mirror_shift",
-		"zfs_scrub_limit",
+		"zfs_flush_ntasks",
+		"zfs_free_bpobj_enabled",
+		"zfs_free_leak_on_eio",
+		"zfs_free_max_blocks",
+		"zfs_free_min_time_ms",
+		"zfs_fsync_sync_cnt",
+		"zfs_fsyncer_key",
+		"zfs_immediate_write_sz",
+		"zfs_l2arc_async_evict",
+		"zfs_li",
+		"zfs_lua_check_instrlimit_interval",
+		"zfs_lua_max_instrlimit",
+		"zfs_lua_max_memlimit",
+		"zfs_max_recordsize",
+		"zfs_mdcomp_disable",
+		"zfs_metaslab_condense_block_threshold",
+		"zfs_metaslab_fragmentation_threshold",
+		"zfs_metaslab_segment_weight_enabled",
+		"zfs_metaslab_switch_threshold",
+		"zfs_mg_fragmentation_threshold",
+		"zfs_mg_noalloc_threshold",
+		"zfs_multilist_num_sublists",
 		"zfs_no_scrub_io",
 		"zfs_no_scrub_prefetch",
-		"zfs_vdev_aggregation_limit",
-		"fzap_default_block_shift",
-		"zfs_immediate_write_sz",
-		"zfs_read_chunk_size",
 		"zfs_nocacheflush",
+		"zfs_nopwrite_enabled",
+		"zfs_pd_bytes_max",
+		"zfs_per_txg_dirty_frees_percent",
+		"zfs_prefetch_disable",
+		"zfs_read_chunk_size",
+		"zfs_recover",
+		"zfs_recv_queue_length",
+		"zfs_redundant_metadata_most_ditto_level",
+		"zfs_resilver_min_time_ms",
+		"zfs_root_latency_alpha",
+		"zfs_scan_checkpoint_intval",
+		"zfs_scan_dequeue_min",
+		"zfs_scan_dequeue_run_target_ms",
+		"zfs_scan_direct",
+		"zfs_scan_fill_weight",
+		"zfs_scan_max_ext_gap",
+		"zfs_scan_mem_lim_fact",
+		"zfs_scan_mem_lim_min",
+		"zfs_scan_mem_lim_soft_fact",
+		"zfs_scan_mem_lim_soft_max",
+		"zfs_scan_min_time_ms",
+		"zfs_scrub_limit",
+		"zfs_send_corrupt_data",
+		"zfs_send_queue_length",
+		"zfs_send_set_freerecords_bit",
+		"zfs_send_timeout",
+		"zfs_share_lock",
+		"zfs_smartcomp_interval",
+		"zfs_smartcomp_interval_exp",
+		"zfs_smartcomp_threshold_factor",
+		"zfs_sync_pass_deferred_free",
+		"zfs_sync_pass_dont_compress",
+		"zfs_sync_pass_rewrite",
+		"zfs_sync_taskq_batch_pct",
+		"zfs_top_maxinflight",
+		"zfs_trim",
+		"zfs_trim_min_ext_sz",
+		"zfs_txg_timeout",
+		"zfs_vdev_aggregation_limit",
+		"zfs_vdev_async_read_max_active",
+		"zfs_vdev_async_read_min_active",
+		"zfs_vdev_async_write_active_max_dirty_percent",
+		"zfs_vdev_async_write_active_min_dirty_percent",
+		"zfs_vdev_async_write_max_active",
+		"zfs_vdev_async_write_min_active",
+		"zfs_vdev_cache_bshift",
+		"zfs_vdev_cache_max",
+		"zfs_vdev_cache_size",
+		"zfs_vdev_max_active",
+		"zfs_vdev_queue_depth_pct",
+		"zfs_vdev_read_gap_limit",
+		"zfs_vdev_resilver_max_active",
+		"zfs_vdev_resilver_min_active",
+		"zfs_vdev_scrub_max_active",
+		"zfs_vdev_scrub_min_active",
+		"zfs_vdev_sync_read_max_active",
+		"zfs_vdev_sync_read_min_active",
+		"zfs_vdev_sync_write_max_active",
+		"zfs_vdev_sync_write_min_active",
+		"zfs_vdev_write_gap_limit",
+		"zfs_vn_rele_max_tasks",
+		"zfs_vs_latency_alpha",
+		"zfs_wbc_data_max",
+		"zfs_wbc_schedtmo",
+		"zfs_write_implies_delete_child",
+		"zfs_zil_clean_taskq_maxalloc",
+		"zfs_zil_clean_taskq_minalloc",
+		"zfs_zil_clean_taskq_nthr_pct",
 		"zil_replay_disable",
-		"metaslab_gang_bang",
-		"metaslab_df_alloc_threshold",
-		"metaslab_df_free_pct",
+		"zil_slog_bulk",
+		"zio_buf_debug_limit",
+		"zio_dva_throttle_enabled",
+		"zio_faulty_vdev_delay_us",
+		"zio_faulty_vdev_enabled",
+		"zio_faulty_vdev_guid",
 		"zio_injection_enabled",
 		"zvol_immediate_write_sz",
+		"zvol_maxphys",
+		"zvol_unmap_enabled",
+		"zvol_unmap_sync_enabled",
 	};
 
 	for (int i = 0; i < sizeof (params) / sizeof (params[0]); i++) {
@@ -423,23 +601,6 @@
 
 /* ARGSUSED */
 static int
-dva(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
-{
-	dva_t dva;
-	if (mdb_vread(&dva, sizeof (dva_t), addr) == -1) {
-		mdb_warn("failed to read dva_t");
-		return (DCMD_ERR);
-	}
-	mdb_printf("<%llu:%llx:%llx>\n",
-	    (u_longlong_t)DVA_GET_VDEV(&dva),
-	    (u_longlong_t)DVA_GET_OFFSET(&dva),
-	    (u_longlong_t)DVA_GET_ASIZE(&dva));
-
-	return (DCMD_OK);
-}
-
-/* ARGSUSED */
-static int
 blkptr(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
 {
 	char type[80], checksum[80], compress[80];
@@ -987,16 +1148,20 @@
 		"p", "c", "c_min", "c_max", "size", "duplicate_buffers_size",
 		"arc_meta_used", "arc_meta_limit", "arc_meta_max",
 		"arc_meta_min", "hdr_size", "data_size", "metadata_size",
-		"other_size", "anon_size", "anon_evictable_data",
-		"anon_evictable_metadata", "mru_size", "mru_evictable_data",
-		"mru_evictable_metadata", "mru_ghost_size",
+		"ddt_size", "other_size", "anon_size", "anon_evictable_data",
+		"anon_evictable_metadata", "anon_evictable_ddt", "mru_size",
+		"mru_evictable_data", "mru_evictable_metadata",
+		"mru_evictable_ddt",  "mru_ghost_size",
 		"mru_ghost_evictable_data", "mru_ghost_evictable_metadata",
-		"mfu_size", "mfu_evictable_data", "mfu_evictable_metadata",
+		"mru_ghost_evictable_ddt", "mfu_size", "mfu_evictable_data",
+		"mfu_evictable_metadata", "mfu_evictable_ddt",
 		"mfu_ghost_size", "mfu_ghost_evictable_data",
-		"mfu_ghost_evictable_metadata", "evict_l2_cached",
-		"evict_l2_eligible", "evict_l2_ineligible", "l2_read_bytes",
-		"l2_write_bytes", "l2_size", "l2_asize", "l2_hdr_size",
-		"compressed_size", "uncompressed_size", "overhead_size",
+		"mfu_ghost_evictable_metadata", "mfu_ghost_evictable_ddt",
+		"evict_l2_cached", "evict_l2_eligible", "evict_l2_ineligible",
+		"l2_read_bytes", "l2_ddt_read_bytes", "l2_write_bytes",
+		"l2_ddt_write_bytes", "l2_size", "l2_asize",
+		"l2_hdr_size", "compressed_size", "uncompressed_size",
+		"overhead_size",
 		NULL
 	};
 
@@ -1569,9 +1734,6 @@
 		case VDEV_AUX_SPLIT_POOL:
 			aux = "SPLIT_POOL";
 			break;
-		case VDEV_AUX_CHILDREN_OFFLINE:
-			aux = "CHILDREN_OFFLINE";
-			break;
 		default:
 			aux = "UNKNOWN";
 			break;
@@ -2075,12 +2237,10 @@
 	    sd.ms_freeingtree >> shift, suffix);
 	mdb_printf("ms_freedtree = %llu%s\n",
 	    sd.ms_freedtree >> shift, suffix);
-	mdb_printf("ms_tree = %llu%s\n",
-	    sd.ms_tree >> shift, suffix);
+	mdb_printf("ms_tree = %llu%s\n", sd.ms_tree >> shift, suffix);
 	mdb_printf("ms_deferspace = %llu%s\n",
 	    sd.ms_deferspace >> shift, suffix);
-	mdb_printf("last synced avail = %llu%s\n",
-	    sd.avail >> shift, suffix);
+	mdb_printf("last synced avail = %llu%s\n", sd.avail >> shift, suffix);
 	mdb_printf("current syncing avail = %llu%s\n",
 	    sd.nowavail >> shift, suffix);
 
@@ -3938,7 +4098,6 @@
 static const mdb_dcmd_t dcmds[] = {
 	{ "arc", "[-bkmg]", "print ARC variables", arc_print },
 	{ "blkptr", ":", "print blkptr_t", blkptr },
-	{ "dva", ":", "print dva_t", dva },
 	{ "dbuf", ":", "print dmu_buf_impl_t", dbuf },
 	{ "dbuf_stats", ":", "dbuf stats", dbuf_stats },
 	{ "dbufs",
