History log of /freebsd-head/cddl/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a94ef72fbe257f606dfcee68a01f670b5a81cd19 19-Jan-2020 kevans <kevans@FreeBSD.org> libzfs: add zfs_mount_at

This will be used in libbe in place of the internal zmount(); libbe only
wants to be able to mount a dataset at an arbitrary mountpoint without
altering dataset/pool properties. The natural way to do this in a portable
way is by creating a zfs_mount_at() interface that's effectively zfs_mount()
+ a mountpoint parameter. zfs_mount() is now a light wrapper around the new
method.

The interface and implementation have already been accepted into ZFS On
Linux, and the next commit to switch libbe() over to this new interface will
solve the last compatibility issue with ZoL. The next sysutils/openzfs
rebase against ZoL should be able to build libbe/bectl with only minor
adjustments to build glue.

Reviewed by: Ryan Moeller <ryan freqlabs com>
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D23132
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
03c502c41a77c99a4b7f3bc4d9612a974c419363 07-Jan-2020 markj <markj@FreeBSD.org> Use a deterministic hash for USDT symbol names.

Previously libdtrace used ftok(3), which hashes the inode number of the
input object file. To increase reproducibility of builds that embed
USDT probes, include a hash of the object file path in the symbol name
instead.

Reported and tested by: bdrewery
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
c214ed8761b80dc93fe2c83e2ab26ade159d4fd7 03-Jan-2020 mjg <mjg@FreeBSD.org> vfs: add a file missed in r356337
ontrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
2ade50c4604d177da75b805a24d65bf06af13bf4 29-Dec-2019 markj <markj@FreeBSD.org> Add libdtrace support for arm64 USDT probes.

arm64 is still lacking a fasttrap implementation, which is required to
actually enable userland probes, but this at least allows USDT probes to
be linked into userland applications.

Submitted by: Klaus Küchemann <maciphone2@googlemail.com> (original)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D22360
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
21fe5f45cd1919639799ab8b756df328cc772ae0 21-Dec-2019 rlibby <rlibby@FreeBSD.org> dtrace: avoid gcc9 Walloca-larger-than

gcc9 grew a new warning for unbounded allocas, such as the one in
dt_options_load. Remove both uses of alloca in dt_options.c.

Reviewed by: markj
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D22880
ontrib/opensolaris/lib/libdtrace/common/dt_options.c
16923f2426747207f66ba4329b6ede7418cf4adb 11-Dec-2019 sjg <sjg@FreeBSD.org> Update Makefile.depend files

Update a bunch of Makefile.depend files as
a result of adding Makefile.depend.options files

Reviewed by: bdrewery
MFC after: 1 week
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org/D22494
ib/libavl/Makefile.depend
ib/libctf/Makefile.depend
ib/libnvpair/Makefile.depend
ib/libumem/Makefile.depend
ib/libuutil/Makefile.depend
ib/libzfs/Makefile.depend
ib/libzfs_core/Makefile.depend
f0cb677efb5c64c0e122872e60e23c6601680cf6 02-Dec-2019 tsoome <tsoome@FreeBSD.org> libzpool: use CFLAGS.lz4.c to build lz4.o and lz4.pico

Clean up this Makefile a bit.
ib/libzpool/Makefile
b690a5a4e3a90495bbf25e4a0c18667dd5c23e97 21-Nov-2019 avg <avg@FreeBSD.org> MFV r354383: 10592 misc. metaslab and vdev related ZoL bug fixes

illumos/illumos-gate@555d674d5d4b8191dc83723188349d28278b2431
https://github.com/illumos/illumos-gate/commit/555d674d5d4b8191dc83723188349d28278b2431

https://www.illumos.org/issues/10592
This is a collection of recent fixes from ZoL:
8eef997679b Error path in metaslab_load_impl() forgets to drop ms_sync_lock
928e8ad47d3 Introduce auxiliary metaslab histograms
425d3237ee8 Get rid of space_map_update() for ms_synced_length
6c926f426a2 Simplify log vdev removal code
21e7cf5da89 zdb -L should skip leak detection altogether
df72b8bebe0 Rename range_tree_verify to range_tree_verify_not_present
75058f33034 Remove unused vdev_t fields

Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>
MFC after: 4 weeks
ontrib/opensolaris/cmd/zdb/zdb.8
ontrib/opensolaris/cmd/zdb/zdb.c
8f9d69492c3da3a8c1ea7fa1bc82b7639cc3064b 21-Nov-2019 avg <avg@FreeBSD.org> MFV r354382,r354385: 10601 10757 Pool allocation classes

illumos/illumos-gate@663207adb1669640c01c5ec6949ce78fd806efae
https://github.com/illumos/illumos-gate/commit/663207adb1669640c01c5ec6949ce78fd806efae

10601 Pool allocation classes
https://www.illumos.org/issues/10601
illumos port of ZoL Pool allocation classes. Includes at least these two
commits:
441709695 Pool allocation classes misplacing small file blocks
cc99f275a Pool allocation classes

10757 Add -gLp to zpool subcommands for alt vdev names
https://www.illumos.org/issues/10757
Port from ZoL of
d2f3e292d Add -gLp to zpool subcommands for alt vdev names
Note that a subsequent ZoL commit changed -p to -P
a77f29f93 Change full path subcommand flag from -p to -P

Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Portions contributed by: Håkan Johansson <f96hajo@chalmers.se>
Portions contributed by: Richard Yao <ryao@gentoo.org>
Portions contributed by: Chunwei Chen <david.chen@nutanix.com>
Portions contributed by: loli10K <ezomori.nozomu@gmail.com>
Author: Don Brady <don.brady@delphix.com>

11541 allocation_classes feature must be enabled to add log device

illumos/illumos-gate@c1064fd7ce62fe763a4475e9988ffea3b22137de
https://github.com/illumos/illumos-gate/commit/c1064fd7ce62fe763a4475e9988ffea3b22137de

https://www.illumos.org/issues/11541
After the allocation_classes feature was integrated, one can no longer add a
log device to a pool unless that feature is enabled. There is an explicit check
for this, but it is unnecessary in the case of log devices, so we should handle
this better instead of forcing the feature to be enabled.

Author: Jerry Jelinek <jerry.jelinek@joyent.com>

FreeBSD notes.
I faithfully added the new -g, -L, -P flags, but only -g does something:
vdev GUIDs are displayed instead of device names. -L, resolve symlinks,
and -P, display full disk paths, do nothing at the moment.
The use of special vdevs is backward compatible for read-only access, so
root pools should be bootable, but exercise caution.

MFC after: 4 weeks
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zpool/zpool-features.7
ontrib/opensolaris/cmd/zpool/zpool.8
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/cmd/zpool/zpool_vdev.c
ontrib/opensolaris/cmd/ztest/ztest.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
ontrib/opensolaris/lib/libzpool/common/util.c
5fb301e793e7c0023ab45a66c3b2df8d297a8efa 20-Nov-2019 avg <avg@FreeBSD.org> zpool.8: remove a paragraph about quorum disks

FreeBSD has no such thing.
illumos and ZoL manuals do not talk about quorum disks either.
Only Oracle ZFS mentions them.

MFC after: 1 week
ontrib/opensolaris/cmd/zpool/zpool.8
b4e24cd217de1195a9ba38192ded66076aa64672 20-Nov-2019 avg <avg@FreeBSD.org> fix up r354804, resolve merge conflicts in zpool.8

Somehow I managed to commit the manual page with unresolved conflicts in
it.

While here, I also replaced .sp with .Pp.

MFC after: 3 weeks
X-MFC with: r354804
ontrib/opensolaris/cmd/zpool/zpool.8
b84c86e41e4d7d106abb2119d43eefb97237c290 18-Nov-2019 markj <markj@FreeBSD.org> Fix inconsistencies in anonymous DOF files.

The DOF file output by dtrace -A contains only the loadable sections.
However, as it was created by a call to dtrace_dof_create() without
flags, the original DOF was created with the loadable sections. The
result is that the DOF includes the section headers for the unloadable
sections (COMMENTS and UTSNAME) without these sections actually being
present. This is inconsistent.

A simple change to anon_prog() ensures that the missing sections are
present in the outputted DOF. Alternatively, the call to
dtrace_dof_create() could pass the DTRACE_D_STRIP flag stripping out the
loadable sections. As the unloadable sections contain info useful for
debugging purposes they haven't been stripped.

Submitted by: Graeme Jenkinson <graeme.jenkinson@cl.cam.ac.uk>
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D21875
ontrib/opensolaris/cmd/dtrace/dtrace.c
a0993d42a51185eb388e5098ba2e5a0f04b52a2a 18-Nov-2019 avg <avg@FreeBSD.org> fix up r354804, link zstreamdump with libzfs

Since r354804 libzpool depends on libzfs for get_system_hostid symbol.
Except for zstreamdump, all binaries linked with libzpool were already
linked with libzfs. So, zstreamdump is the only fall-out.

It's interesting that on amd64 not only I was able to successfully build
zstreamdump, I am able to run it despite having the unresolved symbol in
libzpool.

MFC after: 4 weeks
X-MFC with: r354804
sr.bin/zstreamdump/Makefile
f3b212b1a5919ad51b644a9021cb3ef22e27caec 18-Nov-2019 avg <avg@FreeBSD.org> MFV r354378,r354379,r354386: 10499 Multi-modifier protection (MMP)

10499 Multi-modifier protection (MMP)
illumos/illumos-gate@e0f1c0afa46cc84d4b1e40124032a9a87310386e
https://github.com/illumos/illumos-gate/commit/e0f1c0afa46cc84d4b1e40124032a9a87310386e
https://www.illumos.org/issues/10499
Port the following ZFS commits from ZoL to illumos.
379ca9cf2 Multi-modifier protection (MMP)
bbffb59ef Fix multihost stale cache file import
0d398b256 Do not initiate MMP writes while pool is suspended

10701 Correct lock ASSERTs in vdev_label_read/write
illumos/illumos-gate@58447f688d5e308373ab16a3b129bc0ba0fbc154
https://github.com/illumos/illumos-gate/commit/58447f688d5e308373ab16a3b129bc0ba0fbc154
https://www.illumos.org/issues/10701
Port of ZoL commit:
0091d66f4e Correct lock ASSERTs in vdev_label_read/write
At a minimum, this fixes a blown assert during an MMP test run when running on
a DEBUG build.

11770 additional mmp fixes
illumos/illumos-gate@4348eb901228d2f8fa50bb132a34248e8662074e
https://github.com/illumos/illumos-gate/commit/4348eb901228d2f8fa50bb132a34248e8662074e
https://www.illumos.org/issues/11770
Port a few additional MMP fixes from ZoL that came in after our
initial MMP port.
4ca457b065 ZTS: Fix mmp_interval failure
ca95f70dff zpool import progress kstat
(only minimal changes from above can be pulled in right now)
060f0226e6 MMP interval and fail_intervals in uberblock

Note from the committer (me).
I do not have any use for this feature and I have not tested it. I only
did smoke testing with multihost=off.
Please be aware.
I merged the code only to make future merges easier.

Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Portions contributed by: Tim Chase <tim@chase2k.com>
Portions contributed by: sanjeevbagewadi <sanjeev.bagewadi@gmail.com>
Portions contributed by: John L. Hammond <john.hammond@intel.com>
Portions contributed by: Giuseppe Di Natale <dinatale2@llnl.gov>
Portions contributed by: Prakash Surya <surya1@llnl.gov>
Portions contributed by: Brian Behlendorf <behlendorf1@llnl.gov>
Author: Olaf Faaland <faaland1@llnl.gov>

MFC after: 4 weeks
e63d2efc6c7a2cd9b05bff905cc6afb51fc21b88 07-Nov-2019 avg <avg@FreeBSD.org> fix zpool list property names

This change is based on
r354380 8899 zpool list property documentation doesn't match actual behaviour

There is no "used" pool property, "alloc" is actually spelled
"allocated".

MFC after: 5 days
ontrib/opensolaris/cmd/zpool/zpool.8
facf75e0dd085a5c8170ab2b45e88bf9b172e7c8 07-Nov-2019 avg <avg@FreeBSD.org> MFV r354377: 10554 Implemented zpool sync command

illumos/illumos-gate@9c2acf00e275b6b2125a306f33cdddcc58393220
https://github.com/illumos/illumos-gate/commit/9c2acf00e275b6b2125a306f33cdddcc58393220

https://www.illumos.org/issues/10554
During the port of MMP (illumos bug 10499) from ZoL, I found this
earlier ZoL project is a prerequisite. Here is the original
description. This addition will enable us to sync an open TXG to the
main pool on demand. The functionality is similar to 'sync(2)' but
'zpool sync' will return when data has hit the main storage instead of
potentially just the ZIL as is the case with the 'sync(2)' cmd.

Portions contributed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Author: Alek Pinchuk <apinchuk@datto.com>
MFC after: 3 weeks
Relnotes: possibly
ontrib/opensolaris/cmd/zpool/zpool.8
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
2e0488d4385a378cd1684d228a1753d6b25773a1 02-Nov-2019 tsoome <tsoome@FreeBSD.org> r354253 did miss the fact that libzpool is built as fake kernel

We build libzpool as kernel like, use _FAKE_KERNEL check to include
kernel api in libzpool.
ib/libzpool/Makefile
6560e8be0efb7983c06b3c9387f47cb385e9cf83 02-Nov-2019 tsoome <tsoome@FreeBSD.org> Remove duplicate lz4 implementations

Port illumos change: https://www.illumos.org/issues/11667

Move lz4.c out of zfs tree to opensolaris/common/lz4, adjust it to be
usable from kernel/stand/userland builds, so we can use just one single
source. Add lz4.h to declare lz4_compress() and lz4_decompress().

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D22037
ib/libzpool/Makefile
22b0eb13b24b859a3d50a37a0bcf90564d31896a 26-Oct-2019 asomers <asomers@FreeBSD.org> MFZoL: Avoid retrieving unused snapshot props

This patch modifies the zfs_ioc_snapshot_list_next() ioctl to enable it
to take input parameters that alter the way looping through the list of
snapshots is performed. The idea here is to restrict functions that
throw away some of the snapshots returned by the ioctl to a range of
snapshots that these functions actually use. This improves efficiency
and execution speed for some rollback and send operations.

Reviewed-by: Tom Caputi <tcaputi@datto.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Signed-off-by: Alek Pinchuk <apinchuk@datto.com>
Closes #8077
zfsonlinux/zfs@4c0883fb4af0d5565459099b98fcf90ecbfa1ca1

MFC after: 2 weeks
ontrib/opensolaris/cmd/zfs/zfs_iter.c
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_iter.c
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
61baeb329f70b5077e2956d0fee1928f9bc12f1c 25-Oct-2019 avg <avg@FreeBSD.org> zfs.8: fix a typo in the date

Reported by: Trond Endrestøl <trond.endrestol@ximalas.info>
MFC after: 3 days
ontrib/opensolaris/cmd/zfs/zfs.8
722bbbddac33433165bec18df7e19dfa717efe8e 16-Oct-2019 avg <avg@FreeBSD.org> fix section number in zfs-program.8

MFC after: 3 days
ontrib/opensolaris/cmd/zfs/zfs-program.8
4cc84298dd89e243b76f4bba318c5a5d71fcedb2 16-Oct-2019 avg <avg@FreeBSD.org> MFV r348596: 9689 zfs range lock code should not be zpl-specific

illumos/illumos-gate@7931524763ef94dc16989451dddd206563d03bb4

FreeBSD note: some tweaking was needed to avoid a conflict with
sys/rangelock.h.

Author: Matthew Ahrens <mahrens@delphix.com>
Obtained from: illumos
MFC after: 3 weeks
ontrib/opensolaris/cmd/ztest/ztest.c
fdf92df95654600adf42ff49b06ea4ac39edc2fc 16-Oct-2019 avg <avg@FreeBSD.org> fix wording / typos in r353625

Reported by: kib
MFC after: 4 weeks
X-MFC with: r353625, r353618
ontrib/opensolaris/lib/libzpool/common/kernel.c
bdeb23c1ebbc171451a3ea2b286a81d31ca63461 16-Oct-2019 avg <avg@FreeBSD.org> zfs: add a lame emulation of cv_wait_sig(9) in userland to fix r353618

Not sure if we need anything better.
Maybe we should try to port illumos libfakekernel or provide something
similar natively.

MFC after: 4 weeks
X-MFC with: r353618
ontrib/opensolaris/lib/libzpool/common/kernel.c
ontrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
cc0089fc57f70d2628f9b2c7dabaf2c49c3158cd 16-Oct-2019 avg <avg@FreeBSD.org> MFV r353623: 10473 zfs(1M) missing cross-reference to zfs-program(1M)

illumos/illumos-gate@736e6700391d17ab1494985a80076fc185722699
https://github.com/illumos/illumos-gate/commit/736e6700391d17ab1494985a80076fc185722699

https://www.illumos.org/issues/10473

Author: Jason King <jason.king@joyent.com>
Obtained from: illumos
MFC after: 6 days
ontrib/opensolaris/cmd/zfs/zfs.8
935d5ee530ca452c6680b5d3aaea2c90c0353f2b 16-Oct-2019 avg <avg@FreeBSD.org> MFV r353615: 9485 Optimize possible split block search space

illumos/illumos-gate@a21fe349793c3805ec504bbe5e9acf06c2d63d7a
https://github.com/illumos/illumos-gate/commit/a21fe349793c3805ec504bbe5e9acf06c2d63d7a

https://www.illumos.org/issues/9485
Port this commit from ZoL:
https://github.com/zfsonlinux/zfs/commit/4589f3ae4c1bb435777da8640eb915f3c713b14d

Author: Brian Behlendorf <behlendorf1@llnl.gov>
Obtained from: illumos, ZoL
MFC after: 3 weeks
ontrib/opensolaris/cmd/ztest/ztest.c
e7993b34fd5d7a58540002eeb4fed7b96512ffb9 16-Oct-2019 avg <avg@FreeBSD.org> MFC r353611: 10330 merge recent ZoL vdev and metaslab changes

illumos/illumos-gate@a0b03b161c4df3cfc54fbc741db09b3bdc23ffba
https://github.com/illumos/illumos-gate/commit/a0b03b161c4df3cfc54fbc741db09b3bdc23ffba

https://www.illumos.org/issues/10330
3 recent ZoL changes in the vdev and metaslab code which we can pull over:
PR 8324 c853f382db 8324 Change target size of metaslabs from 256GB to 16GB
PR 8290 b194fab0fb 8290 Factor metaslab_load_wait() in metaslab_load()
PR 8286 419ba59145 8286 Update vdev_is_spacemap_addressable() for new spacemap
encoding

Author: Serapheim Dimitropoulos <serapheimd@gmail.com>
Obtained from: illumos, ZoL
MFC after: 2 weeks
ontrib/opensolaris/cmd/zdb/zdb.c
9c1ef2e58d9443e5de27dedb2fee626d4cb22c23 16-Oct-2019 avg <avg@FreeBSD.org> MFV r353606: 10067 Miscellaneous man page typos

https://www.illumos.org/issues/10067
fileystem - man1m/zfs.1m man1m/boot.1m

Author: Peter Tribble <peter.tribble@gmail.com>
Obtained from: illumos
MFC after: 1 week
ontrib/opensolaris/cmd/zfs/zfs.8
928e974c925e1f69a34ef239e1b4d7bb794a9dcd 09-Oct-2019 avg <avg@FreeBSD.org> zfs: remove gratuitous divergence from other openzfs flavours

The divergence is a result of a local change in r344601 and a followup
fix in r352580 that reverted portions of the earlier change.

MFC after: 1 week
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
d5ea96dc34be5bf353706943af60235f1d468f72 09-Oct-2019 avg <avg@FreeBSD.org> zfs: remove incorrect warning about boot support for large_dnode

Fixes r353341

Reported by: tsoome
MFC after: 4 days
X-MFC with: r353341
ontrib/opensolaris/cmd/zpool/zpool-features.7
46619028b71b322872db0e1dba457d97c3f7b165 09-Oct-2019 avg <avg@FreeBSD.org> zfs: document large_dnode feature

The text is copied from illumos.
The conversion to mdoc is mine.
The FreeBSD boot warning is copied from large_block description.

MFC after: 4 days
ontrib/opensolaris/cmd/zpool/zpool-features.7
bd8e9d12b18187962234407c3e44e9eb34e855d1 07-Oct-2019 avg <avg@FreeBSD.org> MFV r350898, r351075: 8423 8199 7432 Implement large_dnode pool feature

8423 8199 7432 Implement large_dnode pool feature

7432 Large dnode pool feature
8199 multi-threaded dmu_object_alloc()
8423 Implement large_dnode pool feature
10406 large_dnode changes broke zfs recv of legacy stream

llumos/illumos-gate@54811da5ac6b517992fdc173df5d605e4e61fdc0
https://github.com/illumos/illumos-gate/commit/54811da5ac6b517992fdc173df5d605e4e61fdc0
https://www.illumos.org/issues/8423
https://www.illumos.org/issues/8199
https://www.illumos.org/issues/7432

illumos/illumos-gate@811964cd9f1fbae0fc3b93d116269e9b1fca090a
https://github.com/illumos/illumos-gate/commit/811964cd9f1fbae0fc3b93d116269e9b1fca090a
https://www.illumos.org/issues/10406

ZoL issues:
Improved dnode allocation #6564
Clean up large dnode code #6262
Fix dnode_hold() freeing dnode behavior #8172
Fix dnode allocation race #6414, #6439
Partial: Raw sends must be able to decrease nlevels #6821, #6864
Remove unnecessary txg syncs from receive_object() Closes #7197

This updates FreeBSD large_dnode code (that was imported from ZoL) to a
version that was committed to illumos. It has some cleanups,
improvements and fixes comparing to what we have in FreeBSD now.
I think that the most significant update is 8199 multi-threaded
dmu_object_alloc().

This commit reverts r351077 that was a revert of r351074 and r351076 and
restores those changes. Required atomic operations should be available
now on all platforms where we build ZFS.

Obtained from: illumos
MFC after: 3 weeks
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/zdb/zdb_il.c
ontrib/opensolaris/cmd/zstreamdump/zstreamdump.c
ontrib/opensolaris/cmd/ztest/ztest.c
a757da83a4fbed1a4f7e8c22542dcb93c75f90cf 03-Oct-2019 avg <avg@FreeBSD.org> ZFS: add bookmark renaming

The feature is implemented as an extension of the existing
ZFS_IOC_RENAME ioctl. Both the userland and the DSL interfaces support
renaming only a single bookmark at a time. As of now, there is no ZCP
interface to the new functionality. I am going to add it once the DSL
interface passes a test of time.

This change picks up support for zfs_ioc_namecheck_t::ENTITY_NAME that
was added to ZoL as part of Redacted Send/Receive feature by Paul
Dagnelie <pcd@delphix.com>. This is needed to allow a bookmark name in
zc_name.

Discussed with: mahrens
Reviewed by: bcr (man page)
Sponsored by: CyberSecure
Differential Revision: https://reviews.freebsd.org/D21795
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
7a87add9eba08fc0e7dd9850f261484628afa3da 22-Sep-2019 avg <avg@FreeBSD.org> MFZoL: Retire send space estimation via ZFS_IOC_SEND

Add a small wrapper around libzfs_core's lzc_send_space() to libzfs so
that every legacy ZFS_IOC_SEND consumer, along with their userland
counterpart estimate_ioctl(), can leverage ZFS_IOC_SEND_SPACE to
request send space estimation.

The legacy functionality in zfs_ioc_send() is left untouched for
compatibility purposes.

Obtained from: ZoL
Obtained from: zfsonlinux/zfs@cf7684bc8d57
Author: loli10K <ezomori.nozomu@gmail.com>
MFC after: 2 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
907e26f11843e21b17300ef41bf0cf5fca20a76f 22-Sep-2019 avg <avg@FreeBSD.org> print summary line for space estimate of zfs send from bookmark

Although there is always a single stream and the total size in the
summary is always equal to the size reported for the stream, it's nice
to follow the usual output format.

MFC after: 3 days
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
3ad2b320219862deb4cd7e19b0719939a4cb6af6 21-Sep-2019 sef <sef@FreeBSD.org> Fix a regression introduced in r344601, and work properly with the
-v and -n options.

PR: 240640
Reported by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: avg
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D21709
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
99cb216bf9689a0141a8d47d9fe4b617a9360d5d 19-Sep-2019 avg <avg@FreeBSD.org> update zfs send usage help with r352447

MFC after: 3 days
ontrib/opensolaris/cmd/zfs/zfs_main.c
28e4f4ca966456fea79878f6fecd5f1daa88016e 17-Sep-2019 avg <avg@FreeBSD.org> MFZoL: Add -vnP support to 'zfs send' for bookmarks

zfsonlinux/zfs@835db58592d7d947e5818eb7281882e2a46073e0

We have long supported estimating a size of an incremental stream from a
snapshot. We should do the same for bookmarks as well.

Obtained from: ZoL
Author: loli10K <ezomori.nozomu@gmail.com>
MFC after: 3 days
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
c8114f8ed2abcc5cd3444120eb55aeb1abff854c 05-Sep-2019 manu <manu@FreeBSD.org> pkgbase: Force zfs(8) and zpool(8) to be in the runtime package

Those commands are needed to repair a FreeBSD installation so add them
to the runtime package

Reviewed by: bapt, gjb
Differential Revision: https://reviews.freebsd.org/D21498
ib/libavl/Makefile
ib/libnvpair/Makefile
ib/libumem/Makefile
ib/libuutil/Makefile
ib/libzfs/Makefile
ib/libzfs_core/Makefile
bin/zfs/Makefile
bin/zpool/Makefile
a3dbacfc31a3c2ef7d9d4d12d4e5108f044c0701 04-Sep-2019 avg <avg@FreeBSD.org> ZFS: Always refuse receving non-resume stream when resume state exists

This fixes a hole in the situation where the resume state is left from
receiving a new dataset and, so, the state is set on the dataset itself
(as opposed to %recv child).

Additionally, distinguish incremental and resume streams in error
messages.

This was also committed to ZoL:
zfsonlinux/zfs@ebeb6f23bf7e8fe6732a05267ed1cab4c38d3b23

MFC after: 2 weeks
Sponsored by: CyberSecure
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
a764b08abfecf6515aee0e5fa03a39421838dbe2 31-Aug-2019 lwhsu <lwhsu@FreeBSD.org> Fix dtrace test case after r351423 due to ping6(8) options changed

Failure test case:
cddl.usr.sbin.dtrace.common.ip.t_dtrace_contrib.tst_ipv6localicmp_ksh

Sponsored by: The FreeBSD Foundation
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh
ba0849be484ebd450fa84c1313a70752b4b895b8 31-Aug-2019 lwhsu <lwhsu@FreeBSD.org> Fix tests use /etc/motd after r350184 by using an always existing file

Sponsored by: The FreeBSD Foundation
ontrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe
f2049416ce2b82549e2254ac68539e7d4d1dda8e 28-Aug-2019 mav <mav@FreeBSD.org> MFV/ZoL: Fix wrong assertion in libzfs diff error handling

In compare(), all error cases set the error code to EPIPE, so when an
error is set, the correct assertion to make is that the error is EPIPE,
not EINVAL.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@freqlabs.com>
Closes #8743
zfsonlinux/zfs@9dc41a769df164875d974c2431b2453e70e16c41

Submitted by: Ryan Moeller <ryan@freqlabs.com>
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D20118
ontrib/opensolaris/lib/libzfs/common/libzfs_diff.c
f0708a6e5a9b403ba9ba91243a3597911782671b 21-Aug-2019 markj <markj@FreeBSD.org> Add hold events for lockmgr probes, missed in r351361.

MFC with: r351361
ontrib/opensolaris/cmd/lockstat/lockstat.c
4671f565690d729aa75b635cb43a37787c8c9210 21-Aug-2019 markj <markj@FreeBSD.org> Add lockmgr(9) probes to the lockstat DTrace provider.

They follow the conventions set by rw and sx lock probes. There is
an additional lockstat:::lockmgr-disown probe.

Update lockstat(1) to report on contention and hold events for
lockmgr locks. Document the new probes in dtrace_lockstat.4, and
deduplicate some of the existing probe descriptions.

Reviewed by: mjg
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D21355
ontrib/opensolaris/cmd/lockstat/lockstat.c
e0205845c3ea06f779ca80c1cfff1a3fb62b04b2 21-Aug-2019 markj <markj@FreeBSD.org> Fix inverted predicates for sx lock hold events in lockstat(1).

This caused shared sx holds to be reported as exclusive, and vice
versa.

Reviewed by: mjg
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
ontrib/opensolaris/cmd/lockstat/lockstat.c
949ffd1977ed3b4a5c9ed704f932ade584e32b75 16-Aug-2019 0mp <0mp@FreeBSD.org> zpool-features.7: Fix a typo

Reported by: pstef
Reviewed by: pstef
Approved by: src (pstef)
Differential Revision: https://reviews.freebsd.org/D21290
ontrib/opensolaris/cmd/zpool/zpool-features.7
59be1403ca0789d2bfc38c3ffc10764cbb95d4de 15-Aug-2019 avg <avg@FreeBSD.org> Revert r351076 and r351074 because of atomic_swap_64 on 32-bit platforms

Trying to sort it out.
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/zdb/zdb_il.c
ontrib/opensolaris/cmd/zstreamdump/zstreamdump.c
ontrib/opensolaris/cmd/ztest/ztest.c
9263cb78d3eed5e3cc37591023bd393529d11b06 15-Aug-2019 avg <avg@FreeBSD.org> MFV r350898: 8423 8199 7432 Implement large_dnode pool feature

8423 8199 7432 Implement large_dnode pool feature

8423 Implement large_dnode pool feature
8199 multi-threaded dmu_object_alloc()
7432 Large dnode pool feature

llumos/illumos-gate@54811da5ac6b517992fdc173df5d605e4e61fdc0
https://github.com/illumos/illumos-gate/commit/54811da5ac6b517992fdc173df5d605e4e61fdc0
https://www.illumos.org/issues/8423
https://www.illumos.org/issues/8199
https://www.illumos.org/issues/7432

ZoL issues:
Improved dnode allocation #6564
Clean up large dnode code #6262
Fix dnode_hold() freeing dnode behavior #8172
Fix dnode allocation race #6414, #6439
Partial: Raw sends must be able to decrease nlevels #6821, #6864
Remove unnecessary txg syncs from receive_object() Closes #7197

This updates FreeBSD large_dnode code (that was imported from ZoL) to a version
that was committed to illumos. It has some cleanups, improvements and fixes
comparing to what we have in FreeBSD now. I think that the most significant
update is 8199 multi-threaded dmu_object_alloc().

Obtained from: illumos
MFC after: 3 weeks
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/zdb/zdb_il.c
ontrib/opensolaris/cmd/zstreamdump/zstreamdump.c
ontrib/opensolaris/cmd/ztest/ztest.c
b4b2b0a955d03c7492cd73b15f4c649ed3c2f624 12-Aug-2019 avg <avg@FreeBSD.org> MFV r350896: 6585 sha512, skein, and edonr have an unenforced dependency on extensible dataset

illumos/illumos-gate@892586e8a147c02d7f4053cc405229a13e796928
https://github.com/illumos/illumos-gate/commit/892586e8a147c02d7f4053cc405229a13e796928

https://www.illumos.org/issues/6585
In any pool without the extensible dataset feature flag already enabled,
creating a dataset with dedup set to use one of the new checksums would result
in the following panic as soon as any data was added:
panic[cpu0]/thread=ffffff0006761c40: feature_get_refcount(spa, feature,
&refcount) != 48 (0x30 != 0x30), file: ../../common/fs/zfs/zfeature.c line 390

ffffff0006761830 fffffffffba8fbdd ()
ffffff0006761890 zfs:feature_do_action+11a ()
ffffff00067618c0 zfs:spa_feature_incr+1e ()
ffffff0006761920 zfs:dmu_object_zapify+b7 ()
ffffff00067619b0 zfs:dsl_dataset_activate_feature+97 ()
ffffff0006761a20 zfs:dsl_dataset_sync+ba ()
ffffff0006761ab0 zfs:dsl_pool_sync+153 ()
ffffff0006761b70 zfs:spa_sync+26e ()
ffffff0006761c20 zfs:txg_sync_thread+227 ()
ffffff0006761c30 unix:thread_start+8 ()
Inspection showed that feature->fi_feature was 7, which is the value of
SPA_FEATURE_EXTENSIBLE_DATASET in the spa_feature enum.
Testing shows that the panic can be prevented by explicitly setting extensible
dataset as a dependency for the sha512, edonr, and skein feature flags.
Alternatively, the new checksums code could possibly be changed to obviate the
need for the dependency.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Richard Laager <rlaager@wiktel.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: ilovezfs <ilovezfs@icloud.com>

Note that FreeBSD does not support ednor yet.

MFC after: 2 weeks
ontrib/opensolaris/cmd/zpool/zpool-features.7
30e128b13e2f2bb68670038d7bf6d1141af8b879 12-Aug-2019 avg <avg@FreeBSD.org> Allow ZVOL bookmarks to be listed recursively

Many thanks to cryx-freebsd@h3q.com for reporting the problem and
submitting a fix. I have chosen to take an equivalent but textually
different patch from ZoL just to avoid increasing divergence between
OpenZFS flavours.

ZoL commit: zfsonlinux/zfse33da554c5daf0103b093f44ab5b90ad6c064c3f
Author: loli10K <ezomori.nozomu@gmail.com>
Date: Wed Sep 7 19:34:20 2016 +0200
PR: 197821
Submitted by: cryx-freebsd@h3q.com (alternative version)
Reported by: cryx-freebsd@h3q.com
Obtained from: ZoL
MFC after: 1 week
ontrib/opensolaris/cmd/zfs/zfs_iter.c
9c182fc73e8fa6017d9a2c9df152850e4958faa8 08-Aug-2019 tsoome <tsoome@FreeBSD.org> loader: support com.delphix:removing

We should support removing vdev from boot pool. Update loader zfs reader
to support com.delphix:removing.

Reviewed by: allanjude
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D18901
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
e1c9ac987aea384f34e63724c213819fafa84ef6 31-Jul-2019 wosch <wosch@FreeBSD.org> add forgotten opening bracket "("

PR: 237514
Reviewed by: allanjude
MFC after: soon for 11.3 and 12 series
Differential Revision: https://reviews.freebsd.org/D21009
ontrib/opensolaris/cmd/zfs/zfs.8
9563c2d6d7de65c2b28e5e3be7ad9e9b8f3f7e6c 26-Jul-2019 bapt <bapt@FreeBSD.org> Fix a bug introduced with parallel mounting of zfs

Incorporate a fix from zol:
https://github.com/zfsonlinux/zfs/commit/ab5036df1ccbe1b18c1ce6160b5829e8039d94ce

commit log from upstream:
Fix race in parallel mount's thread dispatching algorithm

Strategy of parallel mount is as follows.

1) Initial thread dispatching is to select sets of mount points that
don't have dependencies on other sets, hence threads can/should run
lock-less and shouldn't race with other threads for other sets. Each
thread dispatched corresponds to top level directory which may or may
not have datasets to be mounted on sub directories.

2) Subsequent recursive thread dispatching for each thread from 1)
is to mount datasets for each set of mount points. The mount points
within each set have dependencies (i.e. child directories), so child
directories are processed only after parent directory completes.

The problem is that the initial thread dispatching in
zfs_foreach_mountpoint() can be multi-threaded when it needs to be
single-threaded, and this puts threads under race condition. This race
appeared as mount/unmount issues on ZoL for ZoL having different
timing regarding mount(2) execution due to fork(2)/exec(2) of mount(8).
`zfs unmount -a` which expects proper mount order can't unmount if the
mounts were reordered by the race condition.

There are currently two known patterns of input list `handles` in
`zfs_foreach_mountpoint(..,handles,..)` which cause the race condition.

1) #8833 case where input is `/a /a /a/b` after sorting.
The problem is that libzfs_path_contains() can't correctly handle an
input list with two same top level directories.
There is a race between two POSIX threads A and B,
* ThreadA for "/a" for test1 and "/a/b"
* ThreadB for "/a" for test0/a
and in case of #8833, ThreadA won the race. Two threads were created
because "/a" wasn't considered as `"/a" contains "/a"`.

2) #8450 case where input is `/ /var/data /var/data/test` after sorting.
The problem is that libzfs_path_contains() can't correctly handle an
input list containing "/".
There is a race between two POSIX threads A and B,
* ThreadA for "/" and "/var/data/test"
* ThreadB for "/var/data"
and in case of #8450, ThreadA won the race. Two threads were created
because "/var/data" wasn't considered as `"/" contains "/var/data"`.
In other words, if there is (at least one) "/" in the input list,
the initial thread dispatching must be single-threaded since every
directory is a child of "/", meaning they all directly or indirectly
depend on "/".

In both cases, the first non_descendant_idx() call fails to correctly
determine "path1-contains-path2", and as a result the initial thread
dispatching creates another thread when it needs to be single-threaded.
Fix a conditional in libzfs_path_contains() to consider above two.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>

PR: 237517, 237397, 239243
Submitted by: Matthew D. Fuller <fullermd@over-yonder.net> (by email)
MFC after: 3 days
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
52f795fa2b0fd07480e136f6c8bdc7d2bbd03700 17-Jul-2019 markj <markj@FreeBSD.org> Reference stdint.h types in ctf.5.

MFC after: 1 week
ontrib/opensolaris/lib/libctf/common/ctf.5
e01b9b5db1283ab13232bbd5347209a75b17b2f6 09-Jun-2019 oshogbo <oshogbo@FreeBSD.org> DTrace: add a top level makefile to the new test suit

Pointed out by: markj
sr.sbin/dtrace/tests/amd64/Makefile
6fb7bb7fca895077c451c091c3fda24468533491 06-Jun-2019 allanjude <allanjude@FreeBSD.org> zpool.8: the comment property is not read-only

The comment property was listed in the man page twice, once under the list
of read-only properties, and again (correctly), under the list of user
editable properties.

PR: 238355
Reported by: Michael Zuo <muh.muhten@gmail.com>
Sponsored by: Klara Systems
ontrib/opensolaris/cmd/zpool/zpool.8
5928f4e54741e6e9606d57e7c003a515d5446c4c 05-Jun-2019 oshogbo <oshogbo@FreeBSD.org> DTrace: create an amd64 test suit

Create two tests checking if we can read urgs registers and if the
rax register returns a correct number.

Reviewed by: markj
Discussed with: lwhsu
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D20364
ontrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.rax.c
ontrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.rax.d
ontrib/opensolaris/cmd/dtrace/test/tst/amd64/arrays/tst.uregsarray.d
sr.sbin/dtrace/tests/Makefile
sr.sbin/dtrace/tests/amd64/arrays/Makefile
sr.sbin/dtrace/tests/tools/genmakefiles.sh
759a18b7c60a5b9da1e510b0e7793857cfd10553 03-Jun-2019 mav <mav@FreeBSD.org> MFV r348583: 9847 leaking dd_clones (DMU_OT_DSL_CLONES) objects

illumos/illumos-gate@17fb938fd6cdce3ff1bb47dafda0774f742249a3

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Matthew Ahrens <mahrens@delphix.com>
ontrib/opensolaris/cmd/zdb/zdb.c
8e4606cf78658bba0ad2e7623dea5b40b64c1eda 03-Jun-2019 mav <mav@FreeBSD.org> MFV r348580: 9559 zfs diff handles files on delete queue in fromsnap poorly

illumos/illumos-gate@20633e304b57bc98f70fdb194081b7023adf527b

Reviewed by: Joshua M. Clulow <josh@sysmgr.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Paul Dagnelie <pcd@delphix.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_diff.c
c4f445de1182c0e15d63476f0ccab9827ed127bf 03-Jun-2019 mav <mav@FreeBSD.org> MFV r348578: 9962 zil_commit should omit cache thrash

illumos/illumos-gate@cab3a55e158118937e07d059c46f1bc14d1f254d

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Approved by: Joshua M. Clulow <josh@sysmgr.org>
Author: Prakash Surya <prakash.surya@delphix.com>
ontrib/opensolaris/cmd/ztest/ztest.c
22bba3db5ec9b783aea70599e804e8709d765296 03-Jun-2019 mav <mav@FreeBSD.org> MFV r348568: 9466 add JSON output support to channel programs

illumos/illumos-gate@5267591016146502784860802129b16dab6f135c

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Alek Pinchuk <apinchuk@datto.com>
ontrib/opensolaris/cmd/zfs/zfs-program.8
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zfs/zfs_main.c
128bcbdc871ed0a7b8823f943f7b7a94256fd628 03-Jun-2019 mav <mav@FreeBSD.org> MFV r348553: 9681 ztest failure in spa_history_log_internal due to spa_rename()

illumos/illumos-gate@6aee0ad76969eb0027131b3a338f2d94ae86f728

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>
ontrib/opensolaris/cmd/ztest/ztest.c
2f3d0724231e10461811caf7118bd9422889b269 03-Jun-2019 mav <mav@FreeBSD.org> MFV r348552: 9682 page fault in dsl_async_clone_destroy() while opening pool

illumos/illumos-gate@ade2c82828f0dca1f46919aa1bd936ea1a5a0047

Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>
ontrib/opensolaris/cmd/zdb/zdb.c
ddeea9406c4232e57fe265c29893bbc05a5b2e92 03-Jun-2019 mav <mav@FreeBSD.org> MFV r348534: 9616 Bogus error when attempting to set property on read-only pool

illumos/illumos-gate@f62db44dbcda5dd786bb821f1e6fd3ca2e6d4391

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andrew Stormont <astormont@racktopsystems.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
edbec18e345019372db033cc95c1e4bb59888089 22-May-2019 markj <markj@FreeBSD.org> Hook up the existing i386 DTrace tests to the build.

Now that it's relatively easy to do so, we might as well.

MFC after: 1 week
Event: Waterloo Hackathon 2019
sr.sbin/dtrace/tests/Makefile
sr.sbin/dtrace/tests/i386/Makefile
sr.sbin/dtrace/tests/i386/arrays/Makefile
sr.sbin/dtrace/tests/i386/funcs/Makefile
sr.sbin/dtrace/tests/i386/pid/Makefile
sr.sbin/dtrace/tests/i386/ustack/Makefile
b64aaee48a5209e0a7bc4226d9b40a3725b01e5a 22-May-2019 markj <markj@FreeBSD.org> Make it possible to generate makefiles for arch-dependent DTrace tests.

MFC after: 1 week
Event: Waterloo Hackathon 2019
sr.sbin/dtrace/tests/tools/genmakefiles.sh
cc2e8ef566771a26f06b875904fa52bb479f6772 20-May-2019 luporl <luporl@FreeBSD.org> [PowerPC64] stand: fix build using clang 8 as compiler

This change fixes "stand" build issues when using clang 8
as compiler.

Submitted by: alfredo.junior_eldorado.org.br
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D20026
ontrib/opensolaris/lib/libzfs/common/libzfs_diff.c
a32298998a2c215306183052ea5a171197eef67c 18-May-2019 allanjude <allanjude@FreeBSD.org> MFV/ZoL: `zfs userspace` ignored all unresolved UIDs after the first

zfsonlinux/zfs@88cfff182432e4d1c24c877f33b47ee6cf109eee

zfs_main: fix `zfs userspace` squashing unresolved entries

The `zfs userspace` squashes all entries with unresolved numeric
values into a single output entry due to the comparsion always
made by the string name which is empty in case of unresolved IDs.

Fix this by falling to a numerical comparison when either one
of string values is not found. This then compares any numerical
values after all with a name resolved.

Signed-off-by: Pavel Boldin <boldin.pavel@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

Reported by: clusteradm
Obtained from: ZFS-on-Linux
MFC after: 3 days
ontrib/opensolaris/cmd/zfs/zfs_main.c
16793845b520ce91cd81ab1ab290214f7afbd9f4 08-May-2019 mav <mav@FreeBSD.org> Fix dataset name comparison in zfs_compare().

The code never returned match comparing two datasets (not snapshots).
As result, uu_avl_find(), called from zfs_callback(), never succeeded,
allowing to add same dataset into the list multiple times, for example:

# zfs get name pers pers pers@z pers@z
NAME PROPERTY VALUE SOURCE
pers name pers -
pers name pers -
pers@z name pers@z -

With the patch:

# zfs get name pers pers pers@z pers@z
NAME PROPERTY VALUE SOURCE
pers name pers -
pers@z name pers@z -

MFC after: 1 week
Sponsored by: iXsystems, Inc.
ontrib/opensolaris/cmd/zfs/zfs_iter.c
324cf6c560b804903ed9376e0d0a07e5fa11e3a5 29-Apr-2019 lwhsu <lwhsu@FreeBSD.org> Add a trailing empty line to match the test code output

This is added for letting these long failing test case pass, and for
consistency. The test code should be fixed later to not output this extra
empty line.

Sponsored by: The FreeBSD Foundation
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh.out
8769fe34396b7e9e18b9b5cb33b46d34b40af57a 28-Apr-2019 tuexen <tuexen@FreeBSD.org> Some test scripts use ncat --sctp --listen port to run an SCTP discard
server in the background. However, when running in the background,
stdin is closed and ncat initiates a graceful shutdown of the SCTP
association. This is not expected by the client. Therefore, the
ncat-based discard server is replaced by a perl-based one.

In addition, to remove the dependency from ncat, which needs to be
installed via the nmap port, also the code testing for a free SCTP port
is changed to use the perl-based client.

Finally, remove some debug output from the report generated.

Reviewed by: lwhsu@
Differential Revision: https://reviews.freebsd.org/D20086
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh
dda5572535789e8d3eb6de29bf79f9b1d215b62e 16-Apr-2019 trasz <trasz@FreeBSD.org> Drop -g from CFLAGS for zfsd(8). No idea why it was ever there.

Reviewed by: kib, ngie, asomers
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D19915
sr.sbin/zfsd/Makefile.common
44d1b4293133694cdf3d07ed792c7514d78cf6f1 10-Apr-2019 trasz <trasz@FreeBSD.org> Make zfsd(8) build obey CFLAGS.

Reviewed by: imp
Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D19865
sr.sbin/zfsd/Makefile.common
d7415fbaadbcbf50f61d8da29ed0e8f7f8c8dc95 20-Mar-2019 markj <markj@FreeBSD.org> Ensure that we use a 64-bit value for the last mmap() argument.

When using __syscall(2), the offset argument is passed on the stack on
amd64. Previously only 32 bits were written, so the upper 32 bits were
garbage and could cause the test to fail.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation
ontrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c
192cdbcab26e60657e26d281701e587be064480c 15-Mar-2019 ngie <ngie@FreeBSD.org> Integrate cddl/usr.sbin/zfds/tests into the FreeBSD test suite

This change integrates the unit tests for zfsd into the test suite using the
integration method described in r345203.

This change removes the `LOCALBASE` includes added for the port version of
googlemock/googletest, as well as unnecessary `LIBADD`/`DPADD` and `CXXFLAGS`
defines, which are included in the `GTEST_CXXFLAGS` variable, as part of
r345203.

Reviewed by: asomers
Approved by: emaste (mentor)
MFC after: 2 months
MFC with: r345203
Differential Revision: https://reviews.freebsd.org/D19552
sr.sbin/zfsd/Makefile
sr.sbin/zfsd/Makefile.common
sr.sbin/zfsd/tests/Makefile
be0177e0a800a0df539152e63a592344b4712e8e 27-Feb-2019 bapt <bapt@FreeBSD.org> Fix a regression introduced in r344569

Import a fix from illumos (thanks Toomas Soomas for pointing at it)

See https://www.illumos.org/issues/10205 for more details
Illumos commit: https://github.com/illumos/illumos-gate/commit/247b7da039fd88350c50e3d7fef15bdab6bef215

Submitted by: jack@gandi.net
Reported by: cy
Reviewed by: tsoome, cy, bapt
Obtained from: Illumos
ontrib/opensolaris/cmd/zfs/zfs_main.c
001b002f2baadcb1f78e1e2c74716f976ed6b6ed 27-Feb-2019 bapt <bapt@FreeBSD.org> Fix regression introduced in r344569

Reported by: cy
Tested by: cy
Submitted by: Fatih Acar <fatih@gandi.net>
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
122ed8691a636f4cc3dc40bdb7a84ead88649eb8 26-Feb-2019 sef <sef@FreeBSD.org> Set process title during zfs send.

This adds a '-V' option to 'zfs send', which sets the process title once a
second to the progress information.

This code has been in FreeNAS for a long time now; this is just upstreaming
it here. It was originially written by delphij.

Reviewed by: mav
Obtained from: iXsystems, Inc
Sponsored by: iXsystems, Inc
Differential Revision: https://reviews.freebsd.org/D19184
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
59cff728bc591653bafe948c7bb47aea98e0655b 26-Feb-2019 bapt <bapt@FreeBSD.org> Implement parallel mounting for ZFS filesystem

It was first implemented on Illumos and then ported to ZoL.
This patch is a port to FreeBSD of the ZoL version.
This patch also includes a fix for a race condition that was amended

With such patch Delphix has seen a huge decrease in latency of the mount phase
(https://github.com/openzfs/openzfs/commit/a3f0e2b569 for details).
With that current change Gandi has measured improvments that are on par with
those reported by Delphix.

Zol commits incorporated:
https://github.com/zfsonlinux/zfs/commit/a10d50f999511d304f910852c7825c70c9c9e303
https://github.com/zfsonlinux/zfs/commit/e63ac16d25fbe991a356489c86d4077567dfea21

Reviewed by: avg, sef
Approved by: avg, sef
Obtained from: ZoL
MFC after: 1 month
Relnotes: yes
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D19098
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_impl.h
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
724199fd4be1d5274c9fabdfb9bb84778cf8de41 25-Feb-2019 luporl <luporl@FreeBSD.org> Increase ctfconvert buffer size

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D19353
ontrib/opensolaris/tools/ctf/cvt/dwarf.c
64666cd88c85919d741db8f0f551b9fe35af65e3 20-Feb-2019 markj <markj@FreeBSD.org> MFV r344364:
9058 postmortem DTrace frequently broken under vmware

illumos/illumos-gate@793bd7e3617ae7d3d24e8c6b7d6befe35f07ec1f

MFC after: 1 week
ontrib/opensolaris/lib/libdtrace/common/dt_consume.c
01134b6773ce38e23e88262c80d3e3a5b579414b 20-Feb-2019 avg <avg@FreeBSD.org> zpool.8: sort zpool status flags in the same order as in illumos manual

Just in case, while I was here.

MFC after: 1 week
ontrib/opensolaris/cmd/zpool/zpool.8
6c8bb514dd95e950c364ab980731217a5a455a68 20-Feb-2019 avg <avg@FreeBSD.org> zpool.8: document -D flag for zpool status

The description is taken from the illumos manual.

Reported by: stilezy@gmail.com
MFC after: 1 week
ontrib/opensolaris/cmd/zpool/zpool.8
adea56ab704c10e2dfdec40deb6fdc4ee8195224 20-Feb-2019 avg <avg@FreeBSD.org> fix userland illumos taskq code to pass relative timeout to cv_timedwait

Unlike illumos, FreeBSD cv_timedwait requires a relative timeout. That
applies both to the kernel illumos compatibility code and to the
userland "fake kernel" code.

MFC after: 2 weeks
Sponsored by: Panzura
ontrib/opensolaris/lib/libzpool/common/taskq.c
72a21ba0f62da5e86a1c0b462aeb3f5ff849a1b7 17-Jan-2019 mckusick <mckusick@FreeBSD.org> Create new EINTEGRITY error with message "Integrity check failed".

An integrity check such as a check-hash or a cross-correlation failed.
The integrity error falls between EINVAL that identifies errors in
parameters to a system call and EIO that identifies errors with the
underlying storage media. EINTEGRITY is typically raised by intermediate
kernel layers such as a filesystem or an in-kernel GEOM subsystem when
they detect inconsistencies. Uses include allowing the mount(8) command
to return a different exit value to automate the running of fsck(8)
during a system boot.

These changes make no use of the new error, they just add it. Later
commits will be made for the use of the new error number and it will
be added to additional manual pages as appropriate.

Reviewed by: gnn, dim, brueffer, imp
Discussed with: kib, cem, emaste, ed, jilles
Differential Revision: https://reviews.freebsd.org/D18765
ib/libdtrace/errno.d
65c40fbfd497edae99987584c9d34a5a93b908ab 26-Dec-2018 avg <avg@FreeBSD.org> MFV r342532: 5882 Temporary pool names

Note that this commit brings only formatting changes that were done
during the final review of the illumos change, because FreeBSD got the
main changes before illumos.

illumos/illumos-gate@04e56356520b98d5a93c496b10f02530bb6647e0
https://github.com/illumos/illumos-gate/commit/04e56356520b98d5a93c496b10f02530bb6647e0

https://www.illumos.org/issues/5882
This is an import of the temporary pool names functionality from ZoL:
https://github.com/zfsonlinux/zfs/commit/e2282ef57edc79cdce2a4b9b7e3333c56494a807
https://github.com/zfsonlinux/zfs/commit/26b42f3f9d03f85cc7966dc2fe4dfe9216601b0e
https://github.com/zfsonlinux/zfs/commit/2f3ec9006146844af6763d1fa4e823fd9047fd54
https://github.com/zfsonlinux/zfs/commit/00d2a8c92f614f49d23dea5d73f7ea7eb489ccf1
https://github.com/zfsonlinux/zfs/commit/83e9986f6eefdf0afc387f06407087bba3ead4e9
https://github.com/zfsonlinux/zfs/commit/023bbe6f017380f4a04c5060feb24dd8cdda9fce
It is intended to assist the creation and management of virtual machines
that have their rootfs on ZFS on hosts that also have their rootfs on
ZFS. These situations cause SPA namespace collisions when the standard
name rpool is used in both cases. The solution is either to give each
guest pool a name unique to the host, which is not always desireable, or
boot a VM environment containing an ISO image to install it, which is
cumbersome.

MFC after: 1 week
Sponsored by: Panzura
ontrib/opensolaris/cmd/zpool/zpool_main.c
848dee25bd296145e2b03ecd3125339d75fe9f45 26-Dec-2018 avg <avg@FreeBSD.org> MFV r342469: 9630 add lzc_rename and lzc_destroy to libzfs_core

illumos/illumos-gate@049ba636fa37a2892809192fc671bff9158a01cd
https://github.com/illumos/illumos-gate/commit/049ba636fa37a2892809192fc671bff9158a01cd

https://www.illumos.org/issues/9630
Rename and destroy are very useful operations that deserve to be in
libzfs_core. And they are not hard to implement too.

MFC after: 2 weeks
Relnotes: maybe
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
84c2360d09e06ff5aabeb10495322f4fc4c078c9 31-Oct-2018 yuripv <yuripv@FreeBSD.org> dtrace(1): remove reference to dtruss that was removed from base
system in r300226.

PR: 211618
Reviewed by: gnn, markj, 0mp
Approved by: kib (mentor, implicit)
Differential Revision: https://reviews.freebsd.org/D17762
ontrib/opensolaris/cmd/dtrace/dtrace.1
bd6049115f941359770878ebb297f707f4103866 22-Aug-2018 tuexen <tuexen@FreeBSD.org> Add support for send, receive and state-change DTrace providers for
SCTP. They are based on what is specified in the Solaris DTrace manual
for Solaris 11.4.

Reviewed by: 0mp, dteske, markj
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16839
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localsctp.ksh.out
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotesctp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotesctp.ksh.out
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localsctpstate.ksh.out
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotesctpstate.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotesctpstate.ksh.out
ib/libdtrace/Makefile
ib/libdtrace/sctp.d
sr.sbin/dtrace/tests/common/ip/Makefile
sr.sbin/dtrace/tests/tools/exclude.sh
d654586e4da62861bacf89811423012909aef3b9 21-Aug-2018 mmacy <mmacy@FreeBSD.org> Make dnode definition uniform on !x86

gcc4 requires -fms-extensions to accept anonymous union members
ib/libzpool/Makefile
sr.bin/ztest/Makefile
sr.sbin/zdb/Makefile
68ec745a9c3c5cab66c245ab684767221f4d09ae 18-Aug-2018 kevans <kevans@FreeBSD.org> libbe(3): Move build goop back out of cddl/

Some background: in the GSoC project, libbe/Makefile lived in lib/libbe. I
created projects/bectl branch, maintained the above for all of five
minutes before I misread Makefile.inc1 and decided that it couldn't possibly
build outside of cddl/, so I kicked the Makefile out into the cddl/ build
and all was good. The misreading was of the bit where .WAIT is added to
SUBDIR after lib, libexec but prior to building bin and cddl *only during
the install targets*, which is the critical part.

Fast forward- buildworld was still broken in my branch unbeknownst to me
because I didn't nuke my OBJDIR. Combing through Makefile.inc1 eventually
revealed the necessary magic to make sure that libbe's dependencies are
specified well enough, and it becomes clear what needs done to make a
non-cddl/ build work. This is an interesting prospect, because the build
split is kind of annoying to work with.

IGNORE_PRAGMA is added to avoid dropping WARNS by one more. This was
previously pulled in via cddl/Makefile.inc.
ib/Makefile
ib/libbe/Makefile
b51bdff298a332516091e323fc3d86b7a8102536 18-Aug-2018 kevans <kevans@FreeBSD.org> libbe(3): Remove -v from LDFLAGS

-v is clearly not needed for linking, and it adds extra verbose information
that is not necessary.
ib/libbe/Makefile
ff236ed6d24ac374e4ef9b06826585e8dba51600 16-Aug-2018 markj <markj@FreeBSD.org> Add partial documentation for dtrace(1)'s -x configuration options.

Some options are still missing descriptions, but they can be filled in
over time.

Submitted by: raichoo <raichoo@googlemail.com>
Reviewed by: 0mp (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16671
ontrib/opensolaris/cmd/dtrace/dtrace.1
52250e9d43ca3389fe9e0f616376f4de2258f7fd 15-Aug-2018 will <will@FreeBSD.org> zfs: add ztest to the kyua test suite.

This program is currently failing, and has been for >6 months on HEAD.
Ideally, this should be run 24x7 in CI, to discover hard-to-find bugs that
only manifest with concurrent i/o.

Requested by: lwhsu, mmacy
sr.bin/ztest/Makefile
sr.bin/ztest/tests/Makefile
sr.bin/ztest/tests/ztest.sh
cedc27ad11c98c0156686f842543ff4cb3b1e150 13-Aug-2018 kevans <kevans@FreeBSD.org> libbe(3)/bectl(8): Remove now-redundant include paths

These were previously necessary because the libnvpair and libzfs_core
includes were not installed into the SYSROOT, being a part of the copies
target in include/Makefile rather than being installed with the library.

This was fixed in r337696 and the headers are now installed properly, so we
may let go of the cruft.
ib/libbe/Makefile
efa24221cfad0d33bb4ec576070519510c845748 13-Aug-2018 kevans <kevans@FreeBSD.org> Use INCS for non-sys/ libnvpair and libzfs_core includes

While nothing was wrong with libnvpair.h, libzfs_core.h was only guarded by
MK_CDDL rather than MK_CDDL && MK_ZFS. Rather than ugl'if'ying
include/Makefile to impose the extra restriction, just move the non-sys/
includes into INCS with the respect lib builds.

This has the added bonus of allowing third party packagers to try and split
these libs out of the FreeBSD-runtime package, if they are so inclined.

The sys/ include was left alone- generally userland libraries shouldn't
install kernel headers.

MFC after: 1 week
ib/libnvpair/Makefile
ib/libzfs_core/Makefile
46cdbe4a7a57c13eb35e99a5abea862ef346524f 12-Aug-2018 mmacy <mmacy@FreeBSD.org> MFV/ZoL: Implement large_dnode pool feature

commit 50c957f702ea6d08a634e42f73e8a49931dd8055
Author: Ned Bass <bass6@llnl.gov>
Date: Wed Mar 16 18:25:34 2016 -0700

Implement large_dnode pool feature

Justification
-------------

This feature adds support for variable length dnodes. Our motivation is
to eliminate the overhead associated with using spill blocks. Spill
blocks are used to store system attribute data (i.e. file metadata) that
does not fit in the dnode's bonus buffer. By allowing a larger bonus
buffer area the use of a spill block can be avoided. Spill blocks
potentially incur an additional read I/O for every dnode in a dnode
block. As a worst case example, reading 32 dnodes from a 16k dnode block
and all of the spill blocks could issue 33 separate reads. Now suppose
those dnodes have size 1024 and therefore don't need spill blocks. Then
the worst case number of blocks read is reduced to from 33 to two--one
per dnode block. In practice spill blocks may tend to be co-located on
disk with the dnode blocks so the reduction in I/O would not be this
drastic. In a badly fragmented pool, however, the improvement could be
significant.

ZFS-on-Linux systems that make heavy use of extended attributes would
benefit from this feature. In particular, ZFS-on-Linux supports the
xattr=sa dataset property which allows file extended attribute data
to be stored in the dnode bonus buffer as an alternative to the
traditional directory-based format. Workloads such as SELinux and the
Lustre distributed filesystem often store enough xattr data to force
spill bocks when xattr=sa is in effect. Large dnodes may therefore
provide a performance benefit to such systems.

Other use cases that may benefit from this feature include files with
large ACLs and symbolic links with long target names. Furthermore,
this feature may be desirable on other platforms in case future
applications or features are developed that could make use of a
larger bonus buffer area.

Implementation
--------------

The size of a dnode may be a multiple of 512 bytes up to the size of
a dnode block (currently 16384 bytes). A dn_extra_slots field was
added to the current on-disk dnode_phys_t structure to describe the
size of the physical dnode on disk. The 8 bits for this field were
taken from the zero filled dn_pad2 field. The field represents how
many "extra" dnode_phys_t slots a dnode consumes in its dnode block.
This convention results in a value of 0 for 512 byte dnodes which
preserves on-disk format compatibility with older software.

Similarly, the in-memory dnode_t structure has a new dn_num_slots field
to represent the total number of dnode_phys_t slots consumed on disk.
Thus dn->dn_num_slots is 1 greater than the corresponding
dnp->dn_extra_slots. This difference in convention was adopted
because, unlike on-disk structures, backward compatibility is not a
concern for in-memory objects, so we used a more natural way to
represent size for a dnode_t.

The default size for newly created dnodes is determined by the value of
a new "dnodesize" dataset property. By default the property is set to
"legacy" which is compatible with older software. Setting the property
to "auto" will allow the filesystem to choose the most suitable dnode
size. Currently this just sets the default dnode size to 1k, but future
code improvements could dynamically choose a size based on observed
workload patterns. Dnodes of varying sizes can coexist within the same
dataset and even within the same dnode block. For example, to enable
automatically-sized dnodes, run

# zfs set dnodesize=auto tank/fish

The user can also specify literal values for the dnodesize property.
These are currently limited to powers of two from 1k to 16k. The
power-of-2 limitation is only for simplicity of the user interface.
Internally the implementation can handle any multiple of 512 up to 16k,
and consumers of the DMU API can specify any legal dnode value.

The size of a new dnode is determined at object allocation time and
stored as a new field in the znode in-memory structure. New DMU
interfaces are added to allow the consumer to specify the dnode size
that a newly allocated object should use. Existing interfaces are
unchanged to avoid having to update every call site and to preserve
compatibility with external consumers such as Lustre. The new
interfaces names are given below. The versions of these functions that
don't take a dnodesize parameter now just call the _dnsize() versions
with a dnodesize of 0, which means use the legacy dnode size.

New DMU interfaces:
dmu_object_alloc_dnsize()
dmu_object_claim_dnsize()
dmu_object_reclaim_dnsize()

New ZAP interfaces:
zap_create_dnsize()
zap_create_norm_dnsize()
zap_create_flags_dnsize()
zap_create_claim_norm_dnsize()
zap_create_link_dnsize()

The constant DN_MAX_BONUSLEN is renamed to DN_OLD_MAX_BONUSLEN. The
spa_maxdnodesize() function should be used to determine the maximum
bonus length for a pool.

These are a few noteworthy changes to key functions:

* The prototype for dnode_hold_impl() now takes a "slots" parameter.
When the DNODE_MUST_BE_FREE flag is set, this parameter is used to
ensure the hole at the specified object offset is large enough to
hold the dnode being created. The slots parameter is also used
to ensure a dnode does not span multiple dnode blocks. In both of
these cases, if a failure occurs, ENOSPC is returned. Keep in mind,
these failure cases are only possible when using DNODE_MUST_BE_FREE.

If the DNODE_MUST_BE_ALLOCATED flag is set, "slots" must be 0.
dnode_hold_impl() will check if the requested dnode is already
consumed as an extra dnode slot by an large dnode, in which case
it returns ENOENT.

* The function dmu_object_alloc() advances to the next dnode block
if dnode_hold_impl() returns an error for a requested object.
This is because the beginning of the next dnode block is the only
location it can safely assume to either be a hole or a valid
starting point for a dnode.

* dnode_next_offset_level() and other functions that iterate
through dnode blocks may no longer use a simple array indexing
scheme. These now use the current dnode's dn_num_slots field to
advance to the next dnode in the block. This is to ensure we
properly skip the current dnode's bonus area and don't interpret it
as a valid dnode.

zdb
---
The zdb command was updated to display a dnode's size under the
"dnsize" column when the object is dumped.

For ZIL create log records, zdb will now display the slot count for
the object.

ztest
-----
Ztest chooses a random dnodesize for every newly created object. The
random distribution is more heavily weighted toward small dnodes to
better simulate real-world datasets.

Unused bonus buffer space is filled with non-zero values computed from
the object number, dataset id, offset, and generation number. This
helps ensure that the dnode traversal code properly skips the interior
regions of large dnodes, and that these interior regions are not
overwritten by data belonging to other dnodes. A new test visits each
object in a dataset. It verifies that the actual dnode size matches what
was stored in the ztest block tag when it was created. It also verifies
that the unused bonus buffer space is filled with the expected data
patterns.

ZFS Test Suite
--------------
Added six new large dnode-specific tests, and integrated the dnodesize
property into existing tests for zfs allow and send/recv.

Send/Receive
------------
ZFS send streams for datasets containing large dnodes cannot be received
on pools that don't support the large_dnode feature. A send stream with
large dnodes sets a DMU_BACKUP_FEATURE_LARGE_DNODE flag which will be
unrecognized by an incompatible receiving pool so that the zfs receive
will fail gracefully.

While not implemented here, it may be possible to generate a
backward-compatible send stream from a dataset containing large
dnodes. The implementation may be tricky, however, because the send
object record for a large dnode would need to be resized to a 512
byte dnode, possibly kicking in a spill block in the process. This
means we would need to construct a new SA layout and possibly
register it in the SA layout object. The SA layout is normally just
sent as an ordinary object record. But if we are constructing new
layouts while generating the send stream we'd have to build the SA
layout object dynamically and send it at the end of the stream.

For sending and receiving between pools that do support large dnodes,
the drr_object send record type is extended with a new field to store
the dnode slot count. This field was repurposed from unused padding
in the structure.

ZIL Replay
----------
The dnode slot count is stored in the uppermost 8 bits of the lr_foid
field. The bits were unused as the object id is currently capped at
48 bits.

Resizing Dnodes
---------------
It should be possible to resize a dnode when it is dirtied if the
current dnodesize dataset property differs from the dnode's size, but
this functionality is not currently implemented. Clearly a dnode can
only grow if there are sufficient contiguous unused slots in the
dnode block, but it should always be possible to shrink a dnode.
Growing dnodes may be useful to reduce fragmentation in a pool with
many spill blocks in use. Shrinking dnodes may be useful to allow
sending a dataset to a pool that doesn't support the large_dnode
feature.

Feature Reference Counting
--------------------------
The reference count for the large_dnode pool feature tracks the
number of datasets that have ever contained a dnode of size larger
than 512 bytes. The first time a large dnode is created in a dataset
the dataset is converted to an extensible dataset. This is a one-way
operation and the only way to decrement the feature count is to
destroy the dataset, even if the dataset no longer contains any large
dnodes. The complexity of reference counting on a per-dnode basis was
too high, so we chose to track it on a per-dataset basis similarly to
the large_block feature.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3542
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/zdb/zdb_il.c
ontrib/opensolaris/cmd/ztest/ztest.c
sr.bin/ztest/Makefile
c506761767c5ca9783850d1b9a206a76cfa09f55 11-Aug-2018 kevans <kevans@FreeBSD.org> Merge libbe(3)/bectl(8) from projects/bectl into head

bectl(8) is an administrative interface for working with ZFS boot
environments, intended to provide a superset of the functionality provided
by sysutils/beadm.

libbe(3) is the back-end library that the required functionality has been
pulled out into for later reuse.

These were originally written for GSoC 2017 under the mentorship of
allanjude@.

bectl(8) has proven pretty stable in my testing, with the known bug
documented in the man page.

Relnotes: yes
511c25b220b5939431fe82b488d370887fd592d3 11-Aug-2018 kevans <kevans@FreeBSD.org> libbe(3)/bectl(8): More SYSROOT/GCC build fixes

- Missing include path
- Fully specify libzfs's dependencies (except for deps pulled in by other
deps) in Makefile.inc1
- Drop WARNS back down to 2 for libbe(3). I do this with much hesitation,
but the libzfs headers are apparently a hot warning-filled mess as far as
GCC 4.2 is concerned.
ib/libbe/Makefile
66f3a7f644c37399e315cdd8827ea1f1eb3eb9c6 11-Aug-2018 netchild <netchild@FreeBSD.org> Extend the info about the limitations of datasets in jails.

Reviewed by: allanjude
Sponsored by: Essen Hackathon
ontrib/opensolaris/cmd/zfs/zfs.8
db6353bafbb5951e5f3dde499b2c22d835c5c792 11-Aug-2018 brd <brd@FreeBSD.org> Fix the build by just installing systop since testing shows it works with:

dwatch -X systop

Reviewed by: kp
Approved by: allanjude (mentor)
sr.sbin/dwatch/libexec/Makefile
a22d299259b8f317ca2806cfe7c61afc4b7d819b 11-Aug-2018 dteske <dteske@FreeBSD.org> dwatch(1): Add systop profile

Provides a top-like view of syscall consumers.

MFC after: 3 days
X-MFC-to: stable/11
Sponsored by: Smule, Inc.
sr.sbin/dwatch/libexec/Makefile
sr.sbin/dwatch/libexec/systop
17c4940b005ef40ed9eaae2dcd2f55f759511876 11-Aug-2018 dteske <dteske@FreeBSD.org> dwatch(1): Fix syntax error in vop_readdir profile

Reported by: Arne Ehrlich <ehrlich@consider-it.de>
MFC after: 3 days
X-MFC-to: stable/11
Sponsored by: Smule, Inc.
sr.sbin/dwatch/libexec/vop_readdir
f25fa3bdae3023934a9f1169db810622e94ecc38 11-Aug-2018 kevans <kevans@FreeBSD.org> MFH @ r337607, in preparation for boarding
5f5aba17a1c34d7388dcf9785419b67e89036a55 10-Aug-2018 markj <markj@FreeBSD.org> Disable the D subroutines msgsize() and msgdsize().

They are specific to illumos and the corresponding DIF subroutines are
already disabled on FreeBSD.

Reported by: gnn
ontrib/opensolaris/lib/libdtrace/common/dt_open.c
5160573320065c83f812de8a62a0379272e70e37 10-Aug-2018 mmacy <mmacy@FreeBSD.org> Performance optimization of AVL tree comparator functions

MFV:
commit ee36c709c3d5f7040e1bd11f5c75318aa03e789f
Author: Gvozden Neskovic <neskovic@gmail.com>
Date: Sat Aug 27 20:12:53 2016 +0200

perf: 2.75x faster ddt_entry_compare()
First 256bits of ddt_key_t is a block checksum, which are expected
to be close to random data. Hence, on average, comparison only needs to
look at first few bytes of the keys. To reduce number of conditional
jump instructions, the result is computed as: sign(memcmp(k1, k2)).

Sign of an integer 'a' can be obtained as: `(0 < a) - (a < 0)` := {-1, 0, 1} ,
which is computed efficiently. Synthetic performance evaluation of
original and new algorithm over 1G random keys on 2.6GHz Intel(R) Xeon(R)
CPU E5-2660 v3:

old 6.85789 s
new 2.49089 s

perf: 2.8x faster vdev_queue_offset_compare() and vdev_queue_timestamp_compare()
Compute the result directly instead of using conditionals

perf: zfs_range_compare()
Speedup between 1.1x - 2.5x, depending on compiler version and
optimization level.

perf: spa_error_entry_compare()
`bcmp()` is not suitable for comparator use. Use `memcmp()` instead.

perf: 2.8x faster metaslab_compare() and metaslab_rangesize_compare()
perf: 2.8x faster zil_bp_compare()
perf: 2.8x faster mze_compare()
perf: faster dbuf_compare()
perf: faster compares in spa_misc
perf: 2.8x faster layout_hash_compare()
perf: 2.8x faster space_reftree_compare()
perf: libzfs: faster avl tree comparators
perf: guid_compare()
perf: dsl_deadlist_compare()
perf: perm_set_compare()
perf: 2x faster range_tree_seg_compare()
perf: faster unique_compare()
perf: faster vdev_cache _compare()
perf: faster vdev_uberblock_compare()
perf: faster fuid _compare()
perf: faster zfs_znode_hold_compare()

Signed-off-by: Gvozden Neskovic <neskovic@gmail.com>
Signed-off-by: Richard Elling <richard.elling@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #5033
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_iter.c
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
ontrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
a68b7794d2a2a35fbd22a5a59f6999ae63250d2e 03-Aug-2018 mav <mav@FreeBSD.org> MFV r337223:
9580 Add a hash-table on top of nvlist to speed-up operations

illumos/illumos-gate@2ec7644aab2a726a64681fa66c6db8731b160de1

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>
ontrib/opensolaris/lib/libnvpair/nvpair_json.c
067c6a290ba51cf223b10ff853936295f66af6fc 03-Aug-2018 mav <mav@FreeBSD.org> MFV 337214:
9621 Make createtxg and guid properties public

illumos/illumos-gate@e8d4a73c868afb740396041be80ed2b141065e76

Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Josh Paetzel <josh@tcbug.org>
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
cbbbde795eef14dfcb686020c31d28474a3d6929 02-Aug-2018 mav <mav@FreeBSD.org> MFV r337184: 9457 libzfs_import.c:add_config() has a memory leak

A memory leak occurs on lines 209 and 213 because the config is not freed
in the error case. The interface to add_config() seems less than ideal -
it would be better if it copied any data necessary from the config and the
caller freed it.

illumos/illumos-gate@ddfe901b12348d31c500fb57f9174e88860a4061

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: sara hartse <sara.hartse@delphix.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
84ffe825151a3926e70e48bb426508e9b77f24b9 02-Aug-2018 mav <mav@FreeBSD.org> MFV r337182: 9330 stack overflow when creating a deeply nested dataset

Datasets that are deeply nested (~100 levels) are impractical. We just put
a limit of 50 levels to newly created datasets. Existing datasets should
work without a problem.

illumos/illumos-gate@5ac95da7d61660aa299c287a39277cb0372be959

Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
c4135f03a8b2390a82983cf017699540b6a5e14a 02-Aug-2018 mav <mav@FreeBSD.org> 9523 Large alloc in zdb can cause trouble

16MB alloc in zdb_embedded_block() can cause cores in certain situations
(clang, gcc55).

OsX commit: https://github.com/openzfsonosx/zfs/commit/ced236a5da6e72ea7bf6d2919fe14e17cffe10f1
FreeBSD commit: https://svnweb.freebsd.org/base?view=revision&revision=326150
illumos/illumos-gate@03a4c2f4bfaca30115963b76445279b36468a614

Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Jorgen Lundman <lundman@lundman.net>

This is an update for r326150 (by avg), where this change comes from.
ontrib/opensolaris/cmd/zdb/zdb.c
00d7ff8b71cce75ef0c25e0cf8cbc3cf2cdf722c 02-Aug-2018 mav <mav@FreeBSD.org> MFV r337161: 9512 zfs remap poolname@snapname coredumps

Only filesystems and volumes are valid "zfs remap" parameters: when passed
a snapshot name zfs_remap_indirects() does not handle the EINVAL returned
from libzfs_core, which results in failing an assertion and consequently
crashing.

illumos/illumos-gate@0b2e8253986c5c761129b58cfdac46d204903de1

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Wren Kennedy <john.kennedy@delphix.com>
Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Approved by: Matt Ahrens <mahrens@delphix.com>
Author: loli10K <ezomori.nozomu@gmail.com>
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
1105449467966c89fe6f2168521829caefcf595a 02-Aug-2018 mav <mav@FreeBSD.org> Do not blindly include illumos kernel headers instead of user-space.
It is not needed now, and I doubt it much helped at all, creating more
confusions then good.
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ib/libzfs/Makefile
ib/libzfs_core/Makefile
ib/libzpool/Makefile
bin/zfs/Makefile
bin/zpool/Makefile
sr.bin/zinject/Makefile
sr.bin/zstreamdump/Makefile
sr.bin/ztest/Makefile
sr.sbin/zdb/Makefile
sr.sbin/zfsd/Makefile.common
sr.sbin/zhack/Makefile
ef0cebe7e1319abfe840cc789932f5cc0c54d175 01-Aug-2018 mav <mav@FreeBSD.org> MFV r316926:
7955 libshare needs to initialize only those datasets being modified by the consumer

illumos/illumos-gate@8a981c3356b194b3b5c0ae9276a9cc31cd2f93a3
https://github.com/illumos/illumos-gate/commit/8a981c3356b194b3b5c0ae9276a9cc31cd2f93a3

https://www.illumos.org/issues/7955
Libshare currently initializes all available filesystems when doing any
libshare operation. This requires iterating through all the filesystem
multiple times, which is a huge performance problem for sharing and
unsharing operations.

Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Author: Daniel Hoffman <dj.hoffman@delphix.com>

For FreeBSD this is practically a NOP, just a diff reduction.
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_changelist.c
ontrib/opensolaris/lib/libzfs/common/libzfs_impl.h
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
17f71a271f5fcc83b06709b26afd351a9ea9c06f 31-Jul-2018 tuexen <tuexen@FreeBSD.org> Add a dtrace provider for UDP-Lite.

The dtrace provider for UDP-Lite is modeled after the UDP provider.
This fixes the bug that UDP-Lite packets were triggering the UDP
provider.
Thanks to dteske@ for providing the dwatch module.

Reviewed by: dteske@, markj@, rrs@
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16377
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudplite.ksh.out
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudplite.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudplite.ksh.out
ib/libdtrace/Makefile
ib/libdtrace/ip.d
ib/libdtrace/udplite.d
sr.sbin/dtrace/tests/common/ip/Makefile
sr.sbin/dtrace/tests/tools/exclude.sh
sr.sbin/dwatch/libexec/Makefile
sr.sbin/dwatch/libexec/udplite
3d8e119409ee654d93639e7beee55fb268cab110 31-Jul-2018 mav <mav@FreeBSD.org> MFV r337014:
9421 zdb should detect and print out the number of "leaked" objects
9422 zfs diff and zdb should explicitly mark objects that are on the deleted queue

illumos/illumos-gate@20b5dafb425396adaebd0267d29e1026fc4dc413

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Matt Ahrens <mahrens@delphix.com>
Author: Paul Dagnelie <pcd@delphix.com>
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/lib/libzfs/common/libzfs_diff.c
7bffd764fe6a13954a274c41690d64e25ea7db2f 31-Jul-2018 mav <mav@FreeBSD.org> MFV r336991, r337001:
9102 zfs should be able to initialize storage devices

The first access to a disk block can incur a performance penalty on some
platforms (e.g. AWS's EBS, VMware VMDKs). Therefore it is recommended that
volumes be "thick provisioned", where supported by the platform (VMware).
Thick provisioning is time consuming and often is ignored. If the thick
provision step is omitted, customers will see suboptimal performance until
we have written to all parts of the LUN. ZFS should be able to initialize
any unused storage to remove any first-write penalty that exists.

illumos/illumos-gate@094e47e980b0796b94b1b8f51f462a64d246e516

Reviewed by: John Wren Kennedy <john.kennedy@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: George Wilson <george.wilson@delphix.com>
5947e79ef458215d30f5164ce459269532b2f525 31-Jul-2018 mav <mav@FreeBSD.org> MFV r336955: 9236 nuke spa_dbgmsg

We should use zfs_dbgmsg instead of spa_dbgmsg. Or at least,
metaslab_condense() should call zfs_dbgmsg because it's important and rare
enough to always log. It's possible that the message in zio_dva_allocate()
would be too high-frequency for zfs_dbgmsg.

illumos/illumos-gate@21f7c81cc1156e9202ce3412d3ecaa697c3b2222

Reviewed by: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Matthew Ahrens <mahrens@delphix.com>
ontrib/opensolaris/cmd/ztest/ztest.c
5c26614dcc47527b2439faaf739ca72936771787 31-Jul-2018 mav <mav@FreeBSD.org> MFV r336950: 9290 device removal reduces redundancy of mirrors

Mirrors are supposed to provide redundancy in the face of whole-disk failure
and silent damage (e.g. some data on disk is not right, but ZFS hasn't
detected the whole device as being broken). However, the current device
removal implementation bypasses some of the mirror's redundancy.

illumos/illumos-gate@3a4b1be953ee5601bab748afa07c26ed4996cde6

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed by: Sara Hartse <sara.hartse@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Tim Chase <tim@chase2k.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Matthew Ahrens <mahrens@delphix.com>
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/ztest/ztest.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
8e1f6ca37d3d224545f64f25ebf4ca6f28c9541b 30-Jul-2018 mav <mav@FreeBSD.org> MFV r336946: 9238 ZFS Spacemap Encoding V2

The current space map encoding has the following disadvantages:
[1] Assuming 512 sector size each entry can represent at most 16MB for a segment.
This makes the encoding very inefficient for large regions of space.
[2] As vdev-wide space maps have started to be used by new features (i.e.
device removal, zpool checkpoint) we've started imposing limits in the
vdevs that can be used with them based on the maximum addressable offset
(currently 64PB for a top-level vdev).

The new remains backwards compatible with the old one. The introduced
two-word entry format, besides extending the limits imposed by the single-entry
layout, also includes a vdev field and some extra padding after its prefix.

The extra padding after the prefix should is reserved for future usage (e.g.
new prefixes for future encodings or new fields for flags). The new vdev field
not only makes the space maps more self-descriptive, but also opens the doors
for pool-wide space maps.

One final important note is that the number of bits used for vdevs is reduced
to 24 bits for blkptrs. That was decided as we don't know of any setups that
use more than 16M vdevs for the time being and
we wanted to fit the vdev field in the space map. In addition that gives us
some extra bits in dva_t.

illumos/illumos-gate@17f11284b49b98353b5119463254074fd9bc0a28

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <gwilson@zfsmail.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/zpool/zpool-features.7
ontrib/opensolaris/cmd/ztest/ztest.c
184cebbed99a0025594b410876510fc4064c6b0b 30-Jul-2018 mav <mav@FreeBSD.org> MFV r336944: 9286 want refreservation=auto

When a ZFS volume is created with zfs create -V (but without -s), the
refreservation property is set to a value that is volsize plus the maximum
size of metadata. If refreservation is ever set to another value, it is
impossible to set it back to the automatically determined value. There are
other cases where refreservation may be wrong. These include receiving a
volume that was sent without properties and zfs clone.

We need:

zfs set refreservation=auto <volume>
zfs clone -o refreservation=auto <volume>

Each one would use the same function used by zfs create -V to determine the
proper value for refreservation.

illumos/illumos-gate@1c10ae76c0cb31326c320e7cef1d3f24a1f47125

Reviewed by: Allan Jude <allanjude@freebsd.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Mike Gerdts <mike.gerdts@joyent.com>
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_util.c
fa415c9fee9cee2af67a40e6d4fc30e4123aa7e5 25-Jul-2018 kevans <kevans@FreeBSD.org> libbe(3)/be(8): Drop WARNS overrides, fix all fallout

Based on the idea that we shouldn't have all-new library and utility going
into base that need WARNS=1...

- Decent amount of constification
- Lots of parentheses
- Minor other nits
ib/libbe/Makefile
7eb6345eb748df22d590194e0c888f0f45429e9d 24-Jul-2018 kevans <kevans@FreeBSD.org> Normalize bectl(8)/libbe(3) Makefiles, remove Makefile copyright/license

Approved by: hselaskey
ib/libbe/Makefile
9de5d85de7510f01a3d0654355fa6495a3d51477 24-Jul-2018 kevans <kevans@FreeBSD.org> libbe(3): Add to cddl build, adjust src.libnames.mk as needed
ib/Makefile
ib/libbe/Makefile
63e5ba75f010728fad8a21f876fad579b2409bb6 22-Jul-2018 tuexen <tuexen@FreeBSD.org> Improve TCP related tests for dtrace.

Ensure that the TCP connections are terminated gracefully as expected
by the test. Use appropriate numbers for sent/received packets.
In addition, enable tst.localtcpstate.ksh, which should pass, but
doesn't until https://reviews.freebsd.org/D16369 is committed.

Reviewed by: markj@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16288
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh
sr.sbin/dtrace/tests/tools/exclude.sh
7f7ead542628894bb4900796aca8a7f01f85353c 20-Jul-2018 tuexen <tuexen@FreeBSD.org> Test that the dtrace UDP receive probe fires.

This test ensures that the fix committed in
https://svnweb.freebsd.org/changeset/base/336551
actually works.

Reviewed by: dteske@, markj@, rrs@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16046
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh.out
6d1b2c040a1f6968f692bf3954833467d7bdcc89 15-Jul-2018 tuexen <tuexen@FreeBSD.org> Adjust comment to reality since r286171.

Sponsored by: Netflix, Inc.
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
65ce1616e4180a4eaa79a5eda06fa2bf17f9f03a 15-Jul-2018 tuexen <tuexen@FreeBSD.org> Don't require a local sshd for the local TCP state dtrace test

This change is similar to the one done in r286171 for
tst.ipv4localtcp.ksh. This not only reduces the requirements on the
system used for testing but results also in a graceful teardown of
the TCP connection.

Reviewed by: gnn@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16276
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
a3536ba64f8305ea78b5f5a3eb590c6e65f82cc6 15-Jul-2018 tuexen <tuexen@FreeBSD.org> Fix the UDP tests for dtrace.

The code imported from opensolaris was depending on ping supporting
UDP for sending probes. Since this is not supported by ping on FreeBSD
use a perl script instead.
The remote test requires the usage of ksh93, so state that in the
sheband.
Enable the local test, but keep the remote test disabled, since it
requires a remote machine on the LAN.

Reviewed by: markj@, gnn@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16268
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh
sr.sbin/dtrace/tests/tools/exclude.sh
27af8ac16da781b57a90c9197a30eb523bf29178 14-Jul-2018 tuexen <tuexen@FreeBSD.org> Return the intended return code.

This bug was spotted by markj@ in D16268 because I copied this code part
and used it there. So fix it.

Sponsored by: Netflix, Inc.
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh
57c267a917a8afecc9290794897fed7113c82db7 14-Jul-2018 tuexen <tuexen@FreeBSD.org> Fix shebangs and execute bit of test scripts.

Since we don't have /usr/bin/ksh, use a generic way of specifying
ksh. Some of the tests only run with ksh93, so use this shell
for these tests. Two of the tests don't have the execute bit set,
so fix this, too.

Reviewed by: markj@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16270
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh
f1fcca256b00f2b615e992a9f6ab78bc7a3ff630 14-Jul-2018 tuexen <tuexen@FreeBSD.org> Add support for TCP state names used by Solaris.

For compatibility, add the TCP state names used by Solaris
and given in the Dtrace Guide available at
https://docs.oracle.com/cd/E37838_01/html/E61035/glhgu.html#OSDTGglhmv

Reviewed by: markj@
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D16269
ib/libdtrace/tcp.d
dde826b6f5d3f4a7daa326455dd890805fdd5a46 18-Jun-2018 tuexen <tuexen@FreeBSD.org> The IP, TCP, and UDP provider report IP addresses as strings.
In some cases, the required information is not available and the
UDP provider reported an empty string in this case and the IP
and TCP provider reported a NULL pointer.

This patch changes the value provided in this case to the string
"<unknown>". This make the behaviour consistent and in-line with
the behaviour of Solaris.

Reviewed by: markj@, dteske@, gnn@
Differential Revision: https://reviews.freebsd.org/D15855
ib/libdtrace/ip.d
ib/libdtrace/tcp.d
ib/libdtrace/udp.d
d2d06f0dbc72c51d64e50cf3676dd7d425824f5a 15-Jun-2018 vangyzen <vangyzen@FreeBSD.org> Fix markup in zfs(8); no content change

Sponsored by: Dell EMC
ontrib/opensolaris/cmd/zfs/zfs.8
d4bb51d913f5f4b77d1e0edf5c9fed66a6dff652 11-Jun-2018 markj <markj@FreeBSD.org> Process CUs with a language attribute of DW_LANG_Mips_Assembler.

At the moment ctfconvert(1) does not do much with such CUs, but
that may not be true in the future, and we run ctfconvert on several
assembly files during the build.

X-MFC with: r334883
ontrib/opensolaris/tools/ctf/cvt/dwarf.c
2d52ea0b9e8e76be3059cd755f0c781685cbc5b5 09-Jun-2018 markj <markj@FreeBSD.org> Don't process DWARF generated from non-C/C++ code.

ctfconvert(1) is not designed to handle DWARF generated from such code,
and will generally fail in non-obvious ways. Use an explicit check to
help catch such potential failures.

Reported by: Johannes Lundberg <johalun0@gmail.com>
MFC after: 2 weeks
ontrib/opensolaris/tools/ctf/cvt/dwarf.c
a73aecd5f1b3afb968ba2977945b1a62d47d0353 08-Jun-2018 sef <sef@FreeBSD.org> This originated from ZFS On Linux, as
https://github.com/zfsonlinux/zfs/commit/d4a72f23863382bdf6d0ae33196f5b5decbc48fd

During scans (scrubs or resilvers), it sorts the blocks in each transaction
group by block offset; the result can be a significant improvement. (On my
test system just now, which I put some effort to introduce fragmentation into
the pool since I set it up yesterday, a scrub went from 1h2m to 33.5m with the
changes.) I've seen similar rations on production systems.

Approved by: Alexander Motin
Obtained from: ZFS On Linux
Relnotes: Yes (improved scrub performance, with tunables)
Differential Revision: https://reviews.freebsd.org/D15562
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/cmd/ztest/ztest.c
ontrib/opensolaris/lib/libzfs/common/libzfs_status.c
ontrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
ontrib/opensolaris/lib/libzpool/common/taskq.c
e11aace18445d03195f80d5c192d35f8575dab51 07-Jun-2018 sbruno <sbruno@FreeBSD.org> Unbreak dtrace runtime for udp after svn r334719 SO_REUSEPORT commit.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Sponsored by: Limeligght Networks
ib/libdtrace/udp.d
d0aeaa5af7f77964d05bcb54e2f5cfdeb187edaf 06-Jun-2018 sbruno <sbruno@FreeBSD.org> Load balance sockets with new SO_REUSEPORT_LB option.

This patch adds a new socket option, SO_REUSEPORT_LB, which allow multiple
programs or threads to bind to the same port and incoming connections will be
load balanced using a hash function.

Most of the code was copied from a similar patch for DragonflyBSD.

However, in DragonflyBSD, load balancing is a global on/off setting and can not
be set per socket. This patch allows for simultaneous use of both the current
SO_REUSEPORT and the new SO_REUSEPORT_LB options on the same system.

Required changes to structures:
Globally change so_options from 16 to 32 bit value to allow for more options.
Add hashtable in pcbinfo to hold all SO_REUSEPORT_LB sockets.

Limitations:
As DragonflyBSD, a load balance group is limited to 256 pcbs (256 programs or
threads sharing the same socket).

This is a substantially different contribution as compared to its original
incarnation at svn r332894 and reverted at svn r332967. Thanks to rwatson@
for the substantive feedback that is included in this commit.

Submitted by: Johannes Lundberg <johalun0@gmail.com>
Obtained from: DragonflyBSD
Relnotes: Yes
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11003
ib/libdtrace/tcp.d
68429d0e006da20923f8331ea4fbf35dbefe2dcc 03-Jun-2018 dteske <dteske@FreeBSD.org> dwatch(1): Update manual to reference actual release

MFC after: 3 days
X-MFC-to: stable/11
Sponsored by: Smule, Inc.
sr.sbin/dwatch/dwatch.1
7ca8d178482cb0137a31fc0fda2e21a53b3ebd94 29-May-2018 dteske <dteske@FreeBSD.org> dwatch(1): Fix "-t test" for post-processing profiles

Profiles that perform post-processing of the DTrace output were
dropping the "-t test" option on the floor. Fix handling of this
option for said profiles.

X-MFC-to: stable/11
X-MFC-with: r334261-334262
Sponsored by: Smule, Inc.
sr.sbin/dwatch/dwatch
306e0791aa047a3f36b52f300c16bb820c4ab75a 27-May-2018 dteske <dteske@FreeBSD.org> dwatch(1): Eliminate ANSI dimming in developer mode

"Developer mode" (passing of "-dev" options), which enables debugging
features on compilation error, used to dim lines unrelated to error.

That proved distracting and feedback from testers also confirmed that
simply highlighting the line the compiler complains about is enough.

Sponsored by: Smule, Inc.
sr.sbin/dwatch/dwatch
cf7a366f1d358a0dd29dc4fe880c52a950f93efa 27-May-2018 dteske <dteske@FreeBSD.org> dwatch(1): Guard against error when given -t "*..."

dwatch allows you to customnize the predicate (condition) for when
information is displayed. The DTrace syntax for this is:

probe[, ...] /predicate/ { [actions] }

But if predicate is something like "*args[1]!=NULL" to test that
the first pointer in an array is non-NULL, the syntax produced is:

probe[, ...] /*arg1!=NULL/ { [actions] }

The issue being that "/*" is the beginning of a comment and thus
the following error is emitted:

dtrace: failed to compile script /dev/stdin:
line 535: /* encountered inside a comment

This patch adds whitespace around the argument given to -t,
producing:

probe[, ...] / *arg1!=NULL / { [actions] }

Sponsored by: Smule, Inc.
sr.sbin/dwatch/dwatch
3895dd38ecf4dc422d3e1656844a051e0aa5d06c 19-May-2018 mmacy <mmacy@FreeBSD.org> ctf dwarf: don't report "no dwarf entry" as if it were an error
ontrib/opensolaris/tools/ctf/cvt/dwarf.c
a9951bd0b7c33c24975421e488bc97f4eeeb6706 19-May-2018 mmacy <mmacy@FreeBSD.org> ctfconvert: silence useless enum has too many values warning
ontrib/opensolaris/tools/ctf/cvt/ctf.c
37741076812bc4dc2d474482d49f489be05bbd53 12-May-2018 dteske <dteske@FreeBSD.org> dwatch(1): Refactor sendrecv profile

The profile for send(2)/recv(2) observation has been refactored to
eliminate alloca() in favor of translations available in HEAD.

Sponsored by: Smule, Inc.
sr.sbin/dwatch/libexec/sendrecv
ddf4582992440cfeb3d41136c1c81aa4968d5df8 12-May-2018 dteske <dteske@FreeBSD.org> dwatch(1): Expose process for ip/tcp/udp

Knowing the value of execname during these probes is of some value even
if it is commonly the interrupt kernel thread (intr[12]) -- quite often
it is not, but that depends on the probe.

Sponsored by: Smule, Inc.
sr.sbin/dwatch/libexec/ip
sr.sbin/dwatch/libexec/tcp
sr.sbin/dwatch/libexec/udp
18fa609dff8a41b3f7b5a586bbdc3e8f74ca296e 12-May-2018 dteske <dteske@FreeBSD.org> dwatch(1): Allow `-E code' to override profile EVENT_DETAILS

This allows quick changes to the formatted output of a profile.

Sponsored by: Smule, Inc.
sr.sbin/dwatch/libexec/chmod
sr.sbin/dwatch/libexec/errno
sr.sbin/dwatch/libexec/io
sr.sbin/dwatch/libexec/ip
sr.sbin/dwatch/libexec/kill
sr.sbin/dwatch/libexec/nanosleep
sr.sbin/dwatch/libexec/open
sr.sbin/dwatch/libexec/proc
sr.sbin/dwatch/libexec/rw
sr.sbin/dwatch/libexec/sched
sr.sbin/dwatch/libexec/sendrecv
sr.sbin/dwatch/libexec/tcp
sr.sbin/dwatch/libexec/udp
sr.sbin/dwatch/libexec/vop_create
sr.sbin/dwatch/libexec/vop_readdir
sr.sbin/dwatch/libexec/vop_rename
sr.sbin/dwatch/libexec/vop_symlink
54142a87874922fe9507153107c54f1e746ae0e7 12-May-2018 dteske <dteske@FreeBSD.org> dwatch(1): Export ARGV to profiles loaded via load_profile()

A module that wishes to post-process the output needs to know which
arguments were passed in order to re-execute a child in a pipe-chain.
Further, the expansion of ARGV needs to be such that items are escaped
properly.

Sponsored by: Smule, Inc.
sr.sbin/dwatch/dwatch
88c834f5de59554769b83fd8d9252dbb9d3466d0 12-May-2018 dteske <dteske@FreeBSD.org> dwatch(1): Simplify info message test

The info() function already tests $QUIET

Sponsored by: Smule, Inc.
sr.sbin/dwatch/dwatch
6fd93270fd8f954b008fd1d987bcdcc11bba79b8 12-May-2018 dteske <dteske@FreeBSD.org> dwatch(1): Separate default values so `-[BK] num' don't affect usage

If you were to pass an invalid option after `-B num' or `-K num' you
would see that the usage statement would show the value you passed
instead of the actual default.

Moving the default values to separate variables that are unaffected
by the options-parsing allows the usage statement to correctly show
the hard-coded default values if no flags are used.

Sponsored by: Smule, Inc.
sr.sbin/dwatch/dwatch
96dfb0013905c6330238f34a43758d61b065c4fc 12-May-2018 dteske <dteske@FreeBSD.org> dwatch(1): Bugfix, usage displayed with `-1Q'

A return statement should have been an exit in list_profiles().
If the user passed `-Q' to list profiles and asked for one-line
per profile (`-1'), list_profiles() would not exit as should.

Sponsored by: Smule, Inc.
sr.sbin/dwatch/dwatch
379c699e5724e196ffaa58a791e20d531df4b9f0 06-May-2018 sbruno <sbruno@FreeBSD.org> Cleanup sundry clang warnings for code that is not upstream in illumos.
https://github.com/illumos/illumos-gate/edit/master/usr/src/lib/libzfs/common/libzfs_sendrecv.c

Patch our version of it to quiesce warnings until someone decides to sync
up our code:

libzfs_sendrecv.c:2555:30: warning: format specifies type 'unsigned long'
but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
sprintf(guidname, "%lu", thisguid);
~~~ ^~~~~~~~
%llu
libzfs_sendrecv.c:2612:29: warning: format specifies type 'unsigned long'
but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
sprintf(guidname, "%lu", parent_fromsnap_guid);
~~~ ^~~~~~~~~~~~~~~~~~~~
%llu
libzfs_sendrecv.c:2645:29: warning: format specifies type 'unsigned long'
but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
sprintf(guidname, "%lu", parent_fromsnap_guid);
~~~ ^~~~~~~~~~~~~~~~~~~~
%llu

Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D15325
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
9e686bddc4325298b379bbb6bedf2230f5daf288 28-Apr-2018 eadler <eadler@FreeBSD.org> zpool(8): correct list of default properties in 'list'.

The default provides output in the following form:
```
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP
HEALTH ALTROOT
```

this corrects the man page.

Also submitted upstream as
https://github.com/openzfs/openzfs/pull/632/files (with slightly
different changes needed)
ontrib/opensolaris/cmd/zpool/zpool.8
257e6e5563df4d5f0a939c72acdef3c49c440e38 24-Apr-2018 sbruno <sbruno@FreeBSD.org> Revert r332894 at the request of the submitter.

Submitted by: Johannes Lundberg <johalun0_gmail.com>
Sponsored by: Limelight Networks
ib/libdtrace/tcp.d
bbf7d4dd035a71710ac94fe1ada4d99244102159 23-Apr-2018 sbruno <sbruno@FreeBSD.org> Load balance sockets with new SO_REUSEPORT_LB option

This patch adds a new socket option, SO_REUSEPORT_LB, which allow multiple
programs or threads to bind to the same port and incoming connections will be
load balanced using a hash function.

Most of the code was copied from a similar patch for DragonflyBSD.

However, in DragonflyBSD, load balancing is a global on/off setting and can not
be set per socket. This patch allows for simultaneous use of both the current
SO_REUSEPORT and the new SO_REUSEPORT_LB options on the same system.

Required changes to structures
Globally change so_options from 16 to 32 bit value to allow for more options.
Add hashtable in pcbinfo to hold all SO_REUSEPORT_LB sockets.

Limitations
As DragonflyBSD, a load balance group is limited to 256 pcbs
(256 programs or threads sharing the same socket).

Submitted by: Johannes Lundberg <johanlun0@gmail.com>
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D11003
ib/libdtrace/tcp.d
cda3189166479f5f26caaab03c891c5d4c532027 22-Apr-2018 dteske <dteske@FreeBSD.org> dwatch(1): Remove the line used to demonstrate `-dev' option

In recently added sendrecv profile, there was a line purposefully
added to introduce a compilation error in which `-dev' is used to
debug the entry. Removing the entry.

Sponsored by: Smule, Inc.
sr.sbin/dwatch/libexec/sendrecv
e04cc206edfb0ab70ea1ebe53d6b0ee9b8d19b64 22-Apr-2018 dteske <dteske@FreeBSD.org> dwatch(1): Add profile for send(2)/recv(2) syscalls

Sponsored by: Smule, Inc.
sr.sbin/dwatch/libexec/Makefile
sr.sbin/dwatch/libexec/sendrecv
d1b25fc2f71f9220164f11245c381f853208fb3c 22-Apr-2018 dteske <dteske@FreeBSD.org> dwatch(1): Add `-dev' option to aid debugging of profiles

The options `-d' (debug), `-e' (exit after compile), and `-v' (verbose)
when combined in any order (though best remembered as `-dev') will run
the conflated script through dtrace(1), test for error conditions, and
show the line that dtrace(1) failed at (with context).

If no errors are found, the output is the same as `-e[v]'.

When writing a new profile for dwatch(1), you can quickly test to
make sure it compiles by running `dwatch -devX profile_name' where
profiles live in /usr/libexec/dwatch or /usr/local/libexec/dwatch
(the latter being where profiles installed via ports should go).

Sponsored by: Smule, Inc.
sr.sbin/dwatch/dwatch
178d19058058ae5b5f23aec5c16d43d132e6edd0 17-Apr-2018 mav <mav@FreeBSD.org> MFV man pages update from r329502: 7614 zfs device evacuation/removal.

MFC after: 3 days
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zpool/zpool-features.7
ontrib/opensolaris/cmd/zpool/zpool.8
f42a38887f9cf8de947b71e4419449cb76ccdf6f 12-Apr-2018 avg <avg@FreeBSD.org> allow ZFS pool to have temporary name for duration of current import

The change adds -t <name> option to zpool create and -t option to zpool
import in its form with an old name and a new name. This allows to
import (or create) a pool under a name that's different from its real,
permanent name without affecting that name. This is useful when working
with VM images or images of other physical systems if they happen to
have a ZFS pool with the same name as the host system.

The changes come from ZoL with some small tweaks.
The porting has been done by julian.

The change is being submitted to OpenZFS:
https://github.com/openzfs/openzfs/pull/600

Submitted by: julian
Reviewed by: smh
MFC after: 2 weeks
Sponsored by: Panzura (porting)
Differential Revision: https://reviews.freebsd.org/D14972
ontrib/opensolaris/cmd/zpool/zpool.8
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
d31db32426a5a6dd5e3a73b827b903e73c47838e 28-Mar-2018 mav <mav@FreeBSD.org> MFV r331712:
9280 Assertion failure while running removal_with_ganging test with 4K devices

illumos/illumos-gate@243952c7eeef020886e3e2e3df99a513df40584a

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Matt Ahrens <Matt.Ahrens@delphix.com>
ontrib/opensolaris/cmd/ztest/ztest.c
e6907ec1f002ac4180725276fb5fc37aae2dd3e9 28-Mar-2018 mav <mav@FreeBSD.org> MFV r331706:
9235 rename zpool_rewind_policy_t to zpool_load_policy_t

illumos/illumos-gate@5dafeea3ebd2dd77affc802bcb90f63faf01589f

We want to be able to pass various settings during import/open of a pool,
which are not only related to rewind. Instead of adding a new policy and
duplicate a bunch of code, we should just rename rewind_policy to a more
generic term like load_policy.

For instance, we'd like to set spa->spa_import_flags from the nvlist,
rather from a flags parameter passed to spa_import as in some cases we want
those flags not only for the import case, but also for the open case. One
such flag could be ZFS_IMPORT_MISSING_LOG (as used in zdb) which would
allow zfs to open a pool when logs are missing.

Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
b1ec8f2d01fd5f696ce4f11f8e2755935e979cc6 28-Mar-2018 mav <mav@FreeBSD.org> MFV r331695, 331700: 9166 zfs storage pool checkpoint

illumos/illumos-gate@8671400134a11c848244896ca51a7db4d0f69da4

The idea of Storage Pool Checkpoint (aka zpool checkpoint) deals with
exactly that. It can be thought of as a “pool-wide snapshot” (or a
variation of extreme rewind that doesn’t corrupt your data). It remembers
the entire state of the pool at the point that it was taken and the user
can revert back to it later or discard it. Its generic use case is an
administrator that is about to perform a set of destructive actions to ZFS
as part of a critical procedure. She takes a checkpoint of the pool before
performing the actions, then rewinds back to it if one of them fails or puts
the pool into an unexpected state. Otherwise, she discards it. With the
assumption that no one else is making modifications to ZFS, she basically
wraps all these actions into a “high-level transaction”.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
0014145f5edfe1e575b1cf53d69c99bf4912ca5f 28-Mar-2018 mav <mav@FreeBSD.org> Partial MFV r329753:
8809 libzpool should leverage work done in libfakekernel

illumos/illumos-gate@f06dce2c1f0f3af78581e7574f65bfba843ddb6e

Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Gordon Ross <gordon.w.ross@gmail.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Andrew Stormont <astormont@racktopsystems.com>

We do not have libfakekernel, but need to reduce code divergence.
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/ztest/ztest.c
fcfa748dccafc24d6a9aa7e5be2e2e5f5079ae41 27-Mar-2018 cem <cem@FreeBSD.org> ctfconvert: Fix minor memory leaks in STABS parser

In an error case, free leaked objects. Does anything use STABS anymore?
Probably not.

Reported by: Coverity
Sponsored by: Dell EMC Isilon
ontrib/opensolaris/tools/ctf/cvt/st_parse.c
aa712711dd8e1ea4091e88038777e8d41352b087 26-Mar-2018 cem <cem@FreeBSD.org> ctfconvert/ctfmerge: Fix a memory leak enumerating DWARF files

Reported by: Coverity
Sponsored by: Dell EMC Isilon
ontrib/opensolaris/tools/ctf/cvt/dwarf.c
0652607d59e9af603e65df03d0ab7de8e3e803ca 26-Mar-2018 cem <cem@FreeBSD.org> libctf: Don't construct pointers to out of bounds array offsets

Just attempting to do the pointer arithmetic is undefined behavior.

No functional change intended.

Reported by: Coverity
Sponsored by: Dell EMC Isilon
ontrib/opensolaris/common/ctf/ctf_lookup.c
30f30dfa12439145665b4f1c50d2b398a40f14ca 26-Mar-2018 cem <cem@FreeBSD.org> libctf: Appease Coverity overrun warnings

Rather than zeroing and reading into the a smaller union member the full
union size, just zero and read directly into the union.

No functional change intended.

Reported by: Coverity
Sponsored by: Dell EMC Isilon
ontrib/opensolaris/lib/libctf/common/ctf_lib.c
3b4d2dc7e3441a98d86fe8c71b2871f6f53028d1 23-Mar-2018 mav <mav@FreeBSD.org> MFV r331407: 9213 zfs: sytem typo

illumos/illumos-gate@edc8ef7d921c96b23969898aeb766cb24960bda7

Reviewed by: C Fraire <cfraire@me.com>
Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
Approved by: Joshua M. Clulow <josh@sysmgr.org>
Author: Toomas Soome <tsoome@me.com>
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/cmd/zpool/zpool_main.c
a2335dfaf9e084e84f75e36a7c7953922c497e06 23-Mar-2018 mav <mav@FreeBSD.org> MFV r331400: 8484 Implement aggregate sum and use for arc counters

In pursuit of improving performance on multi-core systems, we should
implements fanned out counters and use them to improve the performance of
some of the arc statistics. These stats are updated extremely frequently,
and can consume a significant amount of CPU time.

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>
3809903c0e8a2e5e76f184a385c5516d3f23633d 19-Mar-2018 markj <markj@FreeBSD.org> Given hidden visibility to symbols referenced by the DOF section.

MFC after: 1 week
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
836da61ad3f77e45cb4da80ad8fbcdf1db41bb42 18-Mar-2018 markj <markj@FreeBSD.org> Use __syscall(2) rather than syscall(2) in syscall/tst.args.c.

Some of mmap(2)'s arguments are 64 bits wide.

MFC after: 3 days
ontrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c
ef1175daa3681ebbec3e44a4b7366d1cb8685d13 16-Mar-2018 cem <cem@FreeBSD.org> libdtrace: Fix another uninitialized dtt_flags UB

Like r331073, eliminate a UB by fully initializing the struct with a designated
initializer. Note that the similar src_dtt is not fully used, so a similar
treatment was not absolutely required. I chose to leave it alone. It
wouldn't hurt to do the same thing, though.

Reported by: Coverity
Sponsored by: Dell EMC Isilon
ontrib/opensolaris/lib/libdtrace/common/dt_xlator.c
70e7a948b02f1a236a20582e80a590cead14b50b 16-Mar-2018 cem <cem@FreeBSD.org> libdtrace: Eliminate a minor UB by fully initializing parameter struct

The dtt_flags value is dereferenced by dt_type_pointer() and must be
initialized first.

Reported by: Coverity
Sponsored by: Dell EMC Isilon
ontrib/opensolaris/lib/libdtrace/common/dt_parser.c
aa0abff870651b5a42e9c57497d45a7ba574fe42 08-Mar-2018 dteske <dteske@FreeBSD.org> Fix display of wrong pid from dtrace_sched(4)

Fix a comment while here.

Sponsored by: Smule, Inc.
sr.sbin/dwatch/libexec/sched
fb40c7ae5fefffd06f3eb988a9b101630ed80ff0 06-Mar-2018 dteske <dteske@FreeBSD.org> Bump dwatch(1) internal version from 1.0-beta-91 to 1.0
sr.sbin/dwatch/dwatch
5a667fb11c3884edc097122e15e05ef161917772 06-Mar-2018 dteske <dteske@FreeBSD.org> Introduce dwatch(1) as a tool for making DTrace more useful

Reviewed by: markj, gnn, bdrewery (earlier version)
Relnotes: yes
Sponsored by: Smule, Inc.
Differential Revision: https://reviews.freebsd.org/D10006
sr.sbin/Makefile
sr.sbin/dwatch/Makefile
sr.sbin/dwatch/dwatch
sr.sbin/dwatch/dwatch.1
sr.sbin/dwatch/examples/Makefile
sr.sbin/dwatch/examples/profile_template
sr.sbin/dwatch/libexec/Makefile
sr.sbin/dwatch/libexec/chmod
sr.sbin/dwatch/libexec/errno
sr.sbin/dwatch/libexec/io
sr.sbin/dwatch/libexec/ip
sr.sbin/dwatch/libexec/kill
sr.sbin/dwatch/libexec/nanosleep
sr.sbin/dwatch/libexec/open
sr.sbin/dwatch/libexec/proc
sr.sbin/dwatch/libexec/rw
sr.sbin/dwatch/libexec/sched
sr.sbin/dwatch/libexec/tcp
sr.sbin/dwatch/libexec/udp
sr.sbin/dwatch/libexec/vop_create
sr.sbin/dwatch/libexec/vop_readdir
sr.sbin/dwatch/libexec/vop_rename
sr.sbin/dwatch/libexec/vop_symlink
045c331cc75f2b40fe5cd6a521bc55c08be761ee 02-Mar-2018 asomers <asomers@FreeBSD.org> ZFS: fix adding vdevs to very large pools

r323791 changed the return value of zpool_read_label. Error paths that
previously returned 0 began to return -1 instead. However, not all error
paths initialized errno. When adding vdevs to a very large pool, errno could
be prepopulated with ENOMEM, causing the operation to fail. Fix the bug by
setting errno=ENOENT in the case that no ZFS label is found.

PR: 226096
Submitted by: Nikita Kozlov
Reviewed by: avg
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D13088
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
20dcfaee39db2451f4d1df295e70a3117d2aa262 26-Feb-2018 dteske <dteske@FreeBSD.org> Consistent casing for fallback SIGCHLD (s/Unknown/unknown/)
ib/libdtrace/signal.d
9799315b43664f502ba4e79aabbf4207565ff2f9 25-Feb-2018 dteske <dteske@FreeBSD.org> Updates and enhancements to signal.d to aid DTrace scripting

+ Add missing signals SIGTHR (32) and SIGLIBRT (33)
+ Add inline for converting SIG* int to string
+ Add inline for converting CLD_* int to string

Reviewed by: markj
Sponsored by: Smule, Inc.
Differential Revision: https://reviews.freebsd.org/D14497
ib/libdtrace/signal.d
5f9d9ae52b3d1d2b14656dc1ef99bb050d1a214b 25-Feb-2018 asomers <asomers@FreeBSD.org> Don't declare __assfail as static

It gets called by dmu_buf_init_user, which is inline but not static. So it
needs global linkage itself.

Reported by: GCC-6
MFC after: 17 days
X-MFC-With: 329722
ontrib/opensolaris/lib/libzpool/common/kernel.c
3b5903943c51bdb84641cdc4c005184bd8c5a13c 24-Feb-2018 dteske <dteske@FreeBSD.org> Updates and enhancements to io.d to aid DTrace scripting

+ Add dev_type do devinfo_t
+ Add b_cmd to bufinfo_t
+ Add constants for BIO_* and DEVSTAT_TYPE_*
+ Add inline for converting BIO_* int to string
+ Add inline for converting DEVSTAT_TYPE_* int to string
+ Add mask for dev_type & DEVSTAT_TYPE_MASK to string
+ Add mask for dev_type & DEVSTAT_TYPE_IF_MASK to string

Reviewed by: markj
Sponsored by: Smule, Inc.
Differential Revision: https://reviews.freebsd.org/D14396
ib/libdtrace/io.d
a5f379e05c9d9f8951a5078ab83bc696828d053a 22-Feb-2018 mav <mav@FreeBSD.org> MFV r329807:
8940 Sending an intra-pool resumable send stream may result in EXDEV

illumos/illumos-gate@544132fce3fa6583f01318f9559adc46614343a7

"zfs send -t <token>" for an incremental send should be able to resume
successfully when sending to the same pool: a subtle issue in
zfs_iter_children() doesn't currently allow this.

Because resuming from a token requires "guid" -> "dataset" mapping
(guid_to_name()), we have to walk the whole hierarchy to find the right
snapshots to send.
When resuming an incremental send both source and destination live in the
same pool and have the same guid: this is where zfs_iter_children() gets
confused and picks up the wrong snapshot, so we end up trying to send an
incremental "destination@snap1 -> source@snap2" stream instead of
"source@snap1 -> source@snap2": this fails with an "Invalid cross-device
link" (EXDEV) error.

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: loli10K <ezomori.nozomu@gmail.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_iter.c
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
6702021a28e1db00b5a9f9ef70eac98a2e19f6aa 22-Feb-2018 mav <mav@FreeBSD.org> MFV r329793, r329795:
9075 Improve ZFS pool import/load process and corrupted pool recovery

illumos/illumos-gate@6f7938128a2c5e23f4b970ea101137eadd1470a1

Some work has been done lately to improve the debugability of the ZFS pool
load (and import) process. This includes:

https://www.illumos.org/issues/7638: Refactor spa_load_impl into several functions
https://www.illumos.org/issues/8961: SPA load/import should tell us why it failed
https://www.illumos.org/issues/7277: zdb should be able to print zfs_dbgmsg's

To iterate on top of that, there's a few changes that were made to make the
import process more resilient and crash free. One of the first tasks during the
pool load process is to parse a config provided from userland that describes
what devices the pool is composed of. A vdev tree is generated from that config,
and then all the vdevs are opened.

The Meta Object Set (MOS) of the pool is accessed, and several metadata objects
that are necessary to load the pool are read. The exact configuration of the
pool is also stored inside the MOS. Since the configuration provided from
userland is external and might not accurately describe the vdev tree
of the pool at the txg that is being loaded, it cannot be relied upon to safely
operate the pool. For that reason, the configuration in the MOS is read early
on. In the past, the two configurations were compared together and if there was
a mismatch then the load process was aborted and an error was returned.

The latter was a good way to ensure a pool does not get corrupted, however it
made the pool load process needlessly fragile in cases where the vdev
configuration changed or the userland configuration was outdated. Since the MOS
is stored in 3 copies, the configuration provided by userland doesn't have to be
perfect in order to read its contents. Hence, a new approach has been adopted:
The pool is first opened with the untrusted userland configuration just so that
the real configuration can be read from the MOS. The trusted MOS configuration
is then used to generate a new vdev tree and the pool is re-opened.

When the pool is opened with an untrusted configuration, writes are disabled
to avoid accidentally damaging it. During reads, some sanity checks are
performed on block pointers to see if each DVA points to a known vdev;
when the configuration is untrusted, instead of panicking the system if those
checks fail we simply avoid issuing reads to the invalid DVAs.

This new two-step pool load process now allows rewinding pools accross
vdev tree changes such as device replacement, addition, etc. Loading a pool
from an external config file in a clustering environment also becomes much
safer now since the pool will import even if the config is outdated and didn't,
for instance, register a recent device addition.

With this code in place, it became relatively easy to implement a
long-sought-after feature: the ability to import a pool with missing top level
(i.e. non-redundant) devices. Note that since this almost guarantees some loss
Of data, this feature is for now restricted to a read-only import.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
ontrib/opensolaris/lib/libzpool/common/kernel.c
ontrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
76f8fe62dda2647cfcc085e3e7adf79889bd1ad2 22-Feb-2018 mav <mav@FreeBSD.org> 8942 zfs promote .../%recv should be an error

illumos/illumos-gate@add927f8c8d101e16c23eb9cd270be4fd7edf7d5

Reported on the ZFSonLinux https://github.com/zfsonlinux/zfs/issues/4843,
fixed by https://github.com/zfsonlinux/zfs/pull/6339:

If we are in the middle of an incremental zfs receive, the child .../%recv
will exist. If you concurrently run zfs promote .../%recv, it will "work",
but then zfs gets confused. For example, there's no obvious way to destroy
the containing filesystem (because it is now a clone of its invisible child).

Attempting to do this promote should be an error. We could fix this by
having zfs_ioc_promote() check if zc_name contains a %, similar to
zfs_ioc_rename().

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
93d9043bf7fee2f1f76048bc3ff2f2e8b8095e10 22-Feb-2018 mav <mav@FreeBSD.org> MFV r329766: 8962 zdb should work on non-idle pools

illumos/illumos-gate@e144c4e6c90e7d4dccaad6db660ee42b6e7ba04f

Currently `zdb` consistently fails to examine non-idle pools as it fails
during the `spa_load()` process. The main problem seems to be that
`spa_load_verify()` fails as can be seen below:

$ sudo zdb -d -G dcenter
zdb: can't open 'dcenter': I/O error

ZFS_DBGMSG(zdb):
spa_open_common: opening dcenter
spa_load(dcenter): LOADING
disk vdev '/dev/dsk/c4t11d0s0': best uberblock found for spa dcenter. txg 40824950
spa_load(dcenter): using uberblock with txg=40824950
spa_load(dcenter): UNLOADING
spa_load(dcenter): RELOADING
spa_load(dcenter): LOADING
disk vdev '/dev/dsk/c3t10d0s0': best uberblock found for spa dcenter. txg 40824952
spa_load(dcenter): using uberblock with txg=40824952
spa_load(dcenter): FAILED: spa_load_verify failed [error=5]
spa_load(dcenter): UNLOADING

This change makes `spa_load_verify()` a dryrun when ran from `zdb`. This is
done by creating a global flag in zfs and then setting it in `zdb`.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
ontrib/opensolaris/cmd/zdb/zdb.c
5683a21d5850eeee8f514313275f285608155d68 21-Feb-2018 mav <mav@FreeBSD.org> 9018 Replace kmem_cache_reap_now() with kmem_cache_reap_soon()

illumos/illumos-gate@36a64e62848b51ac5a9a5216e894ec723cfef14e

To prevent kmem_cache reaping from blocking other system resources, turn
kmem_cache_reap_now() (which blocks) into kmem_cache_reap_soon(). Callers
to kmem_cache_reap_soon() should use kmem_cache_reap_active(), which
exploits #9017's new taskq_empty().

Reviewed by: Bryan Cantrill <bryan@joyent.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Author: Tim Kordas <tim.kordas@joyent.com>

FreeBSD does not use taskqueue for kmem caches reaping, so this change
is less dramatic then it is on Illumos, just limiting reaping to 1 time
per second. It may possibly be improved later, if needed.
ontrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
6da43894fe0991933503c427611a0fbe34f7cf4d 21-Feb-2018 mav <mav@FreeBSD.org> MFV r329502: 7614 zfs device evacuation/removal

illumos/illumos-gate@5cabbc6b49070407fb9610cfe73d4c0e0dea3e77

https://www.illumos.org/issues/7614:
This project allows top-level vdevs to be removed from the storage pool with
“zpool remove”, reducing the total amount of storage in the pool. This
operation copies all allocated regions of the device to be removed onto other
devices, recording the mapping from old to new location. After the removal is
complete, read and free operations to the removed (now “indirect”) vdev must
be remapped and performed at the new location on disk. The indirect mapping
table is kept in memory whenever the pool is loaded, so there is minimal
performance overhead when doing operations on the indirect vdev.

The size of the in-memory mapping table will be reduced when its entries
become “obsolete” because they are no longer used by any block pointers in
the pool. An entry becomes obsolete when all the blocks that use it are
freed. An entry can also become obsolete when all the snapshots that
reference it are deleted, and the block pointers that reference it have been
“remapped” in all filesystems/zvols (and clones). Whenever an indirect block
is written, all the block pointers in it will be “remapped” to their new
(concrete) locations if possible. This process can be accelerated by using
the “zfs remap” command to proactively rewrite all indirect blocks that
reference indirect (removed) vdevs.

Note that when a device is removed, we do not verify the checksum of the data
that is copied. This makes the process much faster, but if it were used on
redundant vdevs (i.e. mirror or raidz vdevs), it would be possible to copy
the wrong data, when we have the correct data on e.g. the other side of the
mirror. Therefore, mirror and raidz devices can not be removed.

Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Richard Laager <rlaager@wiktel.com>
Reviewed by: Tim Chase <tim@chase2k.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Prashanth Sreenivasa <pks@delphix.com>
b53f4cb1fe7cebb86c09f91eadc55d35927edb41 21-Feb-2018 asomers <asomers@FreeBSD.org> zdb: raise WARNS from 0 to 2

This has only been possible since r329694 and r329508

MFC after: 3 weeks
X-MFC-With: 329694
X-MFC-With: 329508
Sponsored by: Spectra Logic
sr.sbin/zdb/Makefile
d6fce51483557e79b392b2ac198989a2fa2f4a23 21-Feb-2018 avg <avg@FreeBSD.org> MFV r329718: 8520 7198 lzc_rollback_to should support rolling back to origin

illumos/illumos-gate@95643f75d23914a3e332adc9661ed51749e9858d
https://github.com/illumos/illumos-gate/commit/95643f75d23914a3e332adc9661ed51749e9858d

https://www.illumos.org/issues/8520
lzc_rollback_to() should support rolling back to a clone's origin.
The current checks in zfs_ioc_rollback() would not allow that because the
origin snapshot belongs to a different filesystem.
The overly restrictive check was introduced in 7600, but it was not a
regression as none of the existing tools provided a way to rollback to the
origin.

https://www.illumos.org/issues/7198
EINVAL is returned when a dataset does not have any snapshots, so there is
nothing to roll back to.
Although the code in zfs_do_rollback checks for that condition in advance, it's
still possible that the snapshot(s) gets removed after the check and before the
rollback sync task is executed.
At the moment zfs command would crash when that happens.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>
MFC after: 2 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
484c4a76cc69e41b02046070055e23e7937726f4 21-Feb-2018 mav <mav@FreeBSD.org> MFV r322231:
8430 dir_is_empty_readdir() doesn't properly handle error from fdopendir()

illumos/illumos-gate@ba6e7e6505150388de6dc6a88741164118a421bf
https://github.com/illumos/illumos-gate/commit/ba6e7e6505150388de6dc6a88741164118a421bf

https://www.illumos.org/issues/8430
we should close dirfd if fdopendir() fails.

Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Sowrabha Gopal <sowrabha.gopal@delphix.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
eb978148c027c50d7f4b3e1b428530ba2d268175 21-Feb-2018 mav <mav@FreeBSD.org> MFV r318941: 7446 zpool create should support efi system partition

illumos/illumos-gate@7855d95b30fd903e3918bad5a29b777e765db821
https://github.com/illumos/illumos-gate/commit/7855d95b30fd903e3918bad5a29b777e765db821

https://www.illumos.org/issues/7446
Since we support whole-disk configuration for boot pool, we also will need
whole disk support with UEFI boot and for this, zpool create should create efi-
system partition.
I have borrowed the idea from oracle solaris, and introducing zpool create -
B switch to provide an way to specify that boot partition should be created.
However, there is still an question, how big should the system partition be.
For time being, I have set default size 256MB (thats minimum size for FAT32
with 4k blocks). To support custom size, the set on creation "bootsize"
property is created and so the custom size can be set as: zpool create B -
o bootsize=34MB rpool c0t0d0
After pool is created, the "bootsize" property is read only. When -B switch is
not used, the bootsize defaults to 0 and is shown in zpool get output with
value ''. Older zfs/zpool implementations are ignoring this property.
https://www.illumos.org/rb/r/219/

Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: Dan McDonald <danmcd@kebe.com>
Author: Toomas Soome <tsoome@me.com>

This commit makes no sense for FreeBSD, that is why I blocked the option,
but it should be good to stay closer to upstream.
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/cmd/zpool/zpool_util.h
ontrib/opensolaris/cmd/zpool/zpool_vdev.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
sr.sbin/zfsd/case_file.cc
eb1dd5c39e47f8ff2f44bbc5c5e8cc08855f670c 20-Feb-2018 mav <mav@FreeBSD.org> MFV r316918: 7990 libzfs: snapspec_cb() does not need to call zfs_strdup()

illumos/illumos-gate@d8584ba6fb7a5e46da1725845b99ae5fab5a4baf
https://github.com/illumos/illumos-gate/commit/d8584ba6fb7a5e46da1725845b99ae5fab5a4baf

https://www.illumos.org/issues/7990
The snapspec_cb() callback function in libzfs does not need to call zfs_strdup().

Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Marcel Telka <marcel@telka.sk>
ontrib/opensolaris/lib/libzfs/common/libzfs_iter.c
51ae740610a083d68adbdaf1b53d7c19a979f2fc 20-Feb-2018 mav <mav@FreeBSD.org> MFV r316902: 7745 print error if lzc_* is called before libzfs_core_init

illumos/illumos-gate@7c13517fff71be473e47531ef4330160c042bedc
https://github.com/illumos/illumos-gate/commit/7c13517fff71be473e47531ef4330160c042bedc

https://www.illumos.org/issues/7745
The problem is that consumers of `libZFS_Core` that forget to call
`libzfs_core_init()` before calling any other function of the library
are having a hard time realizing their mistake. The library's internal
file descriptor is declared as global static, which is ok, but it is not
initialized explicitly; therefore, it defaults to 0, which is a valid
file descriptor. If `libzfs_core_init()`, which explicitly initializes
the correct fd, is skipped, the ioctl functions return errors that do
not have anything to do with `libZFS_Core`, where the problem is
actually located.
Even though assertions for that existed within `libZFS_Core` for debug
builds, they were never enabled because the `-DDEBUG` flag was missing
from the compiler flags.
This patch applies the following changes:
1. It adds `-DDEBUG` for debug builds of `libZFS_Core` and `libzfs`,
to enable their assertions on debug builds.
2. It corrects an assertion within `libzfs`, where a function had
been spelled incorrectly (`zpool_prop_unsupported()`) and nobody
knew because the `-DDEBUG` flag was missing, and the preprocessor
was taking that part of the code away.
3. The library's internal fd is initialized to `-1` and `VERIFY`
assertions have been placed to check that the fd is not equal to
`-1` before issuing any ioctl. It is important here to note, that
the `VERIFY` assertions exist in both debug and non-debug builds.
4. In `libzfs_core_fini` we make sure to never increment the
refcount of our fd below 0, and also reset the fd to `-1` when no
one refers to it. The reason for this, is for the rare case that
the consumer closes all references but then calls one of the
library's functions without using `libzfs_core_init()` first, and
in the mean time, a previous call to `open()` decided to reuse
our previous fd. This scenario would have passed our assertion in

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
c9eba72d986cad9d9cb452146938e4d70dfb245c 20-Feb-2018 mav <mav@FreeBSD.org> MFV r316901:
7730 libzfs`add_config() leaks config nvl when reading spare/l2cache devices

illumos/illumos-gate@105686550ee9cbf5d033166a8a2a5a763667d436
https://github.com/illumos/illumos-gate/commit/105686550ee9cbf5d033166a8a2a5a763667d436

https://www.illumos.org/issues/7730
antares:root:~# mdb /usr/sbin/zpool
> ::sysbp _exit
> ::run import
pool: data
id: 2093977168778024605
state: ONLINE
action: The pool can be imported using its name or numeric identifier.
config:

data ONLINE
c6t0d0 ONLINE
c6t1d0 ONLINE
cache
c6t2d0
mdb: stop on entry to _exit
mdb: target stopped at:
0xfee556ba: nop
mdb: You've got symbols!
Loading modules: [ ld.so.1 libumem.so.1 libc.so.1 libtopo.so.1 libavl.so.1
libnvpair.so.1 ]
> ::findleaks -d
BYTES LEAKED VMEM_SEG CALLER
4096 10 fda7b000 MMAP
8192 1 fea8d000 MMAP
8192 1 fe76d000 MMAP
8192 1 fe66e000 MMAP
4096 1 fe570000 MMAP
8192 1 fe470000 MMAP
4096 1 fe372000 MMAP
4096 1 fe273000 MMAP

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
fb87880a3ba7c798307efc30e0ffdd3c5abb4cbc 20-Feb-2018 mav <mav@FreeBSD.org> MFV r316893:
7604 if volblocksize property is the default, it displays as "-" rather than 8K

illumos/illumos-gate@4d86c0eab246bdfddc2dd52410ba808433bd6266
https://github.com/illumos/illumos-gate/commit/4d86c0eab246bdfddc2dd52410ba808433bd6266

https://www.illumos.org/issues/7604
If a zvol has the default setting for the "volblocksize" property, it is
8KB. However, it is displayed as "-" (not present), rather than "8K".
The problem was introduced by:
commit 25228e830e86924a41243343b1de9daf2d7dd43a
Author: Matthew Ahrens &lt;mahrens@delphix.com&gt;
Date: Thu Nov 17 14:37:24 2016 -0800
7571 non-present readonly numeric ZFS props do not have default value
which changed changed get_numeric_property() to indicate that readonly
default properties are not present. However, zfs_prop_readonly() returns
TRUE for both readonly and set-once properties (e.g. volblocksize).
Amusingly, that commit essentially reverted:
6900484 default volblocksize is no longer being reported correctly
from November 2009. However, that change was not correct either; the
correct solution is to only do this check for "truly readonly" (i.e. not
setonce) properties.
$ zfs list -t volume -o name,volblocksize
NAME
VOLBLOCK
domain0/group-100/appdata_container-101/appdata_windows_timeflow-102/
archive -
domain0/group-100/appdata_container-101/appdata_windows_timeflow-102/
datafile -
domain0/group-100/appdata_container-101/appdata_windows_timeflow-102/
external -
rpool/dump
128K
rpool/swap
4K
rpool/swap1
===============================================================================

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
89360a9da3292f4b035a0a2fdcc0e821a73cc1f0 20-Feb-2018 mav <mav@FreeBSD.org> MFV r316876: 7542 zfs_unmount failed with EZFS_UNSHARENFSFAILED

illumos/illumos-gate@09c9e6dc9b69d10b771bb87e01040ec320a0bfd3
https://github.com/illumos/illumos-gate/commit/09c9e6dc9b69d10b771bb87e01040ec320a0bfd3

https://www.illumos.org/issues/7542
libshare keeps a cached copy of the sharetab listing in memory, which can
become out of date if shares are destroyed or created while leaving a libzfs
handle open. This results in a spurious unmounting failure when an NFS share
exists but isn't in the stale libshare cache.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matt Amdur <matt.amdur@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Chris Williamson <chris.williamson@delphix.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_impl.h
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
9ad7ea663cf00769e613b58c95195fa9208abebc 20-Feb-2018 mav <mav@FreeBSD.org> MFV r316875: 7336 vfork and O_CLOEXEC causes zfs_mount EBUSY

illumos/illumos-gate@873c4903a52d089cd8234b79d24f5a3fc3bccc82
https://github.com/illumos/illumos-gate/commit/873c4903a52d089cd8234b79d24f5a3fc3bccc82

https://www.illumos.org/issues/7336
We can run into a problem where we call into zfs_mount, which in turn calls
is_dir_empty, which opens the directory to try and make sure it's empty. The
issue with the current approach is that it holds the directory open while it
traverses it with readdir, which, due to subtle interaction with the Java JVM,
vfork, and exec can cause a tricky race condition resulting in zfs_mount
failures.
The approach to resolving the issue in this patch is to drop the usage of
readdir altogether, and instead rely on the fact that ZFS stores the number of
entries contained in a directory using the st_size field of the stat structure.
Thus, if the directory in question is a ZFS directory, we can check to see if
it's empty by calling stat() and inspecting the st_size field of structure
returned.
===============================================================================
The root cause appears to be an interesting race between vfork, exec, and
zfs_mount's usage of O_CLOEXEC when calling openat. Here's what is going on:
1. We call zfs_mount, and this in turn calls openat to check if the directory
is empty, which results in opening the directory we're trying to mount onto,
and increment v_count.
2. As we're in the middle of reading the directory, vfork is called by the JVM
and proceeds to exec the jspawnhelper utility. As a result of the vfork, we
take an additional hold on the directory, which increments v_count a second
time. The semantics of vfork mean the parent process will wait for the child
process to exit or exec before the parent can continue; at this point the
parent is in the middle of zfs_mount, reading the directory to determine if
it's empty or not.
3. The child process exec-ing jspawnhelper gets to the relvm call within
exec_args (which is called by exec_common). relvm is the function that releases
the parent process, allowing the parent to proceed. The problem is, at this
point of calling relvm, the child hasn't yet called close_exec which is
responsible for closing the file descriptors inherited from the parent process

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Prakash Surya <prakash.surya@delphix.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
48ef2489f8191d036dfe20e6d595e8f956ba16b2 20-Feb-2018 mav <mav@FreeBSD.org> MFV r316873: 7233 dir_is_empty should open directory with CLOEXEC

illumos/illumos-gate@d420209d9c807f782c1d31f5683be74798142198
https://github.com/illumos/illumos-gate/commit/d420209d9c807f782c1d31f5683be74798142198

https://www.illumos.org/issues/7233
This fixes a race where one thread is executing zfs_mount() while another
thread forks and execs. If the fork occurs while the directory is open, the
child process will inherit (but not necessarily close immediately) the open fd
for the directory, preventing the mount.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Alex Reece <alex@delphix.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
292837ab237e2d7104d0059c175c3dec2b414aef 20-Feb-2018 mav <mav@FreeBSD.org> MFV r316872: 7502 ztest should run zdb with -G (debug mode)

illumos/illumos-gate@c3c65d17f7b6689bbd6568a1a1fcc0c4a3bac127
https://github.com/illumos/illumos-gate/commit/c3c65d17f7b6689bbd6568a1a1fcc0c4a3bac127

https://www.illumos.org/issues/7502
Right now ztest executes zdb without -G, so when it has errors, the messages
are often not very helpful:
Executing zdb -bccsv -d -U /rpool/tmp/zpool.cache ztest
zdb: can't open 'ztest': Operation not supported
ztest: '/usr/sbin/amd64/zdb -bccsv -d -U /rpool/tmp/zpool.cache ztest' exit
code 1
With -G, we'd have:
/usr/sbin/amd64/zdb -bccsv -d -U /rpool/tmp/zpool.cache -G ztest
zdb: can't open 'ztest': Operation not supported

ZFS_DBGMSG(zdb):
spa_open_common: opening ztest
spa_load(ztest): LOADING
spa_load(ztest): FAILED: unable to parse config [error=48]
spa_load(ztest): UNLOADING
Which indicates where the error came from

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
ontrib/opensolaris/cmd/ztest/ztest.c
d24bd331b30f90eb960fb4f7f07bef79a36afb99 20-Feb-2018 asomers <asomers@FreeBSD.org> Fix memory leaks in zdb introduced by r329508

Reported by: Coverity
CID: 1386185
MFC after: 3 weeks
X-MFC-With: 329508
Sponsored by: Spectra Logic Corp
ontrib/opensolaris/cmd/zdb/zdb.c
a08c55ddb4d3b5b742da7f7d935b0ea42e692590 18-Feb-2018 mav <mav@FreeBSD.org> MFV r324198: 8081 Compiler warnings in zdb

illumos/illumos-gate@3f7978d02b206a6ebc5652c91aa9f42da6fbe00c
https://github.com/illumos/illumos-gate/commit/3f7978d02b206a6ebc5652c91aa9f42da6fbe00c

https://www.illumos.org/issues/8081
zdb(8) is full of minor problems that generate compiler warnings. On FreeBSD,
which uses -WError, the only way to build it is to disable all compiler
warnings. This makes it much harder to detect newly introduced bugs. We should
cleanup all the warnings.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Alan Somers <asomers@gmail.com>
c96a7596737fa4057f235f5993ad178491e630ba 18-Feb-2018 mav <mav@FreeBSD.org> MFV r323911:
8502 illumos#7955 broke delegated datasets when libshare is not present

illumos/illumos-gate@1c18e8fbd8db41a9fb39bd3ef7a18ee71ece20da
https://github.com/illumos/illumos-gate/commit/1c18e8fbd8db41a9fb39bd3ef7a18ee71ece20da

https://www.illumos.org/issues/8502
The code in lib/libzfs/common/libzfs_mount.c already basically handles
the case when libshare is not installed. We just need to not fail in
zfs_init_libshare_impl. I tested this in lx and things work as
expected. I also tested there trying to set sharenfs and sharesmb on
the delegated dataset. Neither is allowed from within a zone. The
spew of msgs from a native zone is not ZFS specific. I see the same
spew simply running the share command.

Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Yuri Pankov <yuripv@gmx.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Jerry Jelinek <jerry.jelinek@joyent.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
e4bc54154f1f4a1d671fd51a7f9878eb4cef59ac 16-Feb-2018 dteske <dteske@FreeBSD.org> Add inline to errno.d for translating int to string

Gives DTrace scripts strerror(3) functionality.

Reviewed by: markj
Sponsored by: Smule, Inc.
Differential Revision: https://reviews.freebsd.org/D14386
ib/libdtrace/errno.d
73fb4f434774e9190a49d8a84fa5763342038535 15-Feb-2018 asomers <asomers@FreeBSD.org> Optimize zfsd for the happy case

If there are no damaged pools, then ignore all GEOM events. We only use
them to fix damaged pools. However, still pay attention to ZFS events.

MFC after: 20 days
X-MFC-With: 329284
Sponsored by: Spectra Logic Corp
sr.sbin/zfsd/case_file.cc
sr.sbin/zfsd/case_file.h
sr.sbin/zfsd/zfsd_event.cc
daea05f6a005e828e774ca35bb1957a1d7ea9140 15-Feb-2018 dteske <dteske@FreeBSD.org> Add the following errno definitions to /usr/lib/dtrace/errno.d

ENOTCAPABLE (93)
ECAPMODE (94)
ENOTRECOVERABLE (95)
EOWNERDEAD (96)
ERELOOKUP (-5)

and update ELAST (92 -> 96)

Reviewed by: markj
Sponsored by: Smule, Inc.
Differential Revision: https://reviews.freebsd.org/D14340
ib/libdtrace/errno.d
81891e1018235bb776dd301cc7317d543420f110 14-Feb-2018 asomers <asomers@FreeBSD.org> zfsd: Allow zfsd to work on any type of GEOM provider

cddl/usr.sbin/zfsd/zfsd_event.cc
Remove the check for da and ada devices. This way zfsd can work on md,
geli, glabel, gstripe, etc devices. geli in particular is useful
combined with ZFS. gnop is also useful for simulating drive pulls in
the ZFSD test suite.

Also, eliminate the DevfsEvent class entirely. Move its
responsibilities into GeomEvent. We can get everything we need to know
just from listening to GEOM events.

lib/libdevdctl/event.cc
Fix GeomEvent::DevName for CREATE events. Oddly, the relevant field is
named "cdev" for CREATE events but "devname" for disk events.

MFC after: 3 weeks
Relnotes: Yes (probably worth mentioning the geli part)
Sponsored by: Spectra Logic Corp
sr.sbin/zfsd/zfsd.cc
sr.sbin/zfsd/zfsd_event.cc
sr.sbin/zfsd/zfsd_event.h
51d4dde7fd2f801041048b94b7c48b6cc0b1d7e9 12-Feb-2018 dteske <dteske@FreeBSD.org> Use tabs in io.d, fix alignment issues, remove extraneous newlines
ib/libdtrace/io.d
ib/libdtrace/ip.d
ib/libdtrace/libproc_compat.h
ib/libdtrace/psinfo.d
ib/libdtrace/regs_x86.d
ib/libdtrace/sched.d
ib/libdtrace/tcp.d
ib/libdtrace/udp.d
736a2a1db40a3fb41f19d342d520ee14272ca7fb 09-Feb-2018 asomers <asomers@FreeBSD.org> Fix "zpool add" crash when a replacing vdev has a spare child

Fix an assertion in zpool that causes a crash when running any "zpool add"
command on a spare that contains a replacing vdev with a spare child.

This likely affects Illumos, too.

PR: 225546
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D14138
ontrib/opensolaris/cmd/zpool/zpool_vdev.c
4a4bfa321fad266b386d9a03d08fc42e8faccbe4 30-Jan-2018 asomers <asomers@FreeBSD.org> zfsd: Don't spare a vdev that's being replaced

If a zfs pool contains a replacing vdev (either created manually by "zpool
replace" or by zfsd(8) via autoreplace by physical path) and then new spares
get added to the pool, zfsd shouldn't use one to replace the drive that is
already being replaced. That's a waste of resources that just slows down
the rebuild.

PR: 225547
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
sr.sbin/zfsd/case_file.cc
e11caffed6d4d38e6f2d77130351c686c56ed6f1 25-Jan-2018 markj <markj@FreeBSD.org> Remove uneeded parentheses.

MFC after: 1 week
ib/libdtrace/tcp.d
7f69af8c9197f71e32fc74304953ba0f3b685fba 22-Jan-2018 mav <mav@FreeBSD.org> MFV r328255: 8972 zfs holds: In scripted mode, do not pad columns with spaces

illumos/illumos-gate@e9b7d6e7f7a6477679a35b73eb3934b096b3dd39

https://www.illumos.org/issues/8972:
'zfs holds -H' does not properly output content in scripted mode. It uses a
tab instead of two spaces, but it still pads column widths with spaces when
it should not.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Allan Jude <allanjude@freebsd.org>
ontrib/opensolaris/cmd/zfs/zfs_main.c
2dd60f22d792c4e7709a4174f40f0c71b442923e 22-Jan-2018 mav <mav@FreeBSD.org> MFV r328251: 8652 Tautological comparisons with ZPROP_INVAL

illumos/illumos-gate@4ae5f5f06c6c2d1db8167480f7d9e3b5378ba2f2

https://www.illumos.org/issues/8652:
Clang and GCC prefer to use unsigned ints to store enums. With Clang, that
causes tautological comparison warnings when comparing a zfs_prop_t or
zpool_prop_t variable to the macro ZPROP_INVAL. It's likely that error
handling code is being silently removed as a result.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Alan Somers <asomers@gmail.com>
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
7b32288ce9739350b47ef225b5ffa959b25b1860 22-Jan-2018 mav <mav@FreeBSD.org> MFV r328249:
8641 "zpool clear" and "zinject" don't work on "spare" or "replacing" vdevs

illumos/illumos-gate@2ba5f978a4f9b02da9db1b8cdd9ea5498eb00ad9

https://www.illumos.org/issues/8641:
"zpool clear" and "zinject -d" can both operate on specific vdevs, either
leaf or interior. However, due to an oversight, neither works on a "spare"
or "replacing" vdev. For example:

sudo zpool create foo raidz1 c1t5000CCA000081D61d0 c1t5000CCA000186235d0 spare c
1t5000CCA000094115d0
sudo zpool replace foo c1t5000CCA000186235d0 c1t5000CCA000094115d0
$ zpool status foo pool: foo
state: ONLINE
scan: resilvered 81.5K in 0h0m with 0 errors on Fri Sep 8 10:53:03 2017
config:

NAME STATE READ WRITE CKSUM
foo ONLINE 0 0 0
raidz1-0 ONLINE 0 0 0
c1t5000CCA000081D61d0 ONLINE 0 0 0
spare-1 ONLINE 0 0 0
c1t5000CCA000186235d0 ONLINE 0 0 0
c1t5000CCA000094115d0 ONLINE 0 0 0
spares
c1t5000CCA000094115d0 INUSE currently in use
$ sudo zinject -d spare-1 -A degrade foo
cannot find device 'spare-1' in pool 'foo'
$ sudo zpool clear foo spare-1
cannot clear errors for spare-1: no such device in pool

Even though there was nothing to clear, those commands shouldn't have
reported an error. by contrast, trying to clear "raidz1-0" works just fine:
$ sudo zpool clear foo raidz1-0

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Alan Somers <asomers@gmail.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
11d282f51a700273ec6de944c4360025c4d3c2d4 22-Jan-2018 mav <mav@FreeBSD.org> MFV r328233:
8898 creating fs with checksum=skein on the boot pools fails ungracefully

illumos/illumos-gate@9fa2266d9a78b8366e1cd2d5f050e8b5e37d558c

https://www.illumos.org/issues/8898:
# zfs create -o checksum=skein rpool/test
internal error: Result too large
Abort (core dumped)

Not a big deal per se, but should be handled correctly.

Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

PR: 222199
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
a5b091d69f558aee8bdab85a5c9cf21e07760a6a 21-Jan-2018 mav <mav@FreeBSD.org> MFV r328231: 8897 zpool online -e fails assertion when run on non-leaf vdevs

illumos/illumos-gate@9a551dd645b478816cb11251b19f5034d885bf01

https://www.illumos.org/issues/8897:
# zpool online -e test mirror-1
Assertion failed: nvlist_lookup_string(tgt, "path", &pathname) == 0, file ../common/libzfs_pool.c, line 2558, function zpool_vdev_online
Abort (core dumped)

Not a big deal per se, but should be handled gracefully, same way as 'offline' and 'online' without '-e'.

Also reported as: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221408

Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
2700f9ece142c06d1b799eec1066946fd20e436f 21-Jan-2018 mav <mav@FreeBSD.org> MFV r328220: 8677 Open-Context Channel Programs

illumos/illumos-gate@a3b2868063897ff0083dea538f55f9873eec981f

https://www.illumos.org/issues/8677
We want to be able to run channel programs outside of synching context.
This would greatly improve performance of channel program that just gather
information, as we won't have to wait for synching context anymore.

This feature should introduce the following:
- A new command line flag in "zfs program" to specify our intention to
run in open context.
- A new flag/option within the channel program ioctl which selects the
context.
- Appropriate error handling whenever we try a channel program in
open-context that contains zfs.sync* expressions.
- Documentation for the new feature in the manual pages.

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Chris Williamson <chris.williamson@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Serapheim Dimitropoulos <serapheim@delphix.com>
ontrib/opensolaris/cmd/zfs/zfs-program.8
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
f7a48eb91eb7a2a8bd6e5516ed73a6df07df90b1 14-Jan-2018 markj <markj@FreeBSD.org> Remove tst.zonename.d from the list of expected failures.

X-MFC with: r327888
sr.sbin/dtrace/tests/tools/exclude.sh
1bfc3a6a76928ffcb24f31c3492daee94a9f9491 12-Jan-2018 markj <markj@FreeBSD.org> Add "jid" and "jailname" variables to DTrace.

These return the jail ID and jail name for the traced process,
respectively, and are analogous to "zonename" on Solaris/illumos.
"zonename" is now aliased to "jailname".

Also add some stress tests for the new variables.

Submitted by: Domagoj Stolfa <domagoj.stolfa@gmail.com>
Reviewed by: dteske (previous version)
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D13877
ontrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jailname.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/safety/tst.jid.d
ontrib/opensolaris/lib/libdtrace/common/dt_open.c
sr.sbin/dtrace/tests/common/safety/Makefile
63b6263733800ef134519802e938dbf28d9839d1 10-Jan-2018 markj <markj@FreeBSD.org> Add a regression test for r327794.

MFC after: 2 weeks
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv3.ksh.out
sr.sbin/dtrace/tests/common/env/Makefile
86f0671557fbc23d0b62be35c64dfebe58442845 10-Jan-2018 markj <markj@FreeBSD.org> Fix an off-by-one in dt_opt_setenv().

The bug would cause incorrect behaviour when attempting to override
an already set environment variable with -x setenv, as long as the
variable is not the last one in the array.

Reported by: Samuel Lepetit <slepetit@apple.com>
MFC after: 2 weeks
ontrib/opensolaris/lib/libdtrace/common/dt_options.c
7468fbca97a1f0a564b8644d6c15d8d2f3f09828 15-Dec-2017 markj <markj@FreeBSD.org> Mark uctf/err.user64mode.ksh as EXFAIL for now.

MFC after: 1 week
sr.sbin/dtrace/tests/tools/exclude.sh
62a88db1582bc538f7ea7f7f0ecc595207e21069 08-Dec-2017 markj <markj@FreeBSD.org> Actually add the -x setenv test Makefile, missed in r326499.

X-MFC with: r326499
sr.sbin/dtrace/tests/common/env/Makefile
707df4a09be97b3ed5e97e85f48423ef30ea1c07 03-Dec-2017 markj <markj@FreeBSD.org> Complete support for dtrace's -x setenv option.

This allows one to override the environment for processes created with
dtrace -c. By default, the environment is inherited.

This support was originally merged from illumos in r249367 but was lost
when the commit was later reverted and then brought back piecemeal.

Reported by: Samuel Lepetit <slepetit@apple.com>
MFC after: 2 weeks
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.setfromscript.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/err.D_PRAGMA_OPTSET.unsetfromscript.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.ld_nolazyload.ksh.out
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv1.ksh.out
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.setenv2.ksh.out
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.unsetenv1.ksh.out
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/env/tst.unsetenv2.ksh.out
ontrib/opensolaris/lib/libdtrace/common/dt_open.c
ontrib/opensolaris/lib/libdtrace/common/dt_proc.c
ontrib/opensolaris/lib/libdtrace/common/dt_proc.h
sr.sbin/dtrace/tests/common/Makefile
sr.sbin/dtrace/tests/common/probes/Makefile
sr.sbin/dtrace/tests/common/speculation/Makefile
4f9c7fe02fba700ff7a78ab12fa43a90a89f1a46 03-Dec-2017 markj <markj@FreeBSD.org> Add an envp argument to proc_create().

This is needed to support dtrace's -x setenv option.

MFC after: 2 weeks
ontrib/opensolaris/lib/libdtrace/common/dt_proc.c
f9dc375e9d72a94de8deb5f0e9ab8c4793081281 27-Nov-2017 asomers <asomers@FreeBSD.org> Add basic tests for ctfconvert(1), fold(1) and rs(1)

Add basic command line parsing test coverage for these utilities. The tests
were automatically generated based on their man pages. These tests can be
expanded by hand for more thorough coverage. The aim is to generate very
basic amount of test coverage for all the utilities in the base system.

Tests generated via: https://github.com/shivansh/smoketestsuite/

Submitted by: shivansh
Reviewed by: asomers
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D12424
sr.bin/ctfconvert/Makefile
sr.bin/ctfconvert/tests/Makefile
sr.bin/ctfconvert/tests/ctfconvert_test.sh
87445f59ad8c891521703b419699f9bb605af73e 27-Nov-2017 markj <markj@FreeBSD.org> Revert r326181 for now.

We can't link an executable using -m32 until the lib32 phase of a
buildworld, though the build works fine when executing make from
cddl/usr.sbin/dtrace/tests. Some other solution will need to be found.
ontrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh
sr.sbin/dtrace/tests/common/probes/Makefile
sr.sbin/dtrace/tests/common/speculation/Makefile
sr.sbin/dtrace/tests/common/uctf/Makefile
sr.sbin/dtrace/tests/tools/genmakefiles.sh
c842c9f01bda903ecc64ee00130241d543af9949 25-Nov-2017 avg <avg@FreeBSD.org> zdb: follow-up to r326150, check if malloc succeeded

Reported by: rpokala
MFC after: 1 week
X-MFC with: r326150
ontrib/opensolaris/cmd/zdb/zdb.c
a9e1e0089b6597a8c2ea6440b80a16433fc65103 24-Nov-2017 markj <markj@FreeBSD.org> Compile one of the uctf test programs with -m32.

The err.user64mode.ksh test expects it to run as a 32-bit process.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.userlandkey.ksh
sr.sbin/dtrace/tests/common/probes/Makefile
sr.sbin/dtrace/tests/common/speculation/Makefile
sr.sbin/dtrace/tests/common/uctf/Makefile
sr.sbin/dtrace/tests/tools/genmakefiles.sh
2051dd5919dc87c39acbe3ad36cb34dc1cc71c61 24-Nov-2017 markj <markj@FreeBSD.org> Fix the type signature for sx(9) DTrace subroutines.

MFC after: 1 week
ontrib/opensolaris/lib/libdtrace/common/dt_open.c
d72d8662c0dec951e4fa5f3f81fc730536d95673 24-Nov-2017 avg <avg@FreeBSD.org> zdb: use a heap allocation instead of a huge array on stack

SPA_MAXBLOCKSIZE is 16 MB and having such a large object on the stack is
not nice in general and it could cause some confusing failures in the
single-user mode where the default stack size of 8 MB is used.

I expect that the upstream would make the same change.

MFC after: 1 week
ontrib/opensolaris/cmd/zdb/zdb.c
9a2306e46d1e84c06ad11553723287fc49537f9e 22-Nov-2017 markj <markj@FreeBSD.org> Annotate pragma/err.invalidlibdep.ksh as EXFAIL.

The test creates a D library with a "depends_on library" pragma
referencing a non-existent library, and expects compilation to fail.
However, as far as I can tell, libdtrace is supposed simply abort
compilation of the library in this case, and continue. This behaviour
is desirable when adding libraries which depend on optional KLDs, for
example.

MFC after: 1 week
sr.sbin/dtrace/tests/tools/exclude.sh
b04e3f083c7fe5098dc858f931a5aee7b1cba1a4 21-Nov-2017 markj <markj@FreeBSD.org> Annotate usdt/tst.eliminate.ksh as EXFAIL.

It appears to depend on some behaviour specific to the Sun link editor.

MFC after: 1 week
sr.sbin/dtrace/tests/tools/exclude.sh
d05028578123b8130f603721d9968e314a8dec17 21-Nov-2017 markj <markj@FreeBSD.org> Don't assume that we can resolve "main" in the ksh executable.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.d
f446f5ff4a6e425916e995ce9a300120a75f0d30 21-Nov-2017 emaste <emaste@FreeBSD.org> dt_modtext: return error on archs lacking an implementation

Reported by: mmel
Reviewed by: markj
MFC after: 1 week
MFC with: r325042
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D13176
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
55aa6861259e18274bd889d2a290ece17ffb31be 16-Nov-2017 markj <markj@FreeBSD.org> Take r313504 into account when recomputing the string table length.

When we encounter a USDT probe in a weak symbol, we emit an alias for
the probe function symbol. Such aliases are named differently from the
aliases we emit for probes in local functions, so make sure to take that
difference into account when resizing the output object file's string
table. Otherwise, we underrun the string table buffer.

PR: 223680
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
a598c4b809a73772d7452991213407cdac302156 31-Oct-2017 bdrewery <bdrewery@FreeBSD.org> DIRDEPS_BUILD: Update dependencies.

Sponsored by: Dell EMC Isilon
ib/libavl/Makefile.depend
ib/libctf/Makefile.depend
ib/libdtrace/Makefile.depend
ib/libnvpair/Makefile.depend
ib/libumem/Makefile.depend
ib/libuutil/Makefile.depend
ib/libzfs/Makefile.depend
ib/libzfs_core/Makefile.depend
ib/libzpool/Makefile.depend
bin/zfs/Makefile.depend
bin/zpool/Makefile.depend
sr.bin/ctfconvert/Makefile.depend
sr.bin/ctfdump/Makefile.depend
sr.bin/ctfmerge/Makefile.depend
sr.bin/zinject/Makefile.depend
sr.bin/zstreamdump/Makefile.depend
sr.bin/ztest/Makefile.depend
sr.sbin/dtrace/Makefile.depend
sr.sbin/dtrace/tests/common/io/Makefile.depend
sr.sbin/dtrace/tests/common/java_api/Makefile.depend
sr.sbin/dtrace/tests/common/json/Makefile.depend
sr.sbin/dtrace/tests/common/pid/Makefile.depend
sr.sbin/dtrace/tests/common/probes/Makefile.depend
sr.sbin/dtrace/tests/common/proc/Makefile.depend
sr.sbin/dtrace/tests/common/profile-n/Makefile.depend
sr.sbin/dtrace/tests/common/raise/Makefile.depend
sr.sbin/dtrace/tests/common/sdt/Makefile.depend
sr.sbin/dtrace/tests/common/stop/Makefile.depend
sr.sbin/dtrace/tests/common/syscall/Makefile.depend
sr.sbin/dtrace/tests/common/uctf/Makefile.depend
sr.sbin/dtrace/tests/common/usdt/Makefile.depend
sr.sbin/dtrace/tests/common/ustack/Makefile.depend
sr.sbin/lockstat/Makefile.depend
sr.sbin/plockstat/Makefile.depend
sr.sbin/zdb/Makefile.depend
sr.sbin/zfsd/Makefile.depend
sr.sbin/zhack/Makefile.depend
a4164f0dcdb68cb39e09bce5c55e2d178c851714 31-Oct-2017 bdrewery <bdrewery@FreeBSD.org> DIRDEPS_BUILD: Connect new directories.

Sponsored by: Dell EMC Isilon
sr.sbin/dtrace/tests/common/sugar/Makefile.depend
b280b57c851ef932d49b9fb1c4df2f235e80e219 27-Oct-2017 emaste <emaste@FreeBSD.org> libdtrace: replace "DOODAD" with more descriptive string

Previously some unimplemented libdtrace routines printed the function,
file and line number, followed by "DOODAD." That is not particularly
informative, so replace it with a message reporting the actual issue.

Sponsored by: The FreeBSD Foundation
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
ontrib/opensolaris/lib/libdtrace/common/dt_proc.c
d9f41b1a59c0ae741a44b9de774396b6133328c0 27-Oct-2017 avg <avg@FreeBSD.org> MFV r325013,r325034: 640 number_to_scaled_string is duplicated in several commands

illumos/illumos-gate@0a0551200ecbcd4f1b17560acaeeb7b6c8b0090e
https://github.com/illumos/illumos-gate/commit/0a0551200ecbcd4f1b17560acaeeb7b6c8b0090e

https://www.illumos.org/issues/640
du(1), df(1m), ls(1), and swap(1m) all include a copy (it appears literally
copied) of the 'number_to_scaled_string' function in their source. This should
be moved to a shared library and all 4 commands should use this instead.

FreeBSD note: of all libcmdutils functionality ZFS (and other illumos
contrib code) currently uses only nicenum() function (which is similar
to humanize_number but has some formatting differences). For this
reason I decided to not port the whole library. As a result, nicenum.c
from libcmdutils is compiled into libzfs and libzpool. This is a bit
ugly, but works. If one day we are forced to create libillumos, then
the file should be moved to that library.

Reviewed by: Sebastian Wiedenroth <wiedi@frubar.net>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Yuri Pankov <yuripv@gmx.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Jason King <jason.brian.king@gmail.com>

MFC after: 2 weeks
878bf63ed9a17d079211a126d2d216c88f323e52 26-Oct-2017 asomers <asomers@FreeBSD.org> zfsd should be able to online an L2ARC that disappears and returns

Previously, this didn't work because L2ARC devices' labels don't contain
pool GUIDs. Modify zfsd so that the pool GUID won't be required:

lib/libdevdctl/guid.h
Change INVALID_GUID from a uint64_t constant to a function that
returns an invalid Guid object. Remove the void constructor.
Nothing uses it, and it violates RAII.

cddl/usr.sbin/zfsd/case_file.h
cddl/usr.sbin/zfsd/case_file.cc
Allow CaseFile::Find to match a CaseFile based on Vdev GUID alone.
In CaseFile::ReEvaluate, attempt to online devices even if the newly
arrived device has no pool GUID.

cddl/usr.sbin/zfsd/vdev_iterator.cc
Iterate through a pool's cache devices as well as its regular
devices.

Reported by: avg
Reviewed by: avg
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12791
sr.sbin/zfsd/case_file.cc
sr.sbin/zfsd/case_file.h
sr.sbin/zfsd/vdev_iterator.cc
2c7d2a90551525aef5db4559894035cb3429a704 25-Oct-2017 asomers <asomers@FreeBSD.org> Fix zpool_read_all_labels when vfs.aio.enable_unsafe=0

Previously, zpool_read_all_labels was trying to do 256KB reads, which are
greater than the default MAXPHYS and therefore must go through the slow,
unsafe AIO path. Shrink these reads to 112KB so they can use the safe, fast
AIO path instead.

MFC after: 1 week
X-MFC-With: 324568
Sponsored by: Spectra Logic Corp
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
4abe1e1eaaac524fbdc5b12ab8bdea3d13aa8d7a 22-Oct-2017 markj <markj@FreeBSD.org> Address some miscellaneous issues in the CTF man page.

- Fix a number of typos.
- Replace some illumos-specific references.
- Note that a type definition of kind CTF_K_FUNCTION may be followed by
a null type identifier in order to provide 4-byte alignment for the
next type definition.

MFC after: 2 weeks
ontrib/opensolaris/lib/libctf/common/ctf.5
016faf2a2af5f992a434d1bb5b2d59bdb1643ef5 22-Oct-2017 markj <markj@FreeBSD.org> MFV r323105 (partial): 8300 fix man page issues found by mandoc 1.14.1

illumos/illumos-gate@72d3dbb9ab4481606cb93caca98ba3b3a8eb6ce2
https://github.com/illumos/illumos-gate/commit/72d3dbb9ab4481606cb93caca98ba3b3a8eb6ce2

https://www.illumos.org/issues/8300
Prior to integrating the mdocml update to 1.14.1, fix issues found by
new version, especially the "new sentence, new line" style rule.

FreeBSD note: this revision merges only the changes to the CTF manual
page. The changes to the ZFS pages cannot be applied directly.

Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

Discussed with: avg
MFC after: 2 weeks
ontrib/opensolaris/lib/libctf/common/ctf.5
c49a19fd7cfe64ba21443e7773b6eaad5d401178 12-Oct-2017 asomers <asomers@FreeBSD.org> Optimize zpool_read_all_labels with AIO

Read all labels in parallel instead of sequentially

MFC after: 3 weeks
X-MFC-With: 322854
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12495
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
c5cb57bff644fbfc746ca3839cac451396617c60 06-Oct-2017 markj <markj@FreeBSD.org> Avoid adding an extra "0x" prefix before pointer formats.

MFC after: 1 week
ontrib/opensolaris/lib/libdtrace/common/dt_dis.c
ontrib/opensolaris/lib/libdtrace/common/dt_print.c
e40ca917faa9b1926a58fe22d5c5d090d6e4d623 06-Oct-2017 avg <avg@FreeBSD.org> zdb.8: replace with the slighly modified upstream version

The upstream has converted their manual page to the same format as we
have, so we can use the upstream version with minimal modifications.

The current modifications are:
- different zpool.cache path
- different manual sections for zdb, zfs, zpool commands

igor reports a few minor issues, it would be nice to fix them both in
FreeBSD and in the upstream.

MFC after: 3 weeks
ontrib/opensolaris/cmd/zdb/zdb.8
b4598c95174d88fad58bf104c48d1cccfd4bd11f 06-Oct-2017 avg <avg@FreeBSD.org> MFV r322235: 8067 zdb should be able to dump literal embedded block pointer

illumos/illumos-gate@4923c69fddc0887da5604a262585af3efd82ee20
https://github.com/illumos/illumos-gate/commit/4923c69fddc0887da5604a262585af3efd82ee20

FreeBSD note: the manual page is to be updated separately.

https://www.illumos.org/issues/8067
Add an option to zdb to print a literal embedded block pointer supplied on the
command line:
zdb -E [-A] word0:word1:...:word15

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

MFC after: 3 weeks
ontrib/opensolaris/cmd/zdb/zdb.c
fac3e460cf6c30e40a0109b16eac07afcfc698fa 06-Oct-2017 avg <avg@FreeBSD.org> MFV r316934: 7340 receive manual origin should override automatic origin

illumos/illumos-gate@ed4e7a6a5cbc5e8986dc649ad54435210487b102
https://github.com/illumos/illumos-gate/commit/ed4e7a6a5cbc5e8986dc649ad54435210487b102

https://www.illumos.org/issues/7340
When -o origin=<snapshot> is specified as part of a ZFS receive, that origin
should override the automatic detection in libzfs.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>

MFC after: 3 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
b3697daeff39a4c6fe0d3e6fb0c0e26ed5d4580f 06-Oct-2017 avg <avg@FreeBSD.org> MFV r316933: 5142 libzfs support raidz root pool (loader project)

illumos/illumos-gate@d5f26ad8122c3762fb16413a17bfb497db86a782
https://github.com/illumos/illumos-gate/commit/d5f26ad8122c3762fb16413a17bfb497db86a782

https://www.illumos.org/issues/5142
the current libzfs only allows simple disk and mirror setup for boot pool, as
loader does support booting from raidz, this feature will remove raidz
restriction from boot pool setup.

FreeBSD note: we have long supported this feature, this commit only
removes a small difference in libzfs.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Albert Lee <trisk@omniti.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Toomas Soome <tsoome@me.com>

MFC after: 3 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
49e5e8efe096f411200a1ce9a5d91b3a32640104 06-Oct-2017 avg <avg@FreeBSD.org> MFV r316931: 6268 zfs diff confused by moving a file to another directory

illumos/illumos-gate@aab04418a72c0a29040a5da7eec08efe19dbef04
https://github.com/illumos/illumos-gate/commit/aab04418a72c0a29040a5da7eec08efe19dbef04

https://www.illumos.org/issues/6268
The zfs diff command presents a description of the changes that have occurred
to files within a filesystem between two snapshots. If a file is renamed, the
tool is capable of reporting this, e.g.:
cd /some/zfs/dataset/subdir
mv file0 file1
Will result in a diff record like:
R /some/zfs/dataset/subdir/file0 -> /some/zfs/dataset/subdir/file1
Unfortunately, it seems that rename detection only uses the base filename to
determine if a file has been renamed or simply modified. This leads to
misreporting only the original filename, omitting the more relevant destination
filename entirely. For example:
cd /some/zfs/dataset/subdir
mv file0 ../otherdir/file0
Will result in a diff entry:
M /some/zfs/dataset/subdir/file0
But it should really emit:
R /some/zfs/dataset/subdir/file0 -> /some/zfs/dataset/otherdir/file0

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Justin Gibbs <gibbs@scsiguy.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Joshua M. Clulow <josh@sysmgr.org>

MFC after: 3 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_diff.c
8d451ed529268fa4443608e2b045ea1c974b56ef 06-Oct-2017 avg <avg@FreeBSD.org> MFV r316877: 7571 non-present readonly numeric ZFS props do not have default value

illumos/illumos-gate@ad2760acbd9c3b479bf632f05c6f03d89830799d
https://github.com/illumos/illumos-gate/commit/ad2760acbd9c3b479bf632f05c6f03d89830799d

https://www.illumos.org/issues/7571
ZFS displays the default value for non-present readonly numeric (and index)
properties. However, these properties default values are not meaningful.
Instead, we should display a "-", indicating that they are not present. For
example, on a version-12 pool, the usedby* properties are not available, but
they show up as the incorrect value "0":
1. zfs get all test12
...
test12 usedbysnapshots 0 -
test12 usedbydataset 0 -
test12 usedbychildren 0 -
test12 usedbyrefreservation 0 -
We will be introducing more sometimes-present numeric readonly properties, so
it would be nice to fix this.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

MFC after: 3 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
84d5f7a834b21dc64f8a29d3fe4cab04e6f1d343 06-Oct-2017 avg <avg@FreeBSD.org> MFV r316864: 6392 zdb: introduce -V for verbatim import

illumos/illumos-gate@dfd5965f7e43b6a630e5ac86708ae76b4f02cc40
https://github.com/illumos/illumos-gate/commit/dfd5965f7e43b6a630e5ac86708ae76b4f02cc40

FreeBSD note: the manual page is to be updated separately.

https://www.illumos.org/issues/6392
When given a pool name via -e, zdb would attempt an import. If it
failed, then it would attempt a verbatim import. This behavior is
not always desirable so a -V switch is added to zdb to control the
behavior. When specified, a verbatim import is done. Otherwise,
the behavior is as it was previously, except no verbatim import
is done on failure.
https://github.com/zfsonlinux/zfs/commit/a5778ea2427bd340e3b4f697d9b6e1452bd71909
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>

Reviewed by: Yuri Pankov <yuri.pankov@gmail.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Richard Yao <ryao@gentoo.org>

MFC after: 3 weeks
ontrib/opensolaris/cmd/zdb/zdb.c
4aaebb2559c6b8da03d158d4cdf5238918b5b6b7 06-Oct-2017 avg <avg@FreeBSD.org> MFV r316862: 6410 teach zdb to perform object lookups by path

illumos/illumos-gate@ed61ec1da9132e570b0853386d0f78a32f852cd2
https://github.com/illumos/illumos-gate/commit/ed61ec1da9132e570b0853386d0f78a32f852cd2

FreeBSD note: this commit does not update the manual page.
The original change includes conversion of the manual page from *roff format
to mandoc format. So, it is hard to extract the content change from
that. I am going to replace our zdb manual page, which is an earlier
independent conversion, with a slighly modified version of the upstream page.

https://www.illumos.org/issues/6410
This is primarily intended to ease debugging & testing ZFS when one is only
interested in things like the on-disk location of a specific object's blocks,
but doesn't know their object id. This allows doing things like the following
(FreeBSD-based example):
# zpool create -f foo da0
# dd if=/dev/zero of=/foo/1 bs=1M count=4 >/dev/null 2>&1
# zpool export foo
# zdb -vvvvv -o "ZFS plain file" foo /1
Object lvl iblk dblk dsize lsize %full type
8 2 16K 128K 3.99M 4M 100.00 ZFS plain file (K=inherit) (Z=inherit)
168 bonus System attributes
dnode flags: USED_BYTES USERUSED_ACCOUNTED
dnode maxblkid: 31
path /1
uid 0
gid 0
atime Thu Apr 23 22:45:32 2015
mtime Thu Apr 23 22:45:32 2015
ctime Thu Apr 23 22:45:32 2015
crtime Thu Apr 23 22:45:32 2015
gen 7
mode 100644
size 4194304
parent 4
links 1
pflags 40800000004
Indirect blocks:
0 L1 DVA[0]=<0:c19200:600> DVA[1]=<0:10800019200:600> [L1 ZFS
plain file] fletcher4 lz4 LE contiguous unique double size=4000L/200P birth=7L/

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Will Andrews <will@freebsd.org>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

MFC after: 3 weeks
ontrib/opensolaris/cmd/zdb/zdb.c
39c93f3da3e506cf2f9f852ec0b92a55c9ecd764 02-Oct-2017 asomers <asomers@FreeBSD.org> MFV r319743: 8108 zdb -l fails to read labels 2 and 3

illumos/illumos-gate@22c8b9583d07895c16549075a53668d7bc988cf3
https://github.com/illumos/illumos-gate/commit/22c8b9583d07895c16549075a53668d7bc988cf3

https://www.illumos.org/issues/8108

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

MFC after: 3 weeks
ontrib/opensolaris/cmd/zdb/zdb.c
b10154d415dc7768a9735f6eab588bb92aecb6c8 02-Oct-2017 asomers <asomers@FreeBSD.org> MFV r316863: 3871 fix issues introduced by 3604

illumos/illumos-gate@de05b58863498b10283637eb9ac85e92fe85150e
https://github.com/illumos/illumos-gate/commit/de05b58863498b10283637eb9ac85e92fe85150e

https://www.illumos.org/issues/3871
GCC 4.5.3 on Gentoo Linux did not like a few of the changes made in the issue
3604 patch. It printed an error and a couple of warnings:
../../cmd/zdb/zdb.c: In function 'dump_bpobj':
../../cmd/zdb/zdb.c:1257:3: error: 'for' loop initial declarations are only
allowed in C99 mode
../../cmd/zdb/zdb.c:1257:3: note: use option -std=c99 or -std=gnu99 to compile
your code
../../cmd/zdb/zdb.c: In function 'dump_deadlist':
../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format
../../cmd/zdb/zdb.c:1323:8: warning: too many arguments for format

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Richard Yao <ryao@gentoo.org>

MFC after: 3 weeks
ontrib/opensolaris/cmd/zdb/zdb.c
69574b39a33719b75909c85193a4b1fbfba11d4e 02-Oct-2017 asomers <asomers@FreeBSD.org> MFV r316861: 6866 zdb -l should return non-zero if it fails to find any label

illumos/illumos-gate@64723e361134b2a2c45341334174f9d34002f8d0
https://github.com/illumos/illumos-gate/commit/64723e361134b2a2c45341334174f9d34002f8d0

https://www.illumos.org/issues/6866
Need this for #6865.
To be generally more scripting-friendly, overload this issue with adding '-q'
option which should skip printing any label information.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

MFC after: 3 weeks
ontrib/opensolaris/cmd/zdb/zdb.8
ontrib/opensolaris/cmd/zdb/zdb.c
5a3fff8837a5f66e1b9458ce8dc02a21fb902ea6 02-Oct-2017 asomers <asomers@FreeBSD.org> MFC r316858 7280 Allow changing global libzpool variables in zdb

7280 Allow changing global libzpool variables in zdb and ztest through command line

illumos/illumos-gate@0e60744c982adecd0a1f146f5637475d07ab1069
https://github.com/illumos/illumos-gate/commit/0e60744c982adecd0a1f146f5637475d07ab1069

https://www.illumos.org/issues/7280
zdb is very handy for diagnosing problems with a pool in a safe and
quick way. When a pool is in a bad shape, we often want to disable some
fail-safes, or adjust some tunables in order to open them. In the
kernel, this is done by changing public variables in mdb. The goal of
this feature is to add the same capability to zdb and ztest, so that
they can change libzpool tuneables from the command line.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>

MFC after: 3 weeks
ontrib/opensolaris/cmd/zdb/zdb.8
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/ztest/ztest.c
ontrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
ontrib/opensolaris/lib/libzpool/common/util.c
76beef80e1b56de99976e39b938ec6bab7348e67 02-Oct-2017 avg <avg@FreeBSD.org> MFV r323913: 8600 ZFS channel programs - snapshot

illumos/illumos-gate@2840dce1a029098fb784afd951d5f98089f850d8
https://github.com/illumos/illumos-gate/commit/2840dce1a029098fb784afd951d5f98089f850d8

https://www.illumos.org/issues/8600
ZFS channel programs should be able to create snapshots.
In addition to the base snapshot functionality, this will likely entail adding
extra logic to handle edge cases which were formerly not possible, such as
creating then destroying a snapshot in the same transaction sync.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Chris Williamson <chris.williamson@delphix.com>

MFC after: 5 weeks
X-MFC after: r324163
ontrib/opensolaris/cmd/zfs/zfs-program.8
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
904b3b0775fe742d1f33b4a1018b05161756aacc 02-Oct-2017 avg <avg@FreeBSD.org> MFV r323912: 8592 ZFS channel programs - rollback

illumos/illumos-gate@000cce6b6fad4a8b0eecef6e1251f6aca1719c55
https://github.com/illumos/illumos-gate/commit/000cce6b6fad4a8b0eecef6e1251f6aca1719c55

https://www.illumos.org/issues/8592
ZFS channel programs should be able to perform a rollback. This logic will
probably look pretty similar to zfs.sync.destroy().

Reviewed by: Chris Williamson <chris.williamson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Brad Lewis <brad.lewis@delphix.com>

MFC after: 5 weeks
X-MFC after: r324163
ontrib/opensolaris/cmd/zfs/zfs-program.8
852fc815f832c4c9db34200de268c622077831a2 01-Oct-2017 avg <avg@FreeBSD.org> MFV r323794: 8605 zfs channel programs: zfs.exists undocumented and non-working

illumos/illumos-gate@5f39f884e2035d671ec02148fc4d8420c670bcb4
https://github.com/illumos/illumos-gate/commit/5f39f884e2035d671ec02148fc4d8420c670bcb4

https://www.illumos.org/issues/8605
zfs.exists() in channel programs doesn't return any result, and should have a
man page entry.

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Chris Williamson <chris.williamson@delphix.com>

MFC after: 5 weeks
X-MFC after: r324163
ontrib/opensolaris/cmd/zfs/zfs-program.8
6b319ae2aabfa0a0bc36cb18c2677e01ecf822f8 01-Oct-2017 avg <avg@FreeBSD.org> MFV r323530,r323533,r323534: 7431 ZFS Channel Programs, and followups

7431 ZFS Channel Programs

illumos/illumos-gate@dfc115332c94a2f62058ac7f2bce7631fbd20b3d
https://github.com/illumos/illumos-gate/commit/dfc115332c94a2f62058ac7f2bce7631fbd20b3d

https://www.illumos.org/issues/7431
ZFS channel programs (ZCP) adds support for performing compound ZFS
administrative actions via Lua scripts in a sandboxed environment (with time
and memory limits).
This initial commit includes both base support for running ZCP scripts, and a
small initial library of API calls which support getting properties and
listing, destroying, and promoting datasets.
Testing: in addition to the included unit tests, channel programs have been in
use at Delphix for several months for batch destroying filesystems. The
dsl_destroy_snaps_nvl() call has also been replaced with

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Chris Williamson <chris.williamson@delphix.com>

8552 ZFS LUA code uses floating point math

illumos/illumos-gate@916c8d881190bd2c3ca20d9fca919aecff504435
https://github.com/illumos/illumos-gate/commit/916c8d881190bd2c3ca20d9fca919aecff504435

https://www.illumos.org/issues/8552
In the LUA interpreter used by "zfs program", the lua format() function
accidentally includes support for '%f' and friends, which can cause compilation
problems when building on platforms that don't support floating-point math in
the kernel (e.g. sparc). Support for '%f' friends (%f %e %E %g %G) should be
removed, since there's no way to supply a floating-point value anyway (all
numbers in ZFS LUA are int64_t's).

Reviewed by: Yuri Pankov <yuripv@gmx.com>
Reviewed by: Igor Kozhukhov <igor@dilos.org>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

8590 memory leak in dsl_destroy_snapshots_nvl()

illumos/illumos-gate@e6ab4525d156c82445c116ecf6b2b874d5e9009d
https://github.com/illumos/illumos-gate/commit/e6ab4525d156c82445c116ecf6b2b874d5e9009d

https://www.illumos.org/issues/8590
In dsl_destroy_snapshots_nvl(), "snaps_normalized" is not freed after it is
added to "arg".

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

FreeBSD notes:
- zfs-program.8 manual page is taken almost as is from the vendor repository,
no FreeBSD-ification done
- fixed multiple instances of NULL being used where an integer is expected
- replaced ETIME and ECHRNG with ETIMEDOUT and EDOM respectively

This commit adds a modified version of Lua 5.2.4 under
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua, mirroring the
upstream. See README.zfs in that directory for the description of Lua
customizations.
See zfs-program.8 on how to use the new feature.

MFC after: 5 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D12528
16b20104c426b76ed302fa467895eec5fc045765 26-Sep-2017 avg <avg@FreeBSD.org> MFV r323535: 8585 improve batching done in zil_commit()

FreeBSD notes:
- this MFV reverts FreeBSD commit r314549 to make the merge easier
- at present our emulation of cv_timedwait_hires is rather poor,
so I elected to use cv_timedwait_sbt directly
Please see the differential revision for details.
Unfortunately, I did not get any positive reviews, so there could be
bugs in the FreeBSD-specific piece of the merge.
Hence, the long MFC timeout.

illumos/illumos-gate@1271e4b10dfaaed576c08a812f466f6e81370e5e
https://github.com/illumos/illumos-gate/commit/1271e4b10dfaaed576c08a812f466f6e81370e5e

https://www.illumos.org/issues/8585
The current implementation of zil_commit() can introduce significant
latency, beyond what is inherent due to the latency of the underlying
storage. The additional latency comes from two main problems:
1. When there's outstanding ZIL blocks being written (i.e. there's
already a "writer thread" in progress), then any new calls to
zil_commit() will block waiting for the currently oustanding ZIL
blocks to complete. The blocks written for each "writer thread" is
coined a "batch", and there can only ever be a single "batch" being
written at a time. When a batch is being written, any new ZIL
transactions will have to wait for the next batch to be written,
which won't occur until the current batch finishes.
As a result, the underlying storage may not be used as efficiently
as possible. While "new" threads enter zil_commit() and are blocked
waiting for the next batch, it's possible that the underlying
storage isn't fully utilized by the current batch of ZIL blocks. In
that case, it'd be better to allow these new threads to generate
(and issue) a new ZIL block, such that it could be serviced by the
underlying storage concurrently with the other ZIL blocks that are
being serviced.
2. Any call to zil_commit() must wait for all ZIL blocks in its "batch"
to complete, prior to zil_commit() returning. The size of any given
batch is proportional to the number of ZIL transaction in the queue
at the time that the batch starts processing the queue; which
doesn't occur until the previous batch completes. Thus, if there's a
lot of transactions in the queue, the batch could be composed of
many ZIL blocks, and each call to zil_commit() will have to wait for
all of these writes to complete (even if the thread calling
zil_commit() only cared about one of the transactions in the batch).

Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Prakash Surya <prakash.surya@delphix.com>

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D12355
ontrib/opensolaris/cmd/ztest/ztest.c
aace45c367a807d3a0b6c260a3ef9e02d34586fe 25-Sep-2017 asomers <asomers@FreeBSD.org> Close a memory leak when using zpool_read_all_labels

MFC after: 3 weeks
X-MFC-With: 322854
Sponsored by: Spectra Logic Corp
sr.sbin/zfsd/zfsd_event.cc
116e85d29648e0ee6ef07be8f75760280b403d2a 20-Sep-2017 avg <avg@FreeBSD.org> MFV r323790: 8567 Inconsistent return value in zpool_read_label

illumos/illumos-gate@c861bfbd77c4ae780a0341e9cb6926d8b74341cf
https://github.com/illumos/illumos-gate/commit/c861bfbd77c4ae780a0341e9cb6926d8b74341cf

https://www.illumos.org/issues/8567
If fstat64 fails, pread64 fails, or the label is unintelligible,
zpool_read_label will return 0. But if malloc fails, it will return -1. For
consistency, it should always return -1 on failure or 0 on success.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Alan Somers <asomers@gmail.com>

MFC after: 2 weeks
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
b5037965380ea3748c4f3c7067bbe1da538cacbf 15-Sep-2017 bdrewery <bdrewery@FreeBSD.org> Fix the raise tests.

- The exit probe was not appropriately filtered to only the known pid so it
was firing on any random process that would exit rather the only the one
we cared about.
- The dtest script executes the tst.raise*.exe in the background from
POSIX sh without jobs control. POSIX mandates that SIGINT be set to
SIG_IGN in this case. The test executable never actually tested that
SIGINT could be caught despite trying to block and delay the signal.
So the SIGINT sent from raise() is never actually received since it
is ignored. This could be fixed by calling 'trap - INT' from dtest
before running the executable but I've opted to just use SIGUSR1
instead in these specific tests rather than adding more logic to
test that SIGINT is not ignored at startup.

These 2 issues meant that the tests would randomly work but only if a process
coincidentally exited during the test.

Reviewed by: markj
MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
ontrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise1.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise2.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/raise/tst.raise3.d
de927e701813ee43e67f8ddcb24f21b48c5f3f69 13-Sep-2017 avg <avg@FreeBSD.org> MFV r323527: 5815 libzpool's panic function doesn't set global panicstr, ::status not as useful

illumos/illumos-gate@fae6347731c9d3f46b26338313b0422927f29cf6
https://github.com/illumos/illumos-gate/commit/fae6347731c9d3f46b26338313b0422927f29cf6

https://www.illumos.org/issues/5815
When panic() is called from within ztest, the mdb ::status command isn't as
useful as it could be since the global panicstr variable isn't updated. We
should modify the function to make sure panicstr is set, so ::status can
present the error message just like it does on a failed assertion.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Rich Lowe <richlowe@richlowe.net>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Prakash Surya <prakash.surya@delphix.com>
MFC after: 4 weeks
ontrib/opensolaris/lib/libzpool/common/kernel.c
6a23a53f076ba6a48a29e0c4a47359d39f0e294d 13-Sep-2017 avg <avg@FreeBSD.org> MFV r323523: 8331 zfs_unshare returns wrong error code for smb unshare failure

illumos/illumos-gate@4f4378cc54b7deec3a35c529dc397dbdc325b4bb
https://github.com/illumos/illumos-gate/commit/4f4378cc54b7deec3a35c529dc397dbdc325b4bb

https://www.illumos.org/issues/8331
zfs_unshare returns EZFS_UNSHARENFSFAILED on error for all share types.

Reviewed by: Marcel Telka <marcel@telka.sk>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Andrew Stormont <astormont@racktopsystems.com>

MFC after: 4 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
9374568664f2db5473a09653af25e265624c610c 13-Sep-2017 avg <avg@FreeBSD.org> MFV r316932: 6280 libzfs: unshare_one() could fail with EZFS_SHARENFSFAILED

illumos/illumos-gate@d1672efb6feac57c42788e27f739dfa3c4f3baf7
https://github.com/illumos/illumos-gate/commit/d1672efb6feac57c42788e27f739dfa3c4f3baf7

https://www.illumos.org/issues/6280
The unshare_one() in libzfs could fail with EZFS_SHARENFSFAILED at line 834
here:
831 /* make sure libshare initialized */
832 if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) {
833 free(mntpt); /* don't need the copy anymore */
834 return (zfs_error_fmt(hdl, EZFS_SHARENFSFAILED,
835 dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"),
836 name, _sa_errorstr(err)));
837 }
The correct error should be EZFS_UNSHARENFSFAILED instead.

Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Marcel Telka <marcel.telka@nexenta.com>

MFC after: 4 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
240ab7522e1a591c8d8aa5f05a2f91526137e758 12-Sep-2017 lwhsu <lwhsu@FreeBSD.org> Fix DTrace test tst_inet_ntop_d: remove definitions are already in libdtrace

We have D definitions for the named values in socket.h after r323253. Remove
them in test script to prevent compiling failure.

Reviewed by: markj, gnn
Differential Revision: https://reviews.freebsd.org/D12334
ontrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.inet_ntop.d
ca4b280fefeacf1fe312b5e20e7f0346f8b85af8 12-Sep-2017 markj <markj@FreeBSD.org> Add a O_CLOEXEC use missed in r323166.

PR: 199810
Reported by: Jukka A. Ukkonen <jau789@gmail.com>
MFC after: 3 days
ontrib/opensolaris/lib/libdtrace/common/dt_open.c
bdc2324ede0d3df634d61bcc522a1a640c0417ea 09-Sep-2017 jonathan <jonathan@FreeBSD.org> Remove redundant source and object files.

Reviewed by: bdrewery, ngie
MFC after: 1 week
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12208
ib/libzpool/Makefile
2766e30c3a2e294c077f8910fb306c918998adc4 09-Sep-2017 avg <avg@FreeBSD.org> MFV r323107: 8414 Implemented zpool scrub pause/resume

illumos/illumos-gate@1702cce751c5cb7ead878d0205a6c90b027e3de8
https://github.com/illumos/illumos-gate/commit/1702cce751c5cb7ead878d0205a6c90b027e3de8

FreeBSD note: rather than merging the zpool.8 update I copied the zpool
scrub section from the illumos zpool.1m to FreeBSD zpool.8 almost
verbatim. Now that the illumos page uses the mdoc format, it was an
easier option. Perhaps the change is not in perfect compliance with the
FreeBSD style, but I think that it is acceptible.

https://www.illumos.org/issues/8414
This issue tracks the port of scrub pause from ZoL: https://github.com/zfsonlinux/zfs/pull/6167
Currently, there is no way to pause a scrub. Pausing may be useful when
the pool is busy with other I/O to preserve bandwidth.

Description

This patch adds the ability to pause and resume scrubbing. This is achieved
by maintaining a persistent on-disk scrub state. While the state is 'paused'
we do not scrub any more blocks. We do however perform regular scan
housekeeping such as freeing async destroyed and deadlist blocks while paused.

Motivation and Context

Scrub pausing can be an I/O intensive operation and people have been asking
for the ability to pause a scrub for a while. This allows one to preserve scrub
progress while freeing up bandwidth for other I/O.

Reviewed by: George Melikov <mail@gmelikov.ru>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Brad Lewis <brad.lewis@delphix.com>
Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Author: Alek Pinchuk <apinchuk@datto.com>

MFC after: 2 weeks
ontrib/opensolaris/cmd/zpool/zpool.8
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
ontrib/opensolaris/lib/libzfs/common/libzfs_util.c
b5fdd7f200eaeab0fa1aa1de6f99585d9000033d 07-Sep-2017 gnn <gnn@FreeBSD.org> Add D definitions for the named values in socket.h

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D12241
ib/libdtrace/Makefile
ib/libdtrace/socket.d
0556fabcd50f33acf259a510a3c940dbeb29d64a 05-Sep-2017 asomers <asomers@FreeBSD.org> Honor all options of "zfs mount -o"

The existing code in zmount incorrectly parses the comma-delimited option
string. The result is that nmount only honors the last option. AFAICT the
parsing has been broken ever since ZFS's initial import in change 168404.

PR: 222078
Reviewed by: avg
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D12232
ompat/opensolaris/misc/zmount.c
505863559785cfbae56d81fc6d2a6a610fd46746 05-Sep-2017 markj <markj@FreeBSD.org> Use O_CLOEXEC when opening persistent handles in libdtrace.

PR: 199810
Submitted by: jau@iki.fi
MFC after: 1 week
ontrib/opensolaris/lib/libdtrace/common/dt_open.c
c41928d2047274e18ee7673befd791b4fe2f9980 24-Aug-2017 asomers <asomers@FreeBSD.org> zfsd(8): Close a race condition when onlining a disk paritition

When inserting a partitioned disk, devfs and geom will announce the whole
disk before they announce the partition. If the partition containing ZFS
extends to one of the disk's extents, then zfsd will see a ZFS label on the
whole disk and attempt to online it. ZFS is smart enough to activate the
partition instead of the whole disk, but only if GEOM has already created
the partition's provider.

cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
Add a zpool_read_all_labels method. It's similar to
zpool_read_label, but it will return the number of labels found.

cddl/usr.sbin/zfsd/zfsd_event.cc
When processing a DevFS CREATE event, only online a VDEV if we can
read all four ZFS labels.

Reviewed by: mav
MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D11920
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
sr.sbin/zfsd/zfsd_event.cc
c74f78dcb4049a43533b7b99d4660a1e1369d95e 21-Aug-2017 markj <markj@FreeBSD.org> Use an updated copy of the CDDL header boilerplate from illumos.

Reported by: Yuri Pankov <yuripv@gmx.com>
X-MFC with: r322774
ontrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d
76db3ce91348a3a0122d9dc8458e66cc79d0d1b5 21-Aug-2017 markj <markj@FreeBSD.org> Add a regression test for r322773.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/llquantize/err.D_LLQUANT_MAGTOOBIG.offbyone.d
sr.sbin/dtrace/tests/common/llquantize/Makefile
95f65483b371f790d539583572d01733e1786217 21-Aug-2017 markj <markj@FreeBSD.org> Fix an off-by-two in the llquantize() action parameter validation.

The aggregation created by llquantize() partitions values into buckets; the
lower bound of the bucket containing the largest values is b^{m+1}, where
b and m are the second and fourth parameters to the action, respectively.
Bucket bounds are stored in a 64-bit integer, and so the llquantize()
validation checks need to verify that b^{m+1} fits in 64 bits. However, it
was only verifying that b^{m-1} fits in 64 bits, so certain parameter
combinations could trigger assertion failures in libdtrace.

PR: 219451
MFC after: 1 week
ontrib/opensolaris/lib/libdtrace/common/dt_cc.c
8d28842dec1bb528354b0cab03710e27925d1f88 08-Aug-2017 avg <avg@FreeBSD.org> MFV r322229: 7600 zfs rollback should pass target snapshot to kernel

illumos/illumos-gate@77b171372ed21642e04c873ef1e87fe2365520df
https://github.com/illumos/illumos-gate/commit/77b171372ed21642e04c873ef1e87fe2365520df

https://www.illumos.org/issues/7600
At present, the kernel side code seems to blindly rollback to whatever happens
to be the latest snapshot at the time when the rollback task is processed.
The expected target's name should be passed to the kernel driver and the sync
task should validate that the target exists and that it is the latest snapshot
indeed.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>

MFC after: 3 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
b0399601357efce1e5b792304a4cedede88017c2 08-Aug-2017 avg <avg@FreeBSD.org> MFV r322223: 8378 crash due to bp in-memory modification of nopwrite block

illumos/illumos-gate@b7edcb940884114e61382937505433c4c38c0278
https://github.com/illumos/illumos-gate/commit/b7edcb940884114e61382937505433c4c38c0278

https://www.illumos.org/issues/8378
The problem is that zfs_get_data() supplies a stale zgd_bp to dmu_sync(), which
we then nopwrite against.
zfs_get_data() doesn't hold any DMU-related locks, so after it copies db_blkptr
to zgd_bp, dbuf_write_ready()
could change db_blkptr, and dbuf_write_done() could remove the dirty record.
dmu_sync() then sees the stale
BP and that the dbuf it not dirty, so it is eligible for nop-writing.
The fix is for dmu_sync() to copy db_blkptr to zgd_bp after acquiring the
db_mtx. We could still see a stale
db_blkptr, but if it is stale then the dirty record will still exist and thus
we won't attempt to nopwrite.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

MFC after: 2 weeks
ontrib/opensolaris/cmd/ztest/ztest.c
32d36ad8111727083e281f4c69435f2b131aea74 08-Aug-2017 avg <avg@FreeBSD.org> MFV r322217: 8418 zfs_prop_get_table() call in zfs_validate_name() is a no-op

illumos/illumos-gate@e09ba01dcda5e24964b8632718777b39166d86e4
https://github.com/illumos/illumos-gate/commit/e09ba01dcda5e24964b8632718777b39166d86e4

https://www.illumos.org/issues/8418
The following line in zfs_validate_name() is just a no-op and it
should be removed:
108 (void) zfs_prop_get_table();

Reviewed by: Vitaliy Gusev <gusev.vitaliy@icloud.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Marcel Telka <marcel@telka.sk>

MFC after: 2 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
3364e8aea957b8f29913ef5da0c80f4081ffad76 07-Aug-2017 br <br@FreeBSD.org> o Replace __riscv__ with __riscv
o Replace __riscv64 with (__riscv && __riscv_xlen == 64)

This is required to support new GCC 7.1 compiler.
This is compatible with current GCC 6.1 compiler.

RISC-V is extensible ISA and the idea here is to have built-in define
per each extension, so together with __riscv we will have some subset
of these as well (depending on -march string passed to compiler):

__riscv_compressed
__riscv_atomic
__riscv_mul
__riscv_div
__riscv_muldiv
__riscv_fdiv
__riscv_fsqrt
__riscv_float_abi_soft
__riscv_float_abi_single
__riscv_float_abi_double
__riscv_cmodel_medlow
__riscv_cmodel_medany
__riscv_cmodel_pic
__riscv_xlen

Reviewed by: ngie
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D11901
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
ontrib/opensolaris/lib/libdtrace/common/dt_printf.c
09b1c6f0302e2c24a1537afd0cd7c1ce0ed6999b 03-Aug-2017 markj <markj@FreeBSD.org> Rework and simplify the ksyms(4) implementation.

- Store the symbol table contents in an anonymous swap-backed object. Have
mmap(/dev/ksyms) map that object, and stop mapping the symbol table into
the calling process in ksyms_open(). Previously we would cache a pointer
to the pmap of the opening process, and mmap(/dev/ksyms) would create a
mapping using the physical address found by a pmap lookup at the initial
mapping address. However, this assumes that the cached pmap is valid,
which may not be the case. [1]
- Remove the ksyms ioctl interface. It appears to have been added to work
around a limitation in libelf that no longer exists; see r321842.
Moreover, the interface is difficult to support and isn't present in
illumos. Since ksyms was added specifically to support lockstat(1), it
is expected that this removal won't have any real impact.
- Simplify ksyms_read() to avoid unnecessary copying.
- Don't call the device handle destructor if we fail to capture a snapshot
of the kernel's symbol table. devfs will do that for us.

Reported by: Ilja van Sprundel <ivansprundel@ioactive.com> [1]
Reviewed by: kib (previous revision)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11789
ontrib/opensolaris/cmd/lockstat/sym.c
5ce01a6461f7f9c97c167c0bf1052a418bce8ea2 02-Aug-2017 mav <mav@FreeBSD.org> Add compat shim part missed at r305197.

This fixes compatibility between old kernel and new ZFS tools.
It seems to be tradition to forget it. :(

PR: 221112
MFC after: 3 days
ontrib/opensolaris/lib/libzfs/common/libzfs_compat.c
d810089ddfa9009702539432f1fa6be18574a3b9 02-Aug-2017 ngie <ngie@FreeBSD.org> Convert traditional ${MK_TESTS} conditional idiom for including test
directories to SUBDIR.${MK_TESTS} idiom

This is being done to pave the way for future work (and homogenity) in
^/projects/make-check-sandbox .

No functional change intended.

MFC after: 1 weeks
akefile
ib/Makefile
bin/Makefile
sr.bin/Makefile
sr.sbin/Makefile
03eee82f1833a157e13fabd8ef368c8a95718a85 01-Aug-2017 markj <markj@FreeBSD.org> Remove local variables missed in r321842.

X-MFC with: r321842
ontrib/opensolaris/cmd/lockstat/sym.c
d7b05ab2a81dc1d96d5dd9c718fdfbb2a19767a8 01-Aug-2017 markj <markj@FreeBSD.org> Let lockstat use ksyms(4)'s mmap interface.

The workaround described in the deleted comment is no longer needed.

MFC after: 1 week
ontrib/opensolaris/cmd/lockstat/sym.c
f5c1cebc769e57197711fe492b6afd4415556772 26-Jul-2017 lwhsu <lwhsu@FreeBSD.org> Add an auxiliary subroutine to generate some events for testing

This test is also timeout on a quiet system because there is nobody triggering
read probefunc while test execution.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11731
ontrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh
dbd5eba188700b9bdc5c8f26b99e6f4b36b6aad7 25-Jul-2017 lwhsu <lwhsu@FreeBSD.org> The test case common.funcs.t_dtrace_contrib.tst_basename_d generates a
verifying script which needs being run to complete the test.

While here, add missing shebang.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11716
sr.sbin/dtrace/tests/tools/dtest.sh
ec1b8c7370affafcc048967955057920cdeddbc1 25-Jul-2017 lwhsu <lwhsu@FreeBSD.org> Modify glob patterns and expected output to match FreeBSD's implementation.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11713
ontrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.macroglob.ksh.out
d5ad43212408f806df4d7742e5dae9b32c51be03 25-Jul-2017 lwhsu <lwhsu@FreeBSD.org> Make this test case accepts basename() in D script returns "" or "."

In Solaris, basename(1) and basename(3) both return "." while being given an
empty string (""), while in BSD (and Linux) basename(1) returns "" and
basename(3) returns "."

While here, also change #!/usr/bin/ksh to #!/usr/bin/env ksh to find ksh in
$PATH

Reviewed by: gnn, markj (earlier version), ngie (earlier version)
Differential Revision: https://reviews.freebsd.org/D11707
ontrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d.out
2ed898c192f9f4945e4642b609fab13f6f2e8bf1 25-Jul-2017 lwhsu <lwhsu@FreeBSD.org> Explicitly set dynamic variable buffer size.

We added too many variable assignments in BEGIN block, which will run out of
default auto-configured variable buffer space. The test VM has 4G RAM which
should be enough for most cases so it's reasonable to increase limitation to
these case.

Reviewed by: gnn
Differential Revision: https://reviews.freebsd.org/D11676
ontrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.basename.d
9ca0e7dfed6176379153a71091d6806bcced9e87 25-Jul-2017 lwhsu <lwhsu@FreeBSD.org> Explicitly set dynamic variable buffer size.

We added too many variable assignments in BEGIN block, which will run out of
default auto-configured variable buffer space. The test VM has 4G RAM which
should be enough for most cases so it's reasonable to increase limitation to
these case.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11674
ontrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.cleanpath.d
b5973ba50b86d08f56e8f2eeed785e6fcc5639dc 25-Jul-2017 lwhsu <lwhsu@FreeBSD.org> Add an auxiliary subroutine to generate read(2) event while testing.

Reviewed by: gnn, ngie
Differential Revision: https://reviews.freebsd.org/D11673
ontrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh
27420d2f2a696b43bddffe52dd5a691db3d45ecb 25-Jul-2017 lwhsu <lwhsu@FreeBSD.org> Add a simple script which calls open(2) and others to generate events for
testing.

This test times-out on a quiet system because there is nobody triggers
syscall::open:entry or syscall::: probe while test execution.

Reviewed by: gnn, markj (earlier version)
Differential Revision: https://reviews.freebsd.org/D11671
ontrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/speculation/tst.NoSpecBuffer.exe
sr.sbin/dtrace/tests/common/speculation/Makefile
3e47a7315b4da27cb3a1b9faed5f628606f4016e 25-Jul-2017 lwhsu <lwhsu@FreeBSD.org> Add a simple program which calls sigtimedwait(2) to generate events for testing

This test timeout on a quiet system because there is nobody triggers
'syscall::*wait*:entry' probe while test execution.

Reviewed by: gnn, markj, ngie
Differential Revision: https://reviews.freebsd.org/D11668
ontrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.d
sr.sbin/dtrace/tests/common/probes/Makefile
4b685d2dc0cd822ef9b22f4cfa7bb92987dcb192 24-Jul-2017 ngie <ngie@FreeBSD.org> Fix whitespace on a line in fix(..) accidentally missed in r321424

MFC after: 1 month
MFC with: r321424
ontrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl
7b13da675f515fd06cb3e720a45d8b6c0e195339 24-Jul-2017 ngie <ngie@FreeBSD.org> Style cleanup: delete spurious trailing whitespace

MFC after: 1 month
ontrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl
e0a576c245be234ce5925c3a089f234e0ef961f2 23-Jul-2017 ngie <ngie@FreeBSD.org> Don't use incorrect hardcoded path to ksh -- use /usr/bin/env
to find ksh instead

MFC after: 1 month
ontrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/man.CoalesceTrace.d
d68608959becd022b5de5006f07e70c112c81939 20-Jun-2017 asomers <asomers@FreeBSD.org> zfsd(8): Remove pidfile on shutdown

MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
sr.sbin/zfsd/zfsd.cc
6abbaac4b6ef0e4c0f5b3dee63614fcd63cc31b9 20-Jun-2017 avg <avg@FreeBSD.org> MFV r318946: 8021 ARC buf data scatter-ization

illumos/illumos-gate@770499e185d15678ccb0be57ebc626ad18d93383
https://github.com/illumos/illumos-gate/commit/770499e185d15678ccb0be57ebc626ad18d93383

https://www.illumos.org/issues/8021
The ARC buf data project (known simply as "ABD" since its genesis in the ZoL
community) changes the way the ARC allocates `b_pdata` memory from using linear
`void *` buffers to using scatter/gather lists of fixed-size 1KB chunks. This
improves ZFS's performance by helping to defragment the address space occupied
by the ARC, in particular for cases where compressed ARC is enabled. It could
also ease future work to allocate pages directly from `segkpm` for minimal-
overhead memory allocations, bypassing the `kmem` subsystem.
This is essentially the same change as the one which recently landed in ZFS on
Linux, although they made some platform-specific changes while adapting this
work to their codebase:
1. Implemented the equivalent of the `segkpm` suggestion for future work
mentioned above to bypass issues that they've had with the Linux kernel memory
allocator.
2. Changed the internal representation of the ABD's scatter/gather list so it
could be used to pass I/O directly into Linux block device drivers. (This
feature is not available in the illumos block device interface yet.)

FreeBSD notes:
- the actual (default) chunk size is 4KB (despite the text above saying 1KB)
- we can try to reimplement ABDs, so that they are not permanently
mapped into the KVA unless explicitly requested, especially on
platforms with scarce KVA
- we can try to use unmapped I/O and avoid intermediate allocation of a
linear, virtual memory mapped buffer
- we can try to avoid extra data copying by referring to chunks / pages
in the original ABD

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Chris Williamson <chris.williamson@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Dan Kimmel <dan.kimmel@delphix.com>

MFC after: 3 weeks
6c4b8e235bbf2d6f17b83b33c58ac99aced520c3 19-Jun-2017 bdrewery <bdrewery@FreeBSD.org> Utilize SYSROOT from r320119 in places where DESTDIR may be wanting WORLDTMP.

Since buildenv exports SYSROOT all of these uses will now look in
WORLDTMP by default.

sys/boot/efi/loader/Makefile
A LIBSTAND hack is no longer required for buildenv.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
sr.sbin/zfsd/tests/Makefile
108de14f1d790cf15b24c8f959d0b55a6468230c 14-Jun-2017 avg <avg@FreeBSD.org> MFV r319945,r319946: 8264 want support for promoting datasets in libzfs_core

illumos/illumos-gate@a4b8c9aa65a0a735aba318024a424a90d7b06c37
https://github.com/illumos/illumos-gate/commit/a4b8c9aa65a0a735aba318024a424a90d7b06c37

https://www.illumos.org/issues/8264
Oddly there is a lzc_clone function, but no lzc_promote function.

Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@kebe.com>
Approved by: Dan McDonald <danmcd@kebe.com>
Author: Andrew Stormont <astormont@racktopsystems.com>
MFC after: 1 week
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
435f967468c9da1164d1268e739e473d07e142db 10-Jun-2017 markj <markj@FreeBSD.org> Override the locale so that file lists get a consistent sort order.

Reported by: avg
MFC after: 1 week
sr.sbin/dtrace/tests/tools/genmakefiles.sh
1d9822a04fecf08ff967f58b8a8eaf7fcebb1f4c 10-Jun-2017 avg <avg@FreeBSD.org> follow up to r319746: add the new test files to the make file

Reported by: markj
MFC after: 2 days
X-MFC with: r319746
sr.sbin/dtrace/tests/common/aggs/Makefile
4ac11ff78dc1526ccbe6be8c1cbf260f36566cac 09-Jun-2017 avg <avg@FreeBSD.org> MFV r319740: 8168 NULL pointer dereference in zfs_create()

illumos/illumos-gate@690031d326342fa4ea28b5e80f1ad6a16281519d
https://github.com/illumos/illumos-gate/commit/690031d326342fa4ea28b5e80f1ad6a16281519d

https://www.illumos.org/issues/8168
If we manage to export the pool on which we are creating a dataset (filesystem
or zvol) between entering libzfs`zfs_create() and libzfs`zpool_open() call (for
which we never check the return value) we end up dereferencing a NULL pointer
in libzfs`zpool_close().
This was discovered on ZFS on Linux. The same issue can be reproduced on
Illumos running in parallel:
while :; do zpool import -d /tmp testpool ; zpool export testpool ; done
while :; do zfs create testpool/fs; zfs destroy testpool/fs ; done
Eventually this will result in several core dumps like this one:
[root@52-54-00-d3-7a-01 /cores]# mdb core.zfs.4244
Loading modules: [ libumem.so.1 libc.so.1 libtopo.so.1 libavl.so.1
libnvpair.so.1 ld.so.1 ]
> ::stack
libzfs.so.1`zpool_close+0x17(0, 0, 0, 8047450)
libzfs.so.1`zfs_create+0x1bb(8090548, 8047e6f, 1, 808cba8)
zfs_do_create+0x545(2, 8047d74, 80778a0, 801, 0, 3)
main+0x22c(8047d2c, fef5c6e8, 8047d64, 8055a17, 3, 8047d70)
_start+0x83(3, 8047e64, 8047e68, 8047e6f, 0, 8047e7b)
>
Fix and reproducer (systemtap): https://github.com/zfsonlinux/zfs/pull/6096

Reviewed by: Matt Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: loli10K <ezomori.nozomu@gmail.com>
MFC after: 2 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
b394e6b3ddcfe175866494e95f79cfbb9f8a5634 09-Jun-2017 avg <avg@FreeBSD.org> MFV r319744,r319745: 8269 dtrace stddev aggregation is normalized incorrectly

illumos/illumos-gate@79809f9cf402f130667349b2d4007ecd65d63c6f
https://github.com/illumos/illumos-gate/commit/79809f9cf402f130667349b2d4007ecd65d63c6f

https://www.illumos.org/issues/8269
It seems that currently normalization of stddev aggregation is done
incorrectly.
We divide both the sum of values and the sum of their squares by the
normalization factor. But we should divide the sum of squares by the
normalization factor squared to scale the original values properly.

FreeBSD note: the actual change was committed in r316853, this commit
adds the test files and record merge information.

Reviewed by: Bryan Cantrill <bryan@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@FreeBSD.org>
MFC after: 1 week
Sponsored by: Panzura
75a89d09a76e247640d8ab5d93592ee7badc067c 08-Jun-2017 allanjude <allanjude@FreeBSD.org> New sentences start on new lines, fix two violations

Reviewed by: bcr
Sponsored by: BSDCan Dev Summit
ontrib/opensolaris/cmd/zpool/zpool-features.7
6f07fabcb880be213cb1b1df20bf6d76add4b428 08-Jun-2017 allanjude <allanjude@FreeBSD.org> SHA-512 and Skein have been supported by the boot loader for some time.

Submitted by: lifanov
Reviewed by: bcr
Sponsored by: BSDCan Dev Summit
ontrib/opensolaris/cmd/zpool/zpool-features.7
a992558c50ac23c49e8c1d52680fc0349c55374c 24-May-2017 avg <avg@FreeBSD.org> MFV r316922: 5380 receive of a send -p stream doesn't need to try renaming snapshots

illumos/illumos-gate@471a88e499c660844f4590487ce7c4d5a7090294
https://github.com/illumos/illumos-gate/commit/471a88e499c660844f4590487ce7c4d5a7090294

https://www.illumos.org/issues/5380
A stream created with zfs send -p -I contains properties of all snapshots of a
given dataset as opposed to only properties of snapshots in a given range.
Not only this is suboptimal but the receive code also does not filter
properties by the range. So, properties of earlier snapshots would be updated
even though the snapshots themselves are not in the stream (just their
properties).
Given that modifying the snapshot properties requires a TXG sync and that the
snapshots are updated one by one the described behavior may lead to a sever
performance penalty.

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Andriy Gapon <avg@FreeBSD.org>
MFC after: 3 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
58941b0245fd8d3d5861206a07477e18635eafec 24-May-2017 avg <avg@FreeBSD.org> MFC r316908: 7541 zpool import/tryimport ioctl returns ENOMEM because provided buffer is too small for config

illumos/illumos-gate@8b65a70b763232c90a91f31eb2010314c02ed338
https://github.com/illumos/illumos-gate/commit/8b65a70b763232c90a91f31eb2010314c02ed338

https://www.illumos.org/issues/7541
When calling zpool import, zpool does a few ioctls to ZFS.
zpool allocates a buffer in userland and passes it to the kernel so that ZFS
can copy info into it. ZFS will use it to put the nvlist that describes the
pool configuration.
If the allocated buffer is too small, ZFS will return ENOMEM and the call will
have to be redone. This wastes CPU time and slows down the import process. This
happens very often for the ZFS_IOC_POOL_TRYIMPORT call.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
MFC after: 2 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_impl.h
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
04f9183a0c409391f33d5f05dbe03294eb7861f1 24-May-2017 avg <avg@FreeBSD.org> MFC r316904: 7729 libzfs_core`lzc_rollback() leaks result nvl

illumos/illumos-gate@ac428481f96be89add7a1edf43ae47dd71038553
https://github.com/illumos/illumos-gate/commit/ac428481f96be89add7a1edf43ae47dd71038553

https://www.illumos.org/issues/7729
libzfs_core`lzc_rollback() doesn't free the result nvl after lzc_ioctl() call.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>

MFC after: 2 weeks
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
980be3f7ab2c3ae02d0b7cc60af132676da22be4 24-May-2017 avg <avg@FreeBSD.org> MFV r316860: 7545 zdb should disable reference tracking

illumos/illumos-gate@4dd77f9e38ef05b39db128ff7608d926fd3218c6
https://github.com/illumos/illumos-gate/commit/4dd77f9e38ef05b39db128ff7608d926fd3218c6

https://www.illumos.org/issues/7545
When evicting from the ARC, we manipulate some refcount_t's, e.g. arcs_size.
When using zdb to examine a large amount of data (e.g. zdb -bb on a large pool
with small blocks), the ARC may have a large number of entries. If reference
tracking is enabled, there will be ~1 reference for each block in the ARC. When
evicting, we decrement the refcount and have to search all the references to
find the one that we are removing, which is very slow.
Since zdb is typically used to find problems with the on-disk format, and not
with the code it is running, we should disable reference tracking in zdb.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Steve Gonczi <steve.gonczi@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>

MFC after: 2 weeks
ontrib/opensolaris/cmd/zdb/zdb.c
e75ba1d5c4c79376a78351c8544388491db49664 23-May-2017 kib <kib@FreeBSD.org> Commit the 64-bit inode project.

Extend the ino_t, dev_t, nlink_t types to 64-bit ints. Modify
struct dirent layout to add d_off, increase the size of d_fileno
to 64-bits, increase the size of d_namlen to 16-bits, and change
the required alignment. Increase struct statfs f_mntfromname[] and
f_mntonname[] array length MNAMELEN to 1024.

ABI breakage is mitigated by providing compatibility using versioned
symbols, ingenious use of the existing padding in structures, and
by employing other tricks. Unfortunately, not everything can be
fixed, especially outside the base system. For instance, third-party
APIs which pass struct stat around are broken in backward and
forward incompatible ways.

Kinfo sysctl MIBs ABI is changed in backward-compatible way, but
there is no general mechanism to handle other sysctl MIBS which
return structures where the layout has changed. It was considered
that the breakage is either in the management interfaces, where we
usually allow ABI slip, or is not important.

Struct xvnode changed layout, no compat shims are provided.

For struct xtty, dev_t tty device member was reduced to uint32_t.
It was decided that keeping ABI compat in this case is more useful
than reporting 64-bit dev_t, for the sake of pstat.

Update note: strictly follow the instructions in UPDATING. Build
and install the new kernel with COMPAT_FREEBSD11 option enabled,
then reboot, and only then install new world.

Credits: The 64-bit inode project, also known as ino64, started life
many years ago as a project by Gleb Kurtsou (gleb). Kirk McKusick
(mckusick) then picked up and updated the patch, and acted as a
flag-waver. Feedback, suggestions, and discussions were carried
by Ed Maste (emaste), John Baldwin (jhb), Jilles Tjoelker (jilles),
and Rick Macklem (rmacklem). Kris Moore (kris) performed an initial
ports investigation followed by an exp-run by Antoine Brodin (antoine).
Essential and all-embracing testing was done by Peter Holm (pho).
The heavy lifting of coordinating all these efforts and bringing the
project to completion were done by Konstantin Belousov (kib).

Sponsored by: The FreeBSD Foundation (emaste, kib)
Differential revision: https://reviews.freebsd.org/D10439
ib/libzfs/Makefile
ee8a80551dbe707c013a5c90d7559db340af078b 22-May-2017 markj <markj@FreeBSD.org> Add a little helper program for tst.exitcore.ksh.

sleep(1) is capsicumized, which means that we cannot rely on it to dump
core as required by the test.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
ontrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitcore.ksh
sr.sbin/dtrace/tests/common/proc/Makefile
a2dbb0a726079b762214c47924c38ef2c07478a8 19-May-2017 mav <mav@FreeBSD.org> Fix time handling in cv_timedwait_hires().

pthread_cond_timedwait() receives absolute time, not relative. Passing
wrong time there caused two threads of zdb to spin in a tight loop.

MFC after: 1 week
ontrib/opensolaris/lib/libzpool/common/kernel.c
af3c4c468be835eb0559bb8809bb072ffc427599 19-May-2017 markj <markj@FreeBSD.org> Remove the EXFAIL annotation for tests which pass as of r309596.

Reported by: bdrewery
Sponsored by: Dell EMC Isilon
sr.sbin/dtrace/tests/tools/exclude.sh
971af291bf7b8e11ba1f5a4909af3bc842f0ee7c 25-Apr-2017 jpaetzel <jpaetzel@FreeBSD.org> MFV 316894

7252 7628 compressed zfs send / receive

illumos/illumos-gate@5602294fda888d923d57a78bafdaf48ae6223dea
https://github.com/illumos/illumos-gate/commit/5602294fda888d923d57a78bafdaf48ae6223dea

https://www.illumos.org/issues/7252
This feature includes code to allow a system with compressed ARC enabled to
send data in its compressed form straight out of the ARC, and receive data in
its compressed form directly into the ARC.

https://www.illumos.org/issues/7628
We should have longer, more readable versions of the ZFS send / recv options.

7628 create long versions of ZFS send / receive options

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: David Quigley <dpquigl@davequigley.com>
Reviewed by: Thomas Caputi <tcaputi@datto.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Dan Kimmel <dan.kimmel@delphix.com>
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/cmd/zstreamdump/zstreamdump.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
ed5fb51b5b9a1882876c1c6f2f7b83298d319226 21-Apr-2017 jpaetzel <jpaetzel@FreeBSD.org> MFV 316891

7386 zfs get does not work properly with bookmarks

illumos/illumos-gate@edb901aab9c738b5eb15aa55933e82b0f2f9d9a2
https://github.com/illumos/illumos-gate/commit/edb901aab9c738b5eb15aa55933e82b0f2f9d9a2

https://www.illumos.org/issues/7386
The zfs get command does not work with the bookmark parameter while it works
properly with both filesystem and snapshot:
# zfs get -t all -r creation rpool/test
NAME PROPERTY VALUE SOURCE
rpool/test creation Fri Sep 16 15:00 2016 -
rpool/test@snap creation Fri Sep 16 15:00 2016 -
rpool/test#bkmark creation Fri Sep 16 15:00 2016 -
# zfs get -t all -r creation rpool/test@snap
NAME PROPERTY VALUE SOURCE
rpool/test@snap creation Fri Sep 16 15:00 2016 -
# zfs get -t all -r creation rpool/test#bkmark
cannot open 'rpool/test#bkmark': invalid dataset name
#
The zfs get command should be modified to work properly with bookmarks too.

Reviewed by: Simon Klinkert <simon.klinkert@gmail.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Marcel Telka <marcel@telka.sk>
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
ontrib/opensolaris/lib/libzfs/common/libzfs_util.c
0d4e4c11fe607f362931c38ca72e0e551da638be 14-Apr-2017 asomers <asomers@FreeBSD.org> MFV 316855

7900 zdb shouldn't print the path of a znode at verbosity < 5

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Alan Somers <asomers@freebsd.org>

illumos/illumos-gate@e548d2fa41d1baa06662ed9abbb8bcec86e27dd9
https://www.illumos.org/issues/7900

MFC after: 3 weeks
Sponsored by: Spectra Logic Corp
ontrib/opensolaris/cmd/zdb/zdb.c
d4f3fbb9d3b7f5e98aaed4c9427063aaa012e287 14-Apr-2017 avg <avg@FreeBSD.org> dtrace: fix normalization of stddev aggregation

To be upstreamed.

Discussed with: Bryan Cantrill <bryancantrill@gmail.com>
MFC after: 2 weeks
Sponsored by: Panzura
ontrib/opensolaris/lib/libdtrace/common/dt_consume.c
3183e3dd636ed0badf9ef26e0d7ce7db474bd4f8 10-Apr-2017 pfg <pfg@FreeBSD.org> MFV r316693:
8046 Let calloc() do the multiplication in libzfs_fru_refresh

https://github.com/illumos/illumos-gate/commit/5697e03e6e3e2697f56ae341c7c8ce79680d6a2e

https://www.illumos.org/issues/8046

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Pedro Giffuni <pfg@freebsd.org>

MFC after: 3 days
ontrib/opensolaris/lib/libzfs/common/libzfs_fru.c
ee44db682f3c4ec36b681b79d344b7b5c36e173b 24-Mar-2017 mav <mav@FreeBSD.org> MFV r315290, r315291: 7303 dynamic metaslab selection

illumos/illumos-gate@8363e80ae72609660f6090766ca8c2c18aa53f0c
https://github.com/illumos/illumos-gate/commit/8363e80ae72609660f6090766ca8c2c18

https://www.illumos.org/issues/7303

This change introduces a new weighting algorithm to improve metaslab selection.
The new weighting algorithm relies on the SPACEMAP_HISTOGRAM feature. As a result,
the metaslab weight now encodes the type of weighting algorithm used
(size-based vs segment-based).

This also introduce a new allocation tracing facility and two new dcmds to help
debug allocation problems. Each zio now contains a zio_alloc_list_t structure
that is populated as the zio goes through the allocations stage. Here's an
example of how to use the tracing facility:

> c5ec000::print zio_t io_alloc_list | ::walk list | ::metaslab_trace
MSID DVA ASIZE WEIGHT RESULT VDEV
- 0 400 0 NOT_ALLOCATABLE ztest.0a
- 0 400 0 NOT_ALLOCATABLE ztest.0a
- 0 400 0 ENOSPC ztest.0a
- 0 200 0 NOT_ALLOCATABLE ztest.0a
- 0 200 0 NOT_ALLOCATABLE ztest.0a
- 0 200 0 ENOSPC ztest.0a
1 0 400 1 x 8M 17b1a00 ztest.0a

> 1ff2400::print zio_t io_alloc_list | ::walk list | ::metaslab_trace
MSID DVA ASIZE WEIGHT RESULT VDEV
- 0 200 0 NOT_ALLOCATABLE mirror-2
- 0 200 0 NOT_ALLOCATABLE mirror-0
1 0 200 1 x 4M 112ae00 mirror-1
- 1 200 0 NOT_ALLOCATABLE mirror-2
- 1 200 0 NOT_ALLOCATABLE mirror-0
1 1 200 1 x 4M 112b000 mirror-1
- 2 200 0 NOT_ALLOCATABLE mirror-2

If the metaslab is using segment-based weighting then the WEIGHT column will
display the number of segments available in the bucket where the allocation
attempt was made.

Author: George Wilson <george.wilson@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Chris Siden <christopher.siden@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Don Brady <don.brady@intel.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/ztest/ztest.c
ontrib/opensolaris/lib/libzpool/common/kernel.c
3c852a3154317ada8020119e509ff9bed9c15629 04-Mar-2017 ngie <ngie@FreeBSD.org> cddl: normalize paths using SRCTOP-relative paths or :H when possible

This simplifies make logic/output

While here, remove bogus CFLAGS which look for headers in cddl/lib/libumem.
There aren't any source files there (just Makefiles)

MFC after: 1 month
Sponsored by: Dell EMC Isilon
ib/drti/Makefile
ib/libavl/Makefile
ib/libctf/Makefile
ib/libdtrace/Makefile
ib/libnvpair/Makefile
ib/libumem/Makefile
ib/libuutil/Makefile
ib/libzfs/Makefile
ib/libzfs_core/Makefile
ib/libzpool/Makefile
bin/zfs/Makefile
bin/zpool/Makefile
sr.bin/ctfconvert/Makefile
sr.bin/ctfdump/Makefile
sr.bin/ctfmerge/Makefile
sr.bin/zinject/Makefile
sr.bin/zlook/Makefile
sr.bin/zstreamdump/Makefile
sr.bin/ztest/Makefile
sr.sbin/dtrace/Makefile
sr.sbin/lockstat/Makefile
sr.sbin/plockstat/Makefile
sr.sbin/zdb/Makefile
sr.sbin/zhack/Makefile
424059c127304cc33f6dde5fb4b9127f9fcff072 23-Feb-2017 markj <markj@FreeBSD.org> Fix memory leaks in error cases in libdtrace.

Submitted by: Tom Rix <trix@juniper.net>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D9705
ontrib/opensolaris/lib/libdtrace/common/dt_open.c
ontrib/opensolaris/lib/libdtrace/common/dt_strtab.c
b5b9355084267847d104d1f00288673489ac4e83 23-Feb-2017 markj <markj@FreeBSD.org> Fix a memory leak in an error case in libctf.

Submitted by: Tom Rix <trix@juniper.net>
MFC after: 1 week
ontrib/opensolaris/lib/libctf/common/ctf_lib.c
61246eafd131768698623308e471820b8672ab7f 10-Feb-2017 markj <markj@FreeBSD.org> When patching USDT probes, use non-unique names for aliases of weak symbols.

Aliases are normally given names that include a key that's unique for each
input object file. This, for example, ensures that aliases for identically
named local symbols in different object files don't conflict. However, in
some cases the static linker will leave an undefined alias after merging
identical weak symbols, resulting in a link error. A non-unique name allows
the aliases to be merged as well.

PR: 216871
X-MFC With: r313262
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
e81aaa91dececa07d6c6d01066a82a13085eee21 05-Feb-2017 markj <markj@FreeBSD.org> Search for _DTRACE_VERSION in sys/sdt.h rather than unistd.h.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh
5e08a774195983e21c77ab8914722b053977e6d6 05-Feb-2017 markj <markj@FreeBSD.org> Avoid using Sun compiler-specific flags.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh
c4ef3076cf72e5c6f172f4bb6177aaf1c295c460 05-Feb-2017 markj <markj@FreeBSD.org> Fix a double free of libelf data buffers in the USDT link code.

libdtrace needs to append to the input object files' string and symbol
tables. Currently it does so by allocating a larger buffer, copying the
existing sections into them, and swapping pointers in the libelf data
descriptors. However, it also frees those buffers when its processing is
complete, which leads to a double free since the elftoolchain libelf
owns them and also frees them in elf_end(3). Instead, free the buffers
originally allocated by libelf.

MFC after: 2 weeks
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
d879975195aa1d0b434177f3a2f355d74a2d4f10 05-Feb-2017 markj <markj@FreeBSD.org> Use PC-relative relocations for USDT probe sites on i386 and amd64.

When recording probe site addresses in the output DOF file, dtrace -G
needs to emit relocations for the .SUNW_dof section in order to obtain
the addresses of functions containing probe sites. DTrace expects the
addresses to be relative to the base address of the final ELF file,
and the amd64 USDT implementation was relying on some unspecified and
incorrect behaviour in the base system GNU ld to achieve this.

This change reimplements the probe site relocation handling to allow
USDT to be used with lld and newer GNU binutils. Specifically, it
makes use of R_X86_64_PC64/R_386_PC32 relocations to obtain the
probe site address relative to the DOF file address, and adds and uses a
new DOF relocation type which computes the final probe site address using
these relative offsets.

Reported by and discussed with: Rafael Espíndola
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D9374
ontrib/opensolaris/lib/libdtrace/common/dt_dof.c
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
ontrib/opensolaris/lib/libdtrace/common/dt_provider.c
5354226f974d09c3e1c1cade235cd3ec44f90b77 01-Feb-2017 gnn <gnn@FreeBSD.org> Add an mbuf to ipinfo_t translator to finish cleanup of mbuf passing to TCP probes.

Reviewed by: markj
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D9401
ib/libdtrace/ip.d
d5577aec9ccfd5e8a71032051f26a59bd3336f6d 18-Jan-2017 asomers <asomers@FreeBSD.org> Fix an unchecked return value in zfsd

It's pretty unlikely to actually hit this, but good to check it anyway

Reported by: Coverity
CID: 1362018
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
sr.sbin/zfsd/case_file.cc
382a962c264bb9c8fb26de8310443dbe4e271748 29-Dec-2016 ae <ae@FreeBSD.org> Convert ipv4_flags and ipv4_offset fields into host byte order.
Also save only high bits in the ipv4_flags, because it is defined
as uint8_t. So now it will show DF and MF flags as 0x40 and 0x20.

Reviewed by: markj@
MFC after: 1 week
ib/libdtrace/ip.d
bdbe7eaee6d095d91694b16f10fd0c3b90c0de20 20-Dec-2016 markj <markj@FreeBSD.org> Avoid modifying the object string table when patching USDT probes.

dtrace converts pairs of consecutive underscores in a probe name to dashes.
When dtrace -G processes relocations corresponding to USDT probe sites, it
performs this conversion on the corresponding symbol names prior to looking
up the resulting probe names in the USDT provider definition. However, in
so doing it would actually modify the input object's string table, which
breaks the string suffix merging done by recent binutils. Because we don't
care about the symbol name once the probe site is recorded, just perform the
probe lookup using a temporary copy.

Reported by: hrs, swills
MFC after: 3 weeks
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
182fae62921821d17ebba466718f5b4b3313bcc7 20-Dec-2016 markj <markj@FreeBSD.org> Consistently print D variable indices in decimal when disassembling.

MFC after: 1 week
ontrib/opensolaris/lib/libdtrace/common/dt_dis.c
0d4f878b465ede19c6978a43250b686f65b48037 14-Dec-2016 markj <markj@FreeBSD.org> Skip a ustack test that triggers an assertion on INVARIANTS kernels.

Reported by: ngie
Sponsored by: Dell EMC Isilon
X-MFC-With: r309698
sr.sbin/dtrace/tests/tools/exclude.sh
44f636d610407662067d7988291ffeba7cec3902 08-Dec-2016 markj <markj@FreeBSD.org> err.D_PROC_CREATEFAIL.many.d passes, so remove the EFAIL annotation.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
sr.sbin/dtrace/tests/tools/exclude.sh
0ec6d3190b8c2d134826b02745b4ab951a5ababd 07-Dec-2016 markj <markj@FreeBSD.org> Use the correct path to date(1).

MFC after: 1 week
Sponsored by: Dell EMC Isilon
ontrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh
03e5175f9d4aff4c983bbc37d4cd8b1b9ca7840e 07-Dec-2016 markj <markj@FreeBSD.org> Use the native data model instead of forcing ILP32 in tst.provregex3.ksh.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh
c9f66bbdde05b4949407af2fa979ac699a9a26d7 07-Dec-2016 markj <markj@FreeBSD.org> Run DTrace test scripts with "tst" set to the test script file name.

MFC after: 1 week
Sponsored by: Dell EMC Isilon
sr.sbin/dtrace/tests/tools/dtest.sh
a1166f590b00ba7d2ac7ec580e66e03f98c894d4 06-Dec-2016 markj <markj@FreeBSD.org> libdtrace: Don't use a read-only handle for enumerating pid probes.

Enumeration of return probes involves disassembling subroutines in the
target process, and ptrace(2) is currently used to read from the target
process. libproc could read from the backing file instead to avoid this
problem, but in the common case libdtrace will have a writeable handle
on the process anyway. In particular, a writeable handle is needed to list
USDT probes, and libdtrace will cache such a handle for processes that it
controls via dtrace -c and -p.
ontrib/opensolaris/lib/libdtrace/common/dt_pid.c
5b3fdedc68386af9634d612da1161fba6e341e43 06-Dec-2016 markj <markj@FreeBSD.org> libproc: Add support for some proc_attach() flags.

This change adds some handling for the equivalent of Solaris' PGRAB_*
flags. In particular, support for PGRAB_RDONLY is needed to avoid a
nasty deadlock: dtrace(1) may otherwise stop the master process for its
pseudo-terminal and end up blocking while writing to standard output.
ompat/opensolaris/include/libproc.h
ib/libdtrace/libproc_compat.h
5d79d7739333e09184e3644b7b61c2e289edbd45 06-Dec-2016 markj <markj@FreeBSD.org> libproc: Match prefixes when looking up mapped object by name.

When looking up an object by name, allow prefix matches if no direct match
is found. This allows one to, for example, match libc entry probes with:

# dtrace -n 'pid$target:libc.so::entry' -c ./foo

instead of requiring "libc.so.7" or a glob.

Also remove proc_obj2map() as it currently just duplicates the
functionality of proc_name2map(). It's supposed to take a Solaris
link-map ID as a paramter, but support for this isn't implemented and
isn't required to support DTrace's pid provider.
ib/libdtrace/libproc_compat.h
eb7e673b042ffc25f0cbfa7d97b8f0f8fe0da8e8 03-Dec-2016 pfg <pfg@FreeBSD.org> Revert r253678, r253661:
Fix a segfault in ctfmerge(1) due to a bug in GCC.

The change was correct and the bug real, but upstream didn't adopt it
and we want to remain in sync. When/if upstream does something about it
we can bring their version.

The bug in question was fixed in GCC 4.9 which is now the default in
FreeBSD's ports. Our native gcc-4.2, which is still in use in some Tier-2
platforms also has a workaround so no end-user should be harmed by the
revert.
ontrib/opensolaris/tools/ctf/cvt/ctf.c
ontrib/opensolaris/tools/ctf/cvt/ctftools.h
ontrib/opensolaris/tools/ctf/cvt/dwarf.c
ontrib/opensolaris/tools/ctf/cvt/st_parse.c
84b3058dd8d1cf8949e334b3adc3d967bf42063b 24-Nov-2016 avg <avg@FreeBSD.org> MFV r308989: 6428 set canmount=off on unmounted filesystem tries to
unmount children

This is a cosmetic and bookkeeping change as the actual change is
already in FreeBSD.
See r297521, r304520, r308985.
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
1ca0b9abd66557786b0315a6de64086780826a0f 22-Nov-2016 avg <avg@FreeBSD.org> revert r304520, set canmount=on is not supposed to mount the filesystem

Not sure where I got the idea that it should.

See https://github.com/openzfs/openzfs/pull/218

Reported by: mahrens
Pointyhat to: avg
MFC after: 5 days
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
89670e3aee012dbc4d17873b172b7c5958407681 17-Nov-2016 mav <mav@FreeBSD.org> After some ZIL changes 6 years ago zil_slog_limit got partially broken
due to zl_itx_list_sz not updated when async itx'es upgraded to sync.
Actually because of other changes about that time zl_itx_list_sz is not
really required to implement the functionality, so this patch removes
some unneeded broken code and variables.

Original idea of zil_slog_limit was to reduce chance of SLOG abuse by
single heavy logger, that increased latency for other (more latency critical)
loggers, by pushing heavy log out into the main pool instead of SLOG. Beside
huge latency increase for heavy writers, this implementation caused double
write of all data, since the log records were explicitly prepared for SLOG.
Since we now have I/O scheduler, I've found it can be much more efficient
to reduce priority of heavy logger SLOG writes from ZIO_PRIORITY_SYNC_WRITE
to ZIO_PRIORITY_ASYNC_WRITE, while still leave them on SLOG.

Existing ZIL implementation had problem with space efficiency when it
has to write large chunks of data into log blocks of limited size. In some
cases efficiency stopped to almost as low as 50%. In case of ZIL stored on
spinning rust, that also reduced log write speed in half, since head had to
uselessly fly over allocated but not written areas. This change improves
the situation by offloading problematic operations from z*_log_write() to
zil_lwb_commit(), which knows real situation of log blocks allocation and
can split large requests into pieces much more efficiently. Also as side
effect it removes one of two data copy operations done by ZIL code WR_COPIED
case.

While there, untangle and unify code of z*_log_write() functions.
Also zfs_log_write() alike to zvol_log_write() can now handle writes crossing
block boundary, that may also improve efficiency if ZPL is made to do that.

Sponsored by: iXsystems, Inc.
ontrib/opensolaris/cmd/ztest/ztest.c
f7164b5fb01ab9d462331d397ee617ea31784fc5 17-Nov-2016 markj <markj@FreeBSD.org> Define dependencies for some auto-generated source files in libdtrace.

Remove an unneeded beforedepend rule.

Reported by: emaste, jhb
Reviewed by: bdrewery
MFC after: 1 week
ib/libdtrace/Makefile
d3cfa79d83220152aec929f0168999f654530cd7 12-Nov-2016 markj <markj@FreeBSD.org> Remove the DTrace printt and typeref actions.

These are FreeBSD-specific and were added in r178576 to provide the ability
to pretty-print instances of compound types. However, the print action has
long since been augmented to provide this functionality with a simpler
interface.

Discussed with: gnn
Differential Revision: https://reviews.freebsd.org/D8478
ontrib/opensolaris/lib/libdtrace/common/dt_cc.c
ontrib/opensolaris/lib/libdtrace/common/dt_cg.c
ontrib/opensolaris/lib/libdtrace/common/dt_consume.c
ontrib/opensolaris/lib/libdtrace/common/dt_errtags.h
ontrib/opensolaris/lib/libdtrace/common/dt_impl.h
ontrib/opensolaris/lib/libdtrace/common/dt_open.c
d0dec3458f24ecd37763794bb308665124233a19 03-Nov-2016 avg <avg@FreeBSD.org> MFV r308222: 6051 lzc_receive: allow the caller to read the begin record

illumos/illumos-gate@620f322510b2d6433f7f6af60fa52380c07756ad
https://github.com/illumos/illumos-gate/commit/620f322510b2d6433f7f6af60fa52380c07756ad

https://www.illumos.org/issues/6051
Currently lzc_receive() requires that its snapname argument is a snapshot name
(contains '@').
zfs receive allows to specify just a dataset name and would try to deduce the
snapshot name from the stream.
I propose to allow lzc_receive() to do the same.
That seems to be quite easy to implement, it requires only a small amount of
logic, it does not require any additional system calls or any additional data
from the stream.
The benefit is that the new behavior would allow to keep the snapshot names the
same between the sender and receiver at zero cost, without a need to pass the
names out of band.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Andriy Gapon <avg@icyb.net.ua>
MFC after: 2 weeks
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
c573dff5b0503e03cf400af8bcaffebab17df3a4 29-Oct-2016 avg <avg@FreeBSD.org> zfsbootcfg: a simple tool to set next boot (one time) options for zfsboot

(gpt)zfsboot will read one-time boot directives from a special ZFS pool
area. The area was previously described as "Boot Block Header", but
currently it is know as Pad2, marked as reserved and is zeroed out on
pool creation. The new code interprets data in this area, if any, using
the same format as boot.config. The area is immediately wiped out.
Failure to parse the directives results in a reboot right after the
cleanup. Otherwise the boot sequence proceeds as usual.

zfsbootcfg writes zfsboot arguments specified on its command line to the
Pad2 area of a disk identified by vfs.zfs.boot.primary_pool and
vfs.zfs.boot.primary_vdev kenv variables that are set by loader during
boot. Please see the manual page for more.

Thanks to all who reviewed, contributed and made suggestions! There are
many potential improvements to the feature, please see the review for
details.

Reviewed by: wblock (docs)
Discussed with: jhb, tsoome
MFC after: 3 weeks
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D7612
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
0899d2c173727ad4fbf7a8465a3a926d9b979704 16-Oct-2016 markj <markj@FreeBSD.org> Fix tst.args1.c on LP64 platforms.

The untyped probe arguments have a width larger than int on such platforms,
so printing their value without a cast can give unexpected results.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c
37e9ad804361d9ce131b110c7487d9909b1c558e 16-Oct-2016 markj <markj@FreeBSD.org> tst.kpriv.ksh fails because DTrace privilege levels are unimplemented.

MFC after: 1 week
sr.sbin/dtrace/tests/tools/exclude.sh
32630fbcf5a6a38cf35fa01bbb952c363d3d7333 11-Oct-2016 gnn <gnn@FreeBSD.org> Corrected non-portable reuse of va_list in dt_printf()

Submitted by: Graeme Jenkinson
Reviewed by: markj
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D8157
ontrib/opensolaris/lib/libdtrace/common/dt_subr.c
64b6bd408dabb95ff229c4b6508673ff4b5274e7 03-Sep-2016 mav <mav@FreeBSD.org> MFV r304159: 7277 zdb should be able to print zfs_dbgmsg's

illumos/illumos-gate@29bdd2f916366ece37c4748bca6b3d61f57a223b
https://github.com/illumos/illumos-gate/commit/29bdd2f916366ece37c4748bca6b3d61f
57a223b

https://www.illumos.org/issues/7277
ztest always prints the debug messages (zfs_dbgmsg()) by calling
zfs_dbgmsg_print(). We should add a flag to zdb to make it do this as well
before exiting.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Pavel Zakharov <pavel.zakharov@delphix.com>
ontrib/opensolaris/cmd/zdb/zdb.c
8bae14d57dbba533261d6277ff73be0cda13fcb5 03-Sep-2016 mav <mav@FreeBSD.org> MFV r303081: 7163 ztest failures due to excess error injection

illumos/illumos-gate@f34284d835bc555f987c1310df46c034c3101155
https://github.com/illumos/illumos-gate/commit/f34284d835bc555f987c1310df46c034c
3101155

https://www.illumos.org/issues/7163
Running zloop from zfs-precommit hit this assertion:
*panicstr/s
0xfffffd7fd7419370: assertion failed for thread 0xfffffd7fe29ed240,
thread-id 577: parent != NULL, file ../../../uts/common/fs/zfs/dbuf.c, line
1827
$c
libc.so.1`_lwp_kill+0xa()
libc.so.1`_assfail+0x182(fffffd7ffb1c29fa, fffffd7ffb1cc028, 723)
libc.so.1`assfail+0x19(fffffd7ffb1c29fa, fffffd7ffb1cc028, 723)
libzpool.so.1`dbuf_dirty+0xc69(10e3bc10, 3601700)
libzpool.so.1`dbuf_dirty+0x61e(10c73640, 3601700)
libzpool.so.1`dbuf_dirty+0x61e(10e28280, 3601700)
libzpool.so.1`dmu_buf_will_fill+0x64(10e28280, 3601700)
libzpool.so.1`dmu_write+0x1b6(2c7e640, d, 400000002e000000, 200, 3717b40,
3601700)
ztest_replay_write+0x568(4950d0, 3717a80, 0)
ztest_write+0x125(4950d0, d, 400000002e000000, 200, 413f000)
ztest_io+0x1bb(4950d0, d, 400000002e000000)
ztest_dmu_write_parallel+0xaa(4950d0, 6)
ztest_execute+0x83(1, 420c98, 6)
ztest_thread+0xf4(6)
libc.so.1`_thrp_setup+0x8a(fffffd7fe29ed240)
libc.so.1`_lwp_start()
This is another manifestation of ECKSUM in ztest:
The lowest level ancestor that’s in memory is the L8 (topmost). The L7
ancestor is blkid 0x10:
::dbufs -O 0x2c7e640 -o d -l 7 |::dbuf
addr object lvl blkid holds os
600be50 d 7 4 1 ztest/ds_6
719d880 d 7 0 4 ztest/ds_6

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Matthew Ahrens <mahrens@delphix.com>
ontrib/opensolaris/cmd/ztest/ztest.c
a88294d4174be4e02db6f9c0a738d9c0c7588f6b 03-Sep-2016 mav <mav@FreeBSD.org> MFV r303080: 6451 ztest fails due to checksum errors

illumos/illumos-gate@f9eb9fdf196b6ed476e4ffc69cecd8b0da3cb7e7
https://github.com/illumos/illumos-gate/commit/f9eb9fdf196b6ed476e4ffc69cecd8b0d
a3cb7e7

https://www.illumos.org/issues/6451
Sometimes ztest fails because zdb detects checksum errors. e.g.:
Traversing all blocks to verify checksums and verify nothing leaked ...
zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 8000160> DVA0=<0:1cc2000:
180000> [L0 other uint64[]] sha256 uncompressed LE contiguou
s unique single size=100000L/100000P birth=271L/271P fill=1
cksum=c5a3e27d1ed0f894:843bca3a5473c4bf:f76a19b6830a2e4:91292591613a12bf --
skipping
zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 800000180> DVA0=<0:ce16800:
180000> [L0 other uint64[]] sha256 uncompressed LE contigu
ous unique single size=100000L/100000P birth=840L/840P fill=1
cksum=5d018f3d061e17f3:6d1584784587bf63:2805a74a0ce37369:ba68a214806c7e75
-- skipping
zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 1000000360> DVA0=<0:10d37400:
180000> [L0 other uint64[]] sha256 uncompressed LE conti
guous unique single size=100000L/100000P birth=904L/904P fill=1
cksum=fa1e11d4138bd14b:86c9488c444473e3:f31e43c72e72e46b:e3446472d1174d
ba -- skipping
zdb_blkptr_cb: Got error 50 reading <71, 47, 0, 400000002c0> DVA0=<0:127ef400:
180000> [L0 other uint64[]] sha256 uncompressed LE cont
iguous dedup single size=100000L/100000P birth=549L/549P fill=1
cksum=30e14955ebf13522:66dc2ff8067e6810:4607e750abb9d3b3:6582b8af909fcb
58 -- skipping
zdb_blkptr_cb: Got error 50 reading <657, 5, 0, 1c0> DVA0=<0:1a180400:180000>
[L0 other uint64[]] fletcher4 uncompressed LE contiguou
s unique single size=100000L/100000P birth=1091L/1091P fill=1 cksum=a6cf1e50:
29b3bd01c57e5:36779b914035db9a:db61cdcf6bec56f0 -- skippin
g
The problem is that ztest_fault_inject() can inject multiple faults into the
same block. It is designed such that it can inject errors on all leafs of a
RAID-Z or mirror, but for a given range of offsets, it will only inject errors

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Jorgen Lundman <lundman@lundman.net>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>
ontrib/opensolaris/cmd/ztest/ztest.c
b6ae1b518146fce0346842580d05337a58c29fb7 03-Sep-2016 mav <mav@FreeBSD.org> MFV r303079:
7147 ztest: ztest_ddt_repair fails with ztest_pattern_match assertion

illumos/illumos-gate@aab80726335c76a7cae32c7300890248d73a51e3
https://github.com/illumos/illumos-gate/commit/aab80726335c76a7cae32c7300890248d
73a51e3

https://www.illumos.org/issues/7147
Here's the dbuf we're currently reading:
966f200::dbuf
addr object lvl blkid holds os
966f200 4 0 0 1 ztest/ds_3
966f200::print dmu_buf_t db_data
db_data = 0x9ae0400
0x9ae0400/10J
0x9ae0400: c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d
c1c7ced932020d c1c7ced932020d c1c7ced932020d c1c7ced932020d
c1c7ced932020d c1c7ced932020d
The pattern we're expecting is actually this: a34ae10b5f2db2. If we attempt to
read the block on disk we find that it has matches what ztest_ddt_repair()
would have written:
~c1c7ced932020d=J
ff3e383126cdfdf2
966f200::print dmu_buf_impl_t db_blkptr | ::blkptr
DVA0=<0:71d3c00:800>
[L0 UINT64_OTHER] SHA256 OFF LE contiguous dedup single
size=400L/400P birth=55L/55P fill=1
cksum=18486450d3ce8c6d:75a72f4bbf117b0f:2d3a226314eb5650:2eb0fd68648b1af0
1. zdb -U /rpool/tmp/zpool.cache -R ztest 0:71d3c00:800 | head
Found vdev type: mirror
0:71d3c00:800
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
000000: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
000010: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
000020: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
000030: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
000040: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.
000050: ff3e383126cdfdf2 ff3e383126cdfdf2 ...&18>....&18>.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: George Wilson <george.wilson@delphix.com>
ontrib/opensolaris/cmd/ztest/ztest.c
e7f8bc59abade30f3eacf7a17adcecd7175eba4e 03-Sep-2016 mav <mav@FreeBSD.org> MFV r302991: 6950 ARC should cache compressed data

illumos/illumos-gate@dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2
https://github.com/illumos/illumos-gate/commit/dcbf3bd6a1f1360fc1afcee9e22c6dcff7844bf2

https://www.illumos.org/issues/6950
When reading compressed data from disk, the ARC should keep the compressed
block cached and only decompress it when consumers access the block. The
uncompressed data should be short-lived allowing the ARC to cache a much larger
amount of data. The DMU would also maintain a smaller cache of uncompressed
blocks to minimize the impact of decompressing frequently accessed blocks.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Don Brady <don.brady@intel.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: George Wilson <george.wilson@delphix.com>
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/ztest/ztest.c
9903a75bd9fd3589a59ae7b13601e3fde75a8055 01-Sep-2016 mav <mav@FreeBSD.org> MFV r302662: 6447 handful of nvpair cleanups

illumos/illumos-gate@759e89be359f2af635e4122d147df56bce948773
https://github.com/illumos/illumos-gate/commit/759e89be359f2af635e4122d147df56bc
e948773

https://www.illumos.org/issues/6447
I got a patch from someone who uses nvpair code outside of illumos. It fixes a
couple of gcc warnings/bugs for him.
1. silence uninitialized use warnings
2. add parentheses around assignment used as truth value
3. fix printf format specifier (ll is for integers only)
4. strstr, strspn, strcspn, and strcmp are declared in string.h, not
strings.h.
5. avoid scanning integer into boolean variable

Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Steve Dougherty <sdougherty@barracuda.com>
ontrib/opensolaris/lib/libnvpair/libnvpair.c
ae8d156b04255228f9b8210d720c611cb52609dc 01-Sep-2016 mav <mav@FreeBSD.org> MFV r302660: 6314 buffer overflow in dsl_dataset_name

illumos/illumos-gate@9adfa60d484ce2435f5af77cc99dcd4e692b6660
https://github.com/illumos/illumos-gate/commit/9adfa60d484ce2435f5af77cc99dcd4e6
92b6660

https://www.illumos.org/issues/6314
Callers of dsl_dataset_name pass a buffer of size ZFS_MAXNAMELEN, but
dsl_dataset_name copies the datasets' name PLUS the snapshot name to it,
resulting in a max of 2 * ZFS_MAXNAMELEN + '@'.

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/cmd/zhack/zhack.c
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/cmd/ztest/ztest.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_changelist.c
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_diff.c
ontrib/opensolaris/lib/libzfs/common/libzfs_impl.h
ontrib/opensolaris/lib/libzfs/common/libzfs_iter.c
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
sr.sbin/zfsd/tests/zfsd_unittest.cc
9765603b98a656db1ede7ec507f035f11295503a 01-Sep-2016 mav <mav@FreeBSD.org> MFV r302659: 6931 lib/libzfs: cleanup gcc warnings

illumos/illumos-gate@88f61dee20b358671b1b643e9d1dbf220a1d69be
https://github.com/illumos/illumos-gate/commit/88f61dee20b358671b1b643e9d1dbf220a1d69be

https://www.illumos.org/issues/6931
need cleanup:
CERRWARN += -_gcc=-Wno-switch
CERRWARN += -_gcc=-Wno-parentheses
CERRWARN += -_gcc=-Wno-unused-function

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Igor Kozhukhov <ikozhukhov@gmail.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_changelist.c
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_diff.c
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
ontrib/opensolaris/lib/libzfs/common/libzfs_util.c
fe286fec0067a524a8bd53b3e9af8ed94f8f5aee 01-Sep-2016 mav <mav@FreeBSD.org> MFV r302658: 6872 zfs libraries should not allow uninitialized variables

illumos/illumos-gate@f83b46baf98d276f5f84fa84c8b461f412ac1f5e
https://github.com/illumos/illumos-gate/commit/f83b46baf98d276f5f84fa84c8b461f41
2ac1f5e

https://www.illumos.org/issues/6872
We compile the zfs libraries with -Wno-uninitialized. We should remove
this. Change makefiles, fix new warnings, fix pbchk errors.

Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>
ontrib/opensolaris/cmd/zpool/zpool_vdev.c
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
ontrib/opensolaris/lib/libzfs/common/libzfs_util.c
6f8e7ab2bc2cf5336dcc7650e99b939d05b071bb 01-Sep-2016 mav <mav@FreeBSD.org> MFV r302657: 4521 zfstest is trying to execute evil "zfs unmount -a"

illumos/illumos-gate@8808ac5dae118369991f158b6ab736cb2691ecde
https://github.com/illumos/illumos-gate/commit/8808ac5dae118369991f158b6ab736cb2
691ecde

https://www.illumos.org/issues/4521
zfstest is trying to execute evil "zfs unmount -a", which fails (fortunately,
as it would otherwise leave me with my ~ missing):
03:44:11.86 cannot unmount '/export/home/yuri': Device busy cannot unmount '/
export/home': Device busy
03:44:11.86 ERROR: /usr/sbin/zfs unmount -a exited 1
This affects, at least, zfs_mount_009_neg and zfs_mount_all_001_pos, both
failing on that step. The pool containing the /export/home hierarchy is
included in KEEP variable, but it doesn't seem to affect anything here.

Reviewed by: Andriy Gapon <avg@FreeBSD.org>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Yuri Pankov <yuri.pankov@nexenta.com>
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_config.c
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
7ab10cdc426959addab97c11a7f349200dc63a88 01-Sep-2016 mav <mav@FreeBSD.org> MFV r302655: 6873 zfs_destroy_snaps_nvl leaks errlist

illumos/illumos-gate@4cde22c29999ffb907ca39d2ebd512812f7e5168
https://github.com/illumos/illumos-gate/commit/4cde22c29999ffb907ca39d2ebd512812
f7e5168

https://www.illumos.org/issues/6873
lzc_destroy_snaps() returns an nvlist in errlist.
zfs_destroy_snaps_nvl() should nvlist_free() it before returning.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Chris Williamson <chris.williamson@delphix.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
a9bb0650ce79387def5c8cef2bd32732a8f77e62 01-Sep-2016 mav <mav@FreeBSD.org> MFV r302654:
6879 incorrect endianness swap for drr_spill.drr_length in libzfs_sendrecv.c

illumos/illumos-gate@20fea7a47472aceb64d3ed48cc2a3ea268bc4795
https://github.com/illumos/illumos-gate/commit/20fea7a47472aceb64d3ed48cc2a3ea26
8bc4795

https://www.illumos.org/issues/6879
In libzfs_sendrecv, there's a typo:
case DRR_SPILL:
if (byteswap) {
drr->drr_u.drr_write.drr_length =
BSWAP_64(drr->drr_u.drr_spill.drr_length);
}
Instead of drr_write.drr_length, we should be assigning the result of the
byteswap to drr_spill.drr_length.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Dan Kimmel <dan.kimmel@delphix.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
7641d40e2f9dde0788597491b388fba03b9869fa 01-Sep-2016 mav <mav@FreeBSD.org> MFV r302653: 6111 zfs send should ignore datasets created after the ending snapshot

illumos/illumos-gate@4a20c933b148de8a1c1d3538391c64284e636653
https://github.com/illumos/illumos-gate/commit/4a20c933b148de8a1c1d3538391c64284
e636653

https://www.illumos.org/issues/6111
If you create a zfs child folder, zfs send returns an error when a recursive
incremental send is done between two snapshots made prior to the folder
creation.
The problem can be reproduced with the following steps.
root@zfs:/# zfs create pool/test
root@zfs:/# zfs snapshot pool/test@snap1
root@zfs:/# zfs snapshot pool/test@snap2
root@zfs:/# zfs create pool/test/child
root@zfs:/# zfs send -R -I pool/test@snap1 pool/test@snap2 > /dev/null
WARNING: could not send pool/test/child@snap2: does not exist
WARNING: could not send pool/test/child@snap2: does not exist
root@zfs:/# echo $?
1
root@zfs:/# zfs snapshot -r pool/test@snap3
root@zfs:/# zfs send -R -I pool/test@snap1 pool/test@snap3 > /dev/null
root@zfs:/# echo $?
0
root@zfs:/# zfs send -R -I pool/test@snap2 pool/test@snap3 > /dev/null
root@zfs:/# echo $?
0
Since pool/test/child was created after snap2, zfs send should not expect snap2
to be in pool/test/child when doing a recursive send. It should examine the
compare the creation time of the snapshot and each child folder to decide if
the folder will be sent. The next incremental send between snap2 and snap3
would properly create the child folder and snap3 which first appears in the
child folder.
The problem is identical if '-i' is used instead of '-I'.

Reviewed by: Alex Aizman alex.aizman@nexenta.com
Reviewed by: Alek Pinchuk alek.pinchuk@nexenta.com
Reviewed by: Roman Strashkin roman.strashkin@nexenta.com
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Alex Deiter <alex.deiter@nexenta.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
13a03d4bba6a15f5c2b61b19e15d682f4fee98b9 01-Sep-2016 mav <mav@FreeBSD.org> MFV r302643:
6902 speed up listing of snapshots if requesting name only and sorting by name

This was our change from the beginning, so just reduce the upstream diff.
ontrib/opensolaris/cmd/zfs/zfs_iter.c
ontrib/opensolaris/cmd/zfs/zfs_iter.h
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_impl.h
ontrib/opensolaris/lib/libzfs/common/libzfs_iter.c
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
56917e1ad805aeb09c580cba249d7773f92c0db6 01-Sep-2016 mav <mav@FreeBSD.org> MFV r302642:
6876 Stack corruption after importing a pool with a too-long name

illumos/illumos-gate@c971037baa5d64dfecf6d87ed602fc3116ebec41
https://github.com/illumos/illumos-gate/commit/c971037baa5d64dfecf6d87ed602fc3116ebec41

https://www.illumos.org/issues/6876
Calling dsl_dataset_name on a dataset with a 256 byte buffer is asking for
trouble. We should check every dataset on import, using a 1024 byte buffer and
checking each time to see if the dataset's new name is longer than 256 bytes.

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Paul Dagnelie <pcd@delphix.com>
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
33f1090a42059c73656b8c96c6f61690c4321268 31-Aug-2016 bdrewery <bdrewery@FreeBSD.org> DIRDEPS_BUILD: Add some missing dirctories to the build.

Sponsored by: EMC / Isilon Storage Division
sr.sbin/zfsd/Makefile.depend
621419c36017adce1214903fcb014d39ef6105b2 31-Aug-2016 bdrewery <bdrewery@FreeBSD.org> DIRDEPS_BUILD: Update dependencies.

Sponsored by: EMC / Isilon Storage Division
sr.sbin/dtrace/Makefile.depend
sr.sbin/lockstat/Makefile.depend
sr.sbin/plockstat/Makefile.depend
2cf7bee07224139dadd84135d0c31648615d2b37 30-Aug-2016 markj <markj@FreeBSD.org> Recursively enumerate anonymous structs and unions in ctf_member_info().

Previously, ctf_member_info() would ignore members belonging to an
anonymous struct or union. This made it impossible to, for example, trace
the m_next field of an mbuf using DTrace.

Reported and tested by: gallatin
MFC after: 2 weeks
ontrib/opensolaris/common/ctf/ctf_types.c
62f5085bc4b853d3ac848ada78ab00c033a267ae 29-Aug-2016 ngie <ngie@FreeBSD.org> Remove redundant declarations and simplify ../ in pathing

- TESTSBASE and LOCALBASE are already defined in bsd.tests.mk
- TESTSDIR is automatically divined as ${TESTSBASE}${RELDIR:H} after
r289158.
- Replace SRCDIR with SRCTOP

MFC after: 1 week
X-MFC with: r305019
Sponsored by: EMC / Isilon Storage Division
sr.sbin/zfsd/tests/Makefile
01c75358463c613429b37d5abcb9e41e9001d724 29-Aug-2016 ngie <ngie@FreeBSD.org> Remove unnecessary variable (SRCDIR) replaced by SRCTOP in Makefile.common

MFC after: 1 week
X-MFC with: r305018
Sponsored by: EMC / Isilon Storage Division
sr.sbin/zfsd/Makefile
c20a746984b017ce46a6679f405d6579346fc3c4 29-Aug-2016 ngie <ngie@FreeBSD.org> Use SRCTOP instead of a homegrown definition for it (SRCDIR)

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
sr.sbin/zfsd/Makefile.common
32c03e3337121b9d8b187a46935dbacaa30b3ed7 29-Aug-2016 dim <dim@FreeBSD.org> Fix the zfsd unittest:
* TESTSDIR is supposed to be under cddl/usr.sbin, not cddl/sbin
* DevdCtl::EventBuffer no longer exists, so remove its forward
declaration

MFC after: 3 days
X-MFC-With: r305013
sr.sbin/zfsd/tests/Makefile
sr.sbin/zfsd/tests/zfsd_unittest.cc
e61ba5149fee579dbb76ca2c2fdfc7538a06c67e 29-Aug-2016 dim <dim@FreeBSD.org> Add an empty virtual destructor to zfsd's Vdev class. This is needed
because the class has virtual functions, and the compiler-generated
default destructor is non-virtual.

Reviewed by: asomers
MFC after: 3 days
sr.sbin/zfsd/vdev.h
b6fbaa66e46bd0e6ee06cbd2a958c69b6364f820 25-Aug-2016 gnn <gnn@FreeBSD.org> Unlike Solaris, in FreeBSD p_args can be 0 so check for that
instead of walking down to ar_args blindly.

Reported by: Amanda Strnad
Reviewed by: markj, jhb
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
ib/libdtrace/psinfo.d
c619639984f5b6c3893e5c2b6540f14f3c26fd68 20-Aug-2016 avg <avg@FreeBSD.org> fix bug introduced in r297521, set canmount=on doesn't mount filesystem

There are two cases where changing canmount should result in an action:
- canmount is set to off for a mounted filesystem
- canmount is set to on for an unmounted filesystem
Before r297521 we could unmount and re-mount a filesystem when that was
not necessary, but after r297521 we only handled the first of the above
cases.

MFC after: 5 days
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
a9a5e3e502f5989bff812150f6e3678ae231affd 18-Aug-2016 markj <markj@FreeBSD.org> Add a SIGINFO handler for dtrace(1).

Have it print the contents of aggregations, if any. Otherwise, one needs to
kill the running script to view the collected data, or add code to
periodically print it.

Discussed with: gnn
MFC after: 1 month
ontrib/opensolaris/cmd/dtrace/dtrace.c
31eeb8a69164199a29b075949dc075bfb45e2d5f 16-Aug-2016 markj <markj@FreeBSD.org> Regenerate DTrace tests.
sr.sbin/dtrace/tests/common/Makefile
sr.sbin/dtrace/tests/common/scalars/Makefile
sr.sbin/dtrace/tests/common/sugar/Makefile
46fb7ce06694424eacf0de50903c4afcfcd8f306 16-Aug-2016 markj <markj@FreeBSD.org> MFV r304057:
7085 add support for "if" and "else" statements in dtrace

illumos/illumos-gate@c3bd3abd8856e8e75d820f65c58031cd6cbac818

Add syntactic sugar to dtrace: "if" and "else" statements. The sugar is
baked down to standard dtrace features by adding additional clauses with
the appropriate predicates.

Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Sebastien Roy <sebastien.roy@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Bryan Cantrill <bryan@joyent.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Matthew Ahrens <mahrens@delphix.com>

MFC after: 2 weeks
Relnotes: yes
81ae8f62f39d440e213996e422dfe6854b0f0df0 16-Aug-2016 markj <markj@FreeBSD.org> MFV r296989:
6734 dtrace_canstore_statvar() fails for some valid static variables

Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Bryan Cantrill <bryan@joyent.com>

illumos/illumos-gate@d65f2bb4e50559c6c375a2aa9f728cbc34379015

MFC after: 2 weeks
0515ce120a752f6c9b24e0d37db4739f00c7ef8e 16-Aug-2016 markj <markj@FreeBSD.org> MFV r304056:
5396 fix longjmp clobbering errors

illumos/illumos-gate@67a4bb8f9ad4c49e9aa9e21e2114a7c093c3a73a

Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Gary Mills <gary_mills@fastmail.fm>
ontrib/opensolaris/lib/libdtrace/common/dt_cc.c
10c27df40220cf6254e8f8b07f25862cac45f69d 15-Aug-2016 markj <markj@FreeBSD.org> dtraceUtil/tst.DataModel32.d.ksh passes on amd64.
sr.sbin/dtrace/tests/tools/exclude.sh
382820c2ea034fb3469bd4e501c9e0de46c5cb7d 13-Aug-2016 markj <markj@FreeBSD.org> Fix handling of forward enum declarations in the CTF tools.

Reported by: mmacy
MFC after: 2 weeks
ontrib/opensolaris/tools/ctf/cvt/dwarf.c
ontrib/opensolaris/tools/ctf/cvt/merge.c
6d4f67f9c64b50366529380d4454d669b8d9da9f 10-Aug-2016 ngie <ngie@FreeBSD.org> Highball memory requirement (4GB) with common/{raise,safety}

Both test suites require more memory than my amd64 VM using
GENERIC-NODEBUG can provide and reliably panic it with OOM issues in
dtrace(4).

Some of the testcases fail, but this at least bypasses the panic behavior
on platforms that don't have enough resources

MFC after: 2 weeks
Discussed with: markj
Sponsored by: EMC / Isilon Storage Division
sr.sbin/dtrace/tests/common/raise/Makefile
sr.sbin/dtrace/tests/common/safety/Makefile
sr.sbin/dtrace/tests/tools/genmakefiles.sh
833befd0cde7e5783a6b21563f4759022a7bac9f 31-Jul-2016 ngie <ngie@FreeBSD.org> Cast result from third parameter to int instead of promoting it to size_t

This resolves a -Wformat issue when the value is used as a format width
precision specifier, i.e. %*s

MFC after: 1 month
Reported by: clang
Sponsored by: EMC / Isilon Storage Division
ontrib/opensolaris/lib/libzpool/common/util.c
4d9a87918b985c9f39f27dbfb94efbff7da3ae94 30-Jul-2016 markj <markj@FreeBSD.org> libdtrace: Don't hard-code the native data model.

MFC after: 1 month
ontrib/opensolaris/lib/libdtrace/arm/dt_isadep.c
ontrib/opensolaris/lib/libdtrace/i386/dt_isadep.c
b396653ab73cfd7070adfb8bc609a1caeb853d7f 20-Jul-2016 avg <avg@FreeBSD.org> MFV r303083: 7164 zdb should be able to open the root dataset

Note: conversion of the manual page change from roff to mdoc is mine.

illumos/illumos-gate@b702644a6eb66615d67b492fd73ecd9efa11fc7d
https://github.com/illumos/illumos-gate/commit/b702644a6eb66615d67b492fd73ecd9efa11fc7d

https://www.illumos.org/issues/7164
If the pool/dataset command-line argument is specified with a trailing
slash, for example, "tank/", we should interpret it as the topmost
dataset (rather than the whole pool)

Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Tim Chase <tim@chase2k.com>
PR: 204661
MFC after: 1 week
Relnotes: yes
ontrib/opensolaris/cmd/zdb/zdb.8
ontrib/opensolaris/cmd/zdb/zdb.c
c5acfc215376fb73398e729d5504825a359bb3c7 20-Jul-2016 avg <avg@FreeBSD.org> MFV r303082: 6391 Override default SPA config location via environment

illumos/illumos-gate@ae24175b2b25e9fb4bfd9ac0648b57e0735b6651
https://github.com/illumos/illumos-gate/commit/ae24175b2b25e9fb4bfd9ac0648b57e0735b6651

https://www.illumos.org/issues/6391
When using zdb with non-default SPA config file it is not convenient
to add -U <non-default-config-file-path> all the time. This commit
introduces support for setting/overriding SPA config location via
environment variable 'SPA_CONFIG_PATH'.
If -U flag is specified in the command line it will override any other
value as usual.

https://github.com/zfsonlinux/zfs/commit/64d7b6cf75e52a4698d9bdec61745573c39d2e5a

Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Richard Yao <ryao@gentoo.org>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Will Andrews <will@freebsd.org>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Cyril Plisko <cyril.plisko@mountall.com>
MFC after: 1 week
ontrib/opensolaris/cmd/zdb/zdb.c
67ae000d91e545ec555ce8fa119277dc46b73b0e 13-Jul-2016 vangyzen <vangyzen@FreeBSD.org> zpool(8): update Hot Spares section to mention zfsd(8)

Reviewed and reworded by: asomers
MFC after: 3 days
Sponsored by: Dell Inc.
ontrib/opensolaris/cmd/zpool/zpool.8
d43d89d94d1188c5178691733b457e8c444349dd 08-Jul-2016 gnn <gnn@FreeBSD.org> On FreeBSD there is a setsockopt option SO_USER_COOKIE which allows
setting a 32 bit value on each socket. This can be used by applications
and DTrace as a rendezvous point so that an applicaton's data can
more easily be captured at run time. Expose the user cookie via
DTrace by updating the translator in tcp.d and add a quick test
program, a TCP server, that sets the cookie on each connection
accepted.

Reviewed by: hiren
MFC after: 1 week
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D7152
ib/libdtrace/tcp.d
c611d1d7b77f499814d8f6e6dadb594600c737db 23-Jun-2016 asomers <asomers@FreeBSD.org> Raise the WARNS level in cddl/lib

cddl/lib/libavl/Makefile
cddl/lib/libctf/Makefile
cddl/lib/libnvpair/Makefile
cddl/lib/libumem/Makefile
cddl/lib/libuutil/Makefile
Increase WARNS to the highest working level for each of these
libraries

Approved by: re (gjb, hrs)
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
ib/libavl/Makefile
ib/libctf/Makefile
ib/libnvpair/Makefile
ib/libumem/Makefile
ib/libuutil/Makefile
ffcce084cbeb6768ea220c6f356f66bebb97d485 01-Jun-2016 allanjude <allanjude@FreeBSD.org> Fix missing space in mandoc syntax

Reported by: rpokala
ontrib/opensolaris/cmd/zpool/zpool-features.7
6ad082eea9462c0af28b049104317582e3171b25 01-Jun-2016 allanjude <allanjude@FreeBSD.org> Update zfs(8) and zpool-features(7) man pages with new hashing algorithms

Sponsored by: ScaleEngine Inc.
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zpool/zpool-features.7
085651a0140a151e7fcd8a35d35112068674d03c 31-May-2016 asomers <asomers@FreeBSD.org> Coverity fixes for r300906

lib/libdevdctl/consumer.cc
In Consumer::DisconnectFromDevd, don't close the socket if it's
already closed.

cddl/usr.sbin/zfsd/case_file.cc
lib/libdevdctl/consumer.h
Delete dead code leftover from before devd(8) gained SOCK_SEQPACKET
support

Reported by: Coverity
CID: 1356155, 1356169
Sponsored by: Spectra Logic Corp
sr.sbin/zfsd/case_file.cc
64d2c36b81ffe4b41fd87a19e697fbef6d63e912 31-May-2016 pfg <pfg@FreeBSD.org> zfsd: Remove a redundant semicolon,
sr.sbin/zfsd/vdev_iterator.cc
21668b6278a2785ace09689475f3220d02bcfc35 30-May-2016 pfg <pfg@FreeBSD.org> zfsd: minor spelling fix.
sr.sbin/zfsd/callout.h
996c4295dbb6ebc1b8025f370bf680d8242f9f8f 29-May-2016 bdrewery <bdrewery@FreeBSD.org> Avoid more literal-suffix errors with C++11
sr.sbin/zfsd/case_file.cc
442baa51845cf38dbcfdc44bd8493defdaad630a 28-May-2016 asomers <asomers@FreeBSD.org> zfsd(8), the ZFS fault management daemon

Add zfsd, which deals with hard drive faults in ZFS pools. It manages
hotspares and replements in drive slots that publish physical paths.

cddl/usr.sbin/zfsd
Add zfsd(8) and its unit tests

cddl/usr.sbin/Makefile
Add zfsd to the build

lib/libdevdctl
A C++ library that helps devd clients process events

lib/Makefile
share/mk/bsd.libnames.mk
share/mk/src.libnames.mk
Add libdevdctl to the build. It's a private library, unusable by
out-of-tree software.

etc/defaults/rc.conf
By default, set zfsd_enable to NO

etc/mtree/BSD.include.dist
Add a directory for libdevdctl's include files

etc/mtree/BSD.tests.dist
Add a directory for zfsd's unit tests

etc/mtree/BSD.var.dist
Add /var/db/zfsd/cases, where zfsd stores case files while it's shut
down.

etc/rc.d/Makefile
etc/rc.d/zfsd
Add zfsd's rc script

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
Fix the resource.fs.zfs.statechange message. It had a number of
problems:

It was only being emitted on a transition to the HEALTHY state.
That made it impossible for zfsd to take actions based on drives
getting sicker.

It compared the new state to vdev_prevstate, which is the state that
the vdev had the last time it was opened. That doesn't make sense,
because a vdev can change state multiple times without being
reopened.

vdev_set_state contains logic that will change the device's new
state based on various conditions. However, the statechange event
was being posted _before_ that logic took effect. Now it's being
posted after.

Submitted by: gibbs, asomers, mav, allanjude
Reviewed by: mav, delphij
Relnotes: yes
Sponsored by: Spectra Logic Corp, iX Systems
Differential Revision: https://reviews.freebsd.org/D6564
sr.sbin/Makefile
sr.sbin/zfsd/Makefile
sr.sbin/zfsd/Makefile.common
sr.sbin/zfsd/callout.cc
sr.sbin/zfsd/callout.h
sr.sbin/zfsd/case_file.cc
sr.sbin/zfsd/case_file.h
sr.sbin/zfsd/tests/Makefile
sr.sbin/zfsd/tests/libmocks.c
sr.sbin/zfsd/tests/libmocks.h
sr.sbin/zfsd/tests/zfsd_unittest.cc
sr.sbin/zfsd/tests/zfsd_unittest.supp
sr.sbin/zfsd/vdev.cc
sr.sbin/zfsd/vdev.h
sr.sbin/zfsd/vdev_iterator.cc
sr.sbin/zfsd/vdev_iterator.h
sr.sbin/zfsd/zfsd.8
sr.sbin/zfsd/zfsd.cc
sr.sbin/zfsd/zfsd.h
sr.sbin/zfsd/zfsd_event.cc
sr.sbin/zfsd/zfsd_event.h
sr.sbin/zfsd/zfsd_exception.cc
sr.sbin/zfsd/zfsd_exception.h
sr.sbin/zfsd/zfsd_main.cc
sr.sbin/zfsd/zpool_list.cc
sr.sbin/zfsd/zpool_list.h
501a9d9525962ad8c39b12d142394c7aa1df0f76 24-May-2016 br <br@FreeBSD.org> Add initial DTrace support for RISC-V.

Sponsored by: DARPA, AFRL
Sponsored by: HEIF5
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
ontrib/opensolaris/lib/libdtrace/common/dt_printf.c
ontrib/opensolaris/lib/libdtrace/riscv/dt_isadep.c
ib/Makefile
ib/libdtrace/Makefile
sr.sbin/Makefile
f6dffc405c7096f010b1b300da305496e6eccfbf 19-May-2016 gnn <gnn@FreeBSD.org> Remove the old version of the DTraceToolkit from the source tree.
The DTraceToolkit is part of the Open DTrace effort and is supported
on FreeBSD as a port (sysutils/DTraceToolkit) which has been updated
to properly track toolkit development upstream.

Sponsored by: DARPA, AFRL
ontrib/dtracetoolkit/Apps/Readme
ontrib/dtracetoolkit/Apps/httpdstat.d
ontrib/dtracetoolkit/Apps/nfswizard.d
ontrib/dtracetoolkit/Apps/shellsnoop
ontrib/dtracetoolkit/Apps/weblatency.d
ontrib/dtracetoolkit/Bin/anonpgpid.d
ontrib/dtracetoolkit/Bin/bitesize.d
ontrib/dtracetoolkit/Bin/connections
ontrib/dtracetoolkit/Bin/cpudists
ontrib/dtracetoolkit/Bin/cputimes
ontrib/dtracetoolkit/Bin/cputypes.d
ontrib/dtracetoolkit/Bin/cpuwalk.d
ontrib/dtracetoolkit/Bin/crash.d
ontrib/dtracetoolkit/Bin/creatbyproc.d
ontrib/dtracetoolkit/Bin/cswstat.d
ontrib/dtracetoolkit/Bin/dappprof
ontrib/dtracetoolkit/Bin/dapptrace
ontrib/dtracetoolkit/Bin/dexplorer
ontrib/dtracetoolkit/Bin/diskhits
ontrib/dtracetoolkit/Bin/dispqlen.d
ontrib/dtracetoolkit/Bin/dnlcps.d
ontrib/dtracetoolkit/Bin/dnlcsnoop.d
ontrib/dtracetoolkit/Bin/dnlcstat
ontrib/dtracetoolkit/Bin/dtruss
ontrib/dtracetoolkit/Bin/dvmstat
ontrib/dtracetoolkit/Bin/errinfo
ontrib/dtracetoolkit/Bin/execsnoop
ontrib/dtracetoolkit/Bin/fddist
ontrib/dtracetoolkit/Bin/filebyproc.d
ontrib/dtracetoolkit/Bin/fspaging.d
ontrib/dtracetoolkit/Bin/fsrw.d
ontrib/dtracetoolkit/Bin/guess.d
ontrib/dtracetoolkit/Bin/hotkernel
ontrib/dtracetoolkit/Bin/hotspot.d
ontrib/dtracetoolkit/Bin/hotuser
ontrib/dtracetoolkit/Bin/httpdstat.d
ontrib/dtracetoolkit/Bin/icmpstat.d
ontrib/dtracetoolkit/Bin/intbycpu.d
ontrib/dtracetoolkit/Bin/intoncpu.d
ontrib/dtracetoolkit/Bin/inttimes.d
ontrib/dtracetoolkit/Bin/iofile.d
ontrib/dtracetoolkit/Bin/iofileb.d
ontrib/dtracetoolkit/Bin/iopattern
ontrib/dtracetoolkit/Bin/iopending
ontrib/dtracetoolkit/Bin/iosnoop
ontrib/dtracetoolkit/Bin/iotop
ontrib/dtracetoolkit/Bin/j_calldist.d
ontrib/dtracetoolkit/Bin/j_calls.d
ontrib/dtracetoolkit/Bin/j_calltime.d
ontrib/dtracetoolkit/Bin/j_classflow.d
ontrib/dtracetoolkit/Bin/j_cpudist.d
ontrib/dtracetoolkit/Bin/j_cputime.d
ontrib/dtracetoolkit/Bin/j_events.d
ontrib/dtracetoolkit/Bin/j_flow.d
ontrib/dtracetoolkit/Bin/j_flowtime.d
ontrib/dtracetoolkit/Bin/j_methodcalls.d
ontrib/dtracetoolkit/Bin/j_objnew.d
ontrib/dtracetoolkit/Bin/j_package.d
ontrib/dtracetoolkit/Bin/j_profile.d
ontrib/dtracetoolkit/Bin/j_stat.d
ontrib/dtracetoolkit/Bin/j_syscalls.d
ontrib/dtracetoolkit/Bin/j_syscolors.d
ontrib/dtracetoolkit/Bin/j_thread.d
ontrib/dtracetoolkit/Bin/j_who.d
ontrib/dtracetoolkit/Bin/js_calldist.d
ontrib/dtracetoolkit/Bin/js_calls.d
ontrib/dtracetoolkit/Bin/js_calltime.d
ontrib/dtracetoolkit/Bin/js_cpudist.d
ontrib/dtracetoolkit/Bin/js_cputime.d
ontrib/dtracetoolkit/Bin/js_execs.d
ontrib/dtracetoolkit/Bin/js_flow.d
ontrib/dtracetoolkit/Bin/js_flowinfo.d
ontrib/dtracetoolkit/Bin/js_flowtime.d
ontrib/dtracetoolkit/Bin/js_objcpu.d
ontrib/dtracetoolkit/Bin/js_objgc.d
ontrib/dtracetoolkit/Bin/js_objnew.d
ontrib/dtracetoolkit/Bin/js_stat.d
ontrib/dtracetoolkit/Bin/js_who.d
ontrib/dtracetoolkit/Bin/kill.d
ontrib/dtracetoolkit/Bin/kstat_types.d
ontrib/dtracetoolkit/Bin/lastwords
ontrib/dtracetoolkit/Bin/loads.d
ontrib/dtracetoolkit/Bin/lockbydist.d
ontrib/dtracetoolkit/Bin/lockbyproc.d
ontrib/dtracetoolkit/Bin/minfbypid.d
ontrib/dtracetoolkit/Bin/minfbyproc.d
ontrib/dtracetoolkit/Bin/mmapfiles.d
ontrib/dtracetoolkit/Bin/modcalls.d
ontrib/dtracetoolkit/Bin/newproc.d
ontrib/dtracetoolkit/Bin/nfswizard.d
ontrib/dtracetoolkit/Bin/opensnoop
ontrib/dtracetoolkit/Bin/pathopens.d
ontrib/dtracetoolkit/Bin/pfilestat
ontrib/dtracetoolkit/Bin/pgpginbypid.d
ontrib/dtracetoolkit/Bin/pgpginbyproc.d
ontrib/dtracetoolkit/Bin/php_calldist.d
ontrib/dtracetoolkit/Bin/php_calltime.d
ontrib/dtracetoolkit/Bin/php_cpudist.d
ontrib/dtracetoolkit/Bin/php_cputime.d
ontrib/dtracetoolkit/Bin/php_flow.d
ontrib/dtracetoolkit/Bin/php_flowinfo.d
ontrib/dtracetoolkit/Bin/php_flowtime.d
ontrib/dtracetoolkit/Bin/php_funccalls.d
ontrib/dtracetoolkit/Bin/php_malloc.d
ontrib/dtracetoolkit/Bin/php_syscalls.d
ontrib/dtracetoolkit/Bin/php_syscolors.d
ontrib/dtracetoolkit/Bin/php_who.d
ontrib/dtracetoolkit/Bin/pidpersec.d
ontrib/dtracetoolkit/Bin/pl_calldist.d
ontrib/dtracetoolkit/Bin/pl_calltime.d
ontrib/dtracetoolkit/Bin/pl_cpudist.d
ontrib/dtracetoolkit/Bin/pl_cputime.d
ontrib/dtracetoolkit/Bin/pl_flow.d
ontrib/dtracetoolkit/Bin/pl_flowinfo.d
ontrib/dtracetoolkit/Bin/pl_flowtime.d
ontrib/dtracetoolkit/Bin/pl_malloc.d
ontrib/dtracetoolkit/Bin/pl_subcalls.d
ontrib/dtracetoolkit/Bin/pl_syscalls.d
ontrib/dtracetoolkit/Bin/pl_syscolors.d
ontrib/dtracetoolkit/Bin/pl_who.d
ontrib/dtracetoolkit/Bin/priclass.d
ontrib/dtracetoolkit/Bin/pridist.d
ontrib/dtracetoolkit/Bin/procsystime
ontrib/dtracetoolkit/Bin/putnexts.d
ontrib/dtracetoolkit/Bin/py_calldist.d
ontrib/dtracetoolkit/Bin/py_calltime.d
ontrib/dtracetoolkit/Bin/py_cpudist.d
ontrib/dtracetoolkit/Bin/py_cputime.d
ontrib/dtracetoolkit/Bin/py_flow.d
ontrib/dtracetoolkit/Bin/py_flowinfo.d
ontrib/dtracetoolkit/Bin/py_flowtime.d
ontrib/dtracetoolkit/Bin/py_funccalls.d
ontrib/dtracetoolkit/Bin/py_malloc.d
ontrib/dtracetoolkit/Bin/py_mallocstk.d
ontrib/dtracetoolkit/Bin/py_profile.d
ontrib/dtracetoolkit/Bin/py_syscalls.d
ontrib/dtracetoolkit/Bin/py_syscolors.d
ontrib/dtracetoolkit/Bin/py_who.d
ontrib/dtracetoolkit/Bin/rb_calldist.d
ontrib/dtracetoolkit/Bin/rb_calls.d
ontrib/dtracetoolkit/Bin/rb_calltime.d
ontrib/dtracetoolkit/Bin/rb_cpudist.d
ontrib/dtracetoolkit/Bin/rb_cputime.d
ontrib/dtracetoolkit/Bin/rb_flow.d
ontrib/dtracetoolkit/Bin/rb_flowinfo.d
ontrib/dtracetoolkit/Bin/rb_flowtime.d
ontrib/dtracetoolkit/Bin/rb_funccalls.d
ontrib/dtracetoolkit/Bin/rb_lines.d
ontrib/dtracetoolkit/Bin/rb_malloc.d
ontrib/dtracetoolkit/Bin/rb_objcpu.d
ontrib/dtracetoolkit/Bin/rb_objnew.d
ontrib/dtracetoolkit/Bin/rb_stat.d
ontrib/dtracetoolkit/Bin/rb_syscalls.d
ontrib/dtracetoolkit/Bin/rb_syscolors.d
ontrib/dtracetoolkit/Bin/rb_who.d
ontrib/dtracetoolkit/Bin/readbytes.d
ontrib/dtracetoolkit/Bin/readdist.d
ontrib/dtracetoolkit/Bin/rfileio.d
ontrib/dtracetoolkit/Bin/rfsio.d
ontrib/dtracetoolkit/Bin/runocc.d
ontrib/dtracetoolkit/Bin/rwbbypid.d
ontrib/dtracetoolkit/Bin/rwbypid.d
ontrib/dtracetoolkit/Bin/rwbytype.d
ontrib/dtracetoolkit/Bin/rwsnoop
ontrib/dtracetoolkit/Bin/rwtop
ontrib/dtracetoolkit/Bin/sampleproc
ontrib/dtracetoolkit/Bin/sar-c.d
ontrib/dtracetoolkit/Bin/seeksize.d
ontrib/dtracetoolkit/Bin/setuids.d
ontrib/dtracetoolkit/Bin/sh_calldist.d
ontrib/dtracetoolkit/Bin/sh_calls.d
ontrib/dtracetoolkit/Bin/sh_calltime.d
ontrib/dtracetoolkit/Bin/sh_cpudist.d
ontrib/dtracetoolkit/Bin/sh_cputime.d
ontrib/dtracetoolkit/Bin/sh_flow.d
ontrib/dtracetoolkit/Bin/sh_flowinfo.d
ontrib/dtracetoolkit/Bin/sh_flowtime.d
ontrib/dtracetoolkit/Bin/sh_lines.d
ontrib/dtracetoolkit/Bin/sh_pidcolors.d
ontrib/dtracetoolkit/Bin/sh_stat.d
ontrib/dtracetoolkit/Bin/sh_syscalls.d
ontrib/dtracetoolkit/Bin/sh_syscolors.d
ontrib/dtracetoolkit/Bin/sh_wasted.d
ontrib/dtracetoolkit/Bin/sh_who.d
ontrib/dtracetoolkit/Bin/shellsnoop
ontrib/dtracetoolkit/Bin/shortlived.d
ontrib/dtracetoolkit/Bin/sigdist.d
ontrib/dtracetoolkit/Bin/stacksize.d
ontrib/dtracetoolkit/Bin/statsnoop
ontrib/dtracetoolkit/Bin/swapinfo.d
ontrib/dtracetoolkit/Bin/sysbypid.d
ontrib/dtracetoolkit/Bin/syscallbypid.d
ontrib/dtracetoolkit/Bin/syscallbyproc.d
ontrib/dtracetoolkit/Bin/syscallbysysc.d
ontrib/dtracetoolkit/Bin/tcl_calldist.d
ontrib/dtracetoolkit/Bin/tcl_calls.d
ontrib/dtracetoolkit/Bin/tcl_calltime.d
ontrib/dtracetoolkit/Bin/tcl_cpudist.d
ontrib/dtracetoolkit/Bin/tcl_cputime.d
ontrib/dtracetoolkit/Bin/tcl_flow.d
ontrib/dtracetoolkit/Bin/tcl_flowtime.d
ontrib/dtracetoolkit/Bin/tcl_ins.d
ontrib/dtracetoolkit/Bin/tcl_insflow.d
ontrib/dtracetoolkit/Bin/tcl_proccalls.d
ontrib/dtracetoolkit/Bin/tcl_procflow.d
ontrib/dtracetoolkit/Bin/tcl_stat.d
ontrib/dtracetoolkit/Bin/tcl_syscalls.d
ontrib/dtracetoolkit/Bin/tcl_syscolors.d
ontrib/dtracetoolkit/Bin/tcl_who.d
ontrib/dtracetoolkit/Bin/tcpsnoop
ontrib/dtracetoolkit/Bin/tcpsnoop.d
ontrib/dtracetoolkit/Bin/tcpsnoop_snv
ontrib/dtracetoolkit/Bin/tcpsnoop_snv.d
ontrib/dtracetoolkit/Bin/tcpstat.d
ontrib/dtracetoolkit/Bin/tcptop
ontrib/dtracetoolkit/Bin/tcptop_snv
ontrib/dtracetoolkit/Bin/tcpwdist.d
ontrib/dtracetoolkit/Bin/threaded.d
ontrib/dtracetoolkit/Bin/topsyscall
ontrib/dtracetoolkit/Bin/topsysproc
ontrib/dtracetoolkit/Bin/udpstat.d
ontrib/dtracetoolkit/Bin/uname-a.d
ontrib/dtracetoolkit/Bin/vmbypid.d
ontrib/dtracetoolkit/Bin/vmstat-p.d
ontrib/dtracetoolkit/Bin/vmstat.d
ontrib/dtracetoolkit/Bin/vopstat
ontrib/dtracetoolkit/Bin/weblatency.d
ontrib/dtracetoolkit/Bin/whatexec.d
ontrib/dtracetoolkit/Bin/woof.d
ontrib/dtracetoolkit/Bin/wpm.d
ontrib/dtracetoolkit/Bin/writebytes.d
ontrib/dtracetoolkit/Bin/writedist.d
ontrib/dtracetoolkit/Bin/xcallsbypid.d
ontrib/dtracetoolkit/Bin/xvmstat
ontrib/dtracetoolkit/Bin/zvmstat
ontrib/dtracetoolkit/Code/Java/Func_abc.java
ontrib/dtracetoolkit/Code/Java/Func_loop.java
ontrib/dtracetoolkit/Code/JavaScript/func_clock.html
ontrib/dtracetoolkit/Code/JavaScript/func_slow.html
ontrib/dtracetoolkit/Code/Perl/func_abc.pl
ontrib/dtracetoolkit/Code/Perl/func_malloc.pl
ontrib/dtracetoolkit/Code/Perl/func_slow.pl
ontrib/dtracetoolkit/Code/Perl/hello.pl
ontrib/dtracetoolkit/Code/Perl/hello_strict.pl
ontrib/dtracetoolkit/Code/Php/func_abc.php
ontrib/dtracetoolkit/Code/Python/func_abc.py
ontrib/dtracetoolkit/Code/Python/func_slow.py
ontrib/dtracetoolkit/Code/Readme
ontrib/dtracetoolkit/Code/Ruby/func_abc.rb
ontrib/dtracetoolkit/Code/Ruby/func_slow.rb
ontrib/dtracetoolkit/Code/Shell/func_abc.sh
ontrib/dtracetoolkit/Code/Shell/func_slow.sh
ontrib/dtracetoolkit/Code/Shell/func_waste.sh
ontrib/dtracetoolkit/Code/Tcl/func_abc.tcl
ontrib/dtracetoolkit/Code/Tcl/func_slow.tcl
ontrib/dtracetoolkit/Cpu/Readme
ontrib/dtracetoolkit/Cpu/cputypes.d
ontrib/dtracetoolkit/Cpu/cpuwalk.d
ontrib/dtracetoolkit/Cpu/dispqlen.d
ontrib/dtracetoolkit/Cpu/intbycpu.d
ontrib/dtracetoolkit/Cpu/intoncpu.d
ontrib/dtracetoolkit/Cpu/inttimes.d
ontrib/dtracetoolkit/Cpu/loads.d
ontrib/dtracetoolkit/Cpu/runocc.d
ontrib/dtracetoolkit/Cpu/xcallsbypid.d
ontrib/dtracetoolkit/Disk/Readme
ontrib/dtracetoolkit/Disk/bitesize.d
ontrib/dtracetoolkit/Disk/diskhits
ontrib/dtracetoolkit/Disk/hotspot.d
ontrib/dtracetoolkit/Disk/iofile.d
ontrib/dtracetoolkit/Disk/iofileb.d
ontrib/dtracetoolkit/Disk/iopending
ontrib/dtracetoolkit/Disk/seeksize.d
ontrib/dtracetoolkit/Docs/Contents
ontrib/dtracetoolkit/Docs/Examples
ontrib/dtracetoolkit/Docs/Faq
ontrib/dtracetoolkit/Docs/History
ontrib/dtracetoolkit/Docs/Index
ontrib/dtracetoolkit/Docs/Links
ontrib/dtracetoolkit/Docs/Maintainer
ontrib/dtracetoolkit/Docs/Notes
ontrib/dtracetoolkit/Docs/Readme
ontrib/dtracetoolkit/Docs/ToDo
ontrib/dtracetoolkit/Docs/Who
ontrib/dtracetoolkit/Docs/cddl1.txt
ontrib/dtracetoolkit/Docs/oneliners.txt
ontrib/dtracetoolkit/Examples/Copyright
ontrib/dtracetoolkit/Examples/Readme
ontrib/dtracetoolkit/Examples/anonpgpid_example.txt
ontrib/dtracetoolkit/Examples/bitesize_example.txt
ontrib/dtracetoolkit/Examples/connections_example.txt
ontrib/dtracetoolkit/Examples/cpudists_example.txt
ontrib/dtracetoolkit/Examples/cputimes_example.txt
ontrib/dtracetoolkit/Examples/cputypes_example.txt
ontrib/dtracetoolkit/Examples/cpuwalk_example.txt
ontrib/dtracetoolkit/Examples/crash_example.txt
ontrib/dtracetoolkit/Examples/creatbyproc_example.txt
ontrib/dtracetoolkit/Examples/cswstat_example.txt
ontrib/dtracetoolkit/Examples/dappprof_example.txt
ontrib/dtracetoolkit/Examples/dapptrace_example.txt
ontrib/dtracetoolkit/Examples/dexplorer_example.txt
ontrib/dtracetoolkit/Examples/diskhits_example.txt
ontrib/dtracetoolkit/Examples/dispqlen_example.txt
ontrib/dtracetoolkit/Examples/dnlcps_example.txt
ontrib/dtracetoolkit/Examples/dnlcsnoop_example.txt
ontrib/dtracetoolkit/Examples/dnlcstat_example.txt
ontrib/dtracetoolkit/Examples/dtruss_example.txt
ontrib/dtracetoolkit/Examples/dvmstat_example.txt
ontrib/dtracetoolkit/Examples/errinfo_example.txt
ontrib/dtracetoolkit/Examples/execsnoop_example.txt
ontrib/dtracetoolkit/Examples/fddist_example.txt
ontrib/dtracetoolkit/Examples/filebyproc_example.txt
ontrib/dtracetoolkit/Examples/fspaging_example.txt
ontrib/dtracetoolkit/Examples/fsrw_example.txt
ontrib/dtracetoolkit/Examples/guess_example.txt
ontrib/dtracetoolkit/Examples/hotkernel_example.txt
ontrib/dtracetoolkit/Examples/hotspot_example.txt
ontrib/dtracetoolkit/Examples/hotuser_example.txt
ontrib/dtracetoolkit/Examples/httpdstat_example.txt
ontrib/dtracetoolkit/Examples/icmpstat_example.txt
ontrib/dtracetoolkit/Examples/intbycpu_example.txt
ontrib/dtracetoolkit/Examples/intoncpu_example.txt
ontrib/dtracetoolkit/Examples/inttimes_example.txt
ontrib/dtracetoolkit/Examples/iofile_example.txt
ontrib/dtracetoolkit/Examples/iofileb_example.txt
ontrib/dtracetoolkit/Examples/iopattern_example.txt
ontrib/dtracetoolkit/Examples/iopending_example.txt
ontrib/dtracetoolkit/Examples/iosnoop_example.txt
ontrib/dtracetoolkit/Examples/iotop_example.txt
ontrib/dtracetoolkit/Examples/j_calldist_example.txt
ontrib/dtracetoolkit/Examples/j_calls_example.txt
ontrib/dtracetoolkit/Examples/j_calltime_example.txt
ontrib/dtracetoolkit/Examples/j_classflow_example.txt
ontrib/dtracetoolkit/Examples/j_cpudist_example.txt
ontrib/dtracetoolkit/Examples/j_cputime_example.txt
ontrib/dtracetoolkit/Examples/j_events_example.txt
ontrib/dtracetoolkit/Examples/j_flow_example.txt
ontrib/dtracetoolkit/Examples/j_flowtime_example.txt
ontrib/dtracetoolkit/Examples/j_methodcalls_example.txt
ontrib/dtracetoolkit/Examples/j_objnew_example.txt
ontrib/dtracetoolkit/Examples/j_package_example.txt
ontrib/dtracetoolkit/Examples/j_profile_example.txt
ontrib/dtracetoolkit/Examples/j_stat_example.txt
ontrib/dtracetoolkit/Examples/j_syscalls_example.txt
ontrib/dtracetoolkit/Examples/j_syscolors_example.txt
ontrib/dtracetoolkit/Examples/j_thread_example.txt
ontrib/dtracetoolkit/Examples/j_who_example.txt
ontrib/dtracetoolkit/Examples/js_calldist_example.txt
ontrib/dtracetoolkit/Examples/js_calls_example.txt
ontrib/dtracetoolkit/Examples/js_calltime_example.txt
ontrib/dtracetoolkit/Examples/js_cpudist_example.txt
ontrib/dtracetoolkit/Examples/js_cputime_example.txt
ontrib/dtracetoolkit/Examples/js_execs_example.txt
ontrib/dtracetoolkit/Examples/js_flow_example.txt
ontrib/dtracetoolkit/Examples/js_flowinfo_example.txt
ontrib/dtracetoolkit/Examples/js_flowtime_example.txt
ontrib/dtracetoolkit/Examples/js_objcpu_example.txt
ontrib/dtracetoolkit/Examples/js_objgc_example.txt
ontrib/dtracetoolkit/Examples/js_objnew_example.txt
ontrib/dtracetoolkit/Examples/js_stat_example.txt
ontrib/dtracetoolkit/Examples/js_who_example.txt
ontrib/dtracetoolkit/Examples/kill_example.txt
ontrib/dtracetoolkit/Examples/kstat_types_example.txt
ontrib/dtracetoolkit/Examples/lastwords_example.txt
ontrib/dtracetoolkit/Examples/loads_example.txt
ontrib/dtracetoolkit/Examples/lockbydist_example.txt
ontrib/dtracetoolkit/Examples/lockbyproc_example.txt
ontrib/dtracetoolkit/Examples/minfbypid_example.txt
ontrib/dtracetoolkit/Examples/minfbyproc_example.txt
ontrib/dtracetoolkit/Examples/mmapfiles_example.txt
ontrib/dtracetoolkit/Examples/modcalls_example.txt
ontrib/dtracetoolkit/Examples/newproc_example.txt
ontrib/dtracetoolkit/Examples/nfswizard_example.txt
ontrib/dtracetoolkit/Examples/oneliners_examples.txt
ontrib/dtracetoolkit/Examples/opensnoop_example.txt
ontrib/dtracetoolkit/Examples/pathopens_example.txt
ontrib/dtracetoolkit/Examples/pfilestat_example.txt
ontrib/dtracetoolkit/Examples/pgpginbypid_example.txt
ontrib/dtracetoolkit/Examples/pgpginbyproc_example.txt
ontrib/dtracetoolkit/Examples/php_calldist_example.txt
ontrib/dtracetoolkit/Examples/php_calltime_example.txt
ontrib/dtracetoolkit/Examples/php_cpudist_example.txt
ontrib/dtracetoolkit/Examples/php_cputime_example.txt
ontrib/dtracetoolkit/Examples/php_flow_example.txt
ontrib/dtracetoolkit/Examples/php_flowinfo_example.txt
ontrib/dtracetoolkit/Examples/php_flowtime_example.txt
ontrib/dtracetoolkit/Examples/php_funccalls_example.txt
ontrib/dtracetoolkit/Examples/php_malloc_example.txt
ontrib/dtracetoolkit/Examples/php_syscalls_example.txt
ontrib/dtracetoolkit/Examples/php_syscolors_example.txt
ontrib/dtracetoolkit/Examples/php_who_example.txt
ontrib/dtracetoolkit/Examples/pidpersec_example.txt
ontrib/dtracetoolkit/Examples/pl_calldist_example.txt
ontrib/dtracetoolkit/Examples/pl_calltime_example.txt
ontrib/dtracetoolkit/Examples/pl_cpudist_example.txt
ontrib/dtracetoolkit/Examples/pl_cputime_example.txt
ontrib/dtracetoolkit/Examples/pl_flow_example.txt
ontrib/dtracetoolkit/Examples/pl_flowinfo_example.txt
ontrib/dtracetoolkit/Examples/pl_flowtime_example.txt
ontrib/dtracetoolkit/Examples/pl_malloc_example.txt
ontrib/dtracetoolkit/Examples/pl_subcalls_example.txt
ontrib/dtracetoolkit/Examples/pl_syscalls_example.txt
ontrib/dtracetoolkit/Examples/pl_syscolors_example.txt
ontrib/dtracetoolkit/Examples/pl_who_example.txt
ontrib/dtracetoolkit/Examples/priclass_example.txt
ontrib/dtracetoolkit/Examples/pridist_example.txt
ontrib/dtracetoolkit/Examples/procsystime_example.txt
ontrib/dtracetoolkit/Examples/putnexts_example.txt
ontrib/dtracetoolkit/Examples/py_calldist_example.txt
ontrib/dtracetoolkit/Examples/py_calltime_example.txt
ontrib/dtracetoolkit/Examples/py_cpudist_example.txt
ontrib/dtracetoolkit/Examples/py_cputime_example.txt
ontrib/dtracetoolkit/Examples/py_flow_example.txt
ontrib/dtracetoolkit/Examples/py_flowinfo_example.txt
ontrib/dtracetoolkit/Examples/py_flowtime_example.txt
ontrib/dtracetoolkit/Examples/py_funccalls_example.txt
ontrib/dtracetoolkit/Examples/py_malloc_example.txt
ontrib/dtracetoolkit/Examples/py_mallocstk_example.txt
ontrib/dtracetoolkit/Examples/py_profile_example.txt
ontrib/dtracetoolkit/Examples/py_syscalls_example.txt
ontrib/dtracetoolkit/Examples/py_syscolors_example.txt
ontrib/dtracetoolkit/Examples/py_who_example.txt
ontrib/dtracetoolkit/Examples/rb_calldist_example.txt
ontrib/dtracetoolkit/Examples/rb_calls_example.txt
ontrib/dtracetoolkit/Examples/rb_calltime_example.txt
ontrib/dtracetoolkit/Examples/rb_cpudist_example.txt
ontrib/dtracetoolkit/Examples/rb_cputime_example.txt
ontrib/dtracetoolkit/Examples/rb_flow_example.txt
ontrib/dtracetoolkit/Examples/rb_flowinfo_example.txt
ontrib/dtracetoolkit/Examples/rb_flowtime_example.txt
ontrib/dtracetoolkit/Examples/rb_funccalls_example.txt
ontrib/dtracetoolkit/Examples/rb_lines_example.txt
ontrib/dtracetoolkit/Examples/rb_malloc_example.txt
ontrib/dtracetoolkit/Examples/rb_objcpu_example.txt
ontrib/dtracetoolkit/Examples/rb_objnew_example.txt
ontrib/dtracetoolkit/Examples/rb_stat_example.txt
ontrib/dtracetoolkit/Examples/rb_syscalls_example.txt
ontrib/dtracetoolkit/Examples/rb_syscolors_example.txt
ontrib/dtracetoolkit/Examples/rb_who_example.txt
ontrib/dtracetoolkit/Examples/readbytes_example.txt
ontrib/dtracetoolkit/Examples/readdist_example.txt
ontrib/dtracetoolkit/Examples/rfileio_example.txt
ontrib/dtracetoolkit/Examples/rfsio_example.txt
ontrib/dtracetoolkit/Examples/runocc_example.txt
ontrib/dtracetoolkit/Examples/rwbbypid_example.txt
ontrib/dtracetoolkit/Examples/rwbypid_example.txt
ontrib/dtracetoolkit/Examples/rwbytype_example.txt
ontrib/dtracetoolkit/Examples/rwsnoop_example.txt
ontrib/dtracetoolkit/Examples/rwtop_example.txt
ontrib/dtracetoolkit/Examples/sampleproc_example.txt
ontrib/dtracetoolkit/Examples/sar-c_example.txt
ontrib/dtracetoolkit/Examples/seeksize_example.txt
ontrib/dtracetoolkit/Examples/setuids_example.txt
ontrib/dtracetoolkit/Examples/sh_calldist_example.txt
ontrib/dtracetoolkit/Examples/sh_calls_example.txt
ontrib/dtracetoolkit/Examples/sh_calltime_example.txt
ontrib/dtracetoolkit/Examples/sh_cpudist_example.txt
ontrib/dtracetoolkit/Examples/sh_cputime_example.txt
ontrib/dtracetoolkit/Examples/sh_flow_example.txt
ontrib/dtracetoolkit/Examples/sh_flowinfo_example.txt
ontrib/dtracetoolkit/Examples/sh_flowtime_example.txt
ontrib/dtracetoolkit/Examples/sh_lines_example.txt
ontrib/dtracetoolkit/Examples/sh_pidcolors_example.txt
ontrib/dtracetoolkit/Examples/sh_stat_example.txt
ontrib/dtracetoolkit/Examples/sh_syscalls_example.txt
ontrib/dtracetoolkit/Examples/sh_syscolors_example.txt
ontrib/dtracetoolkit/Examples/sh_wasted_example.txt
ontrib/dtracetoolkit/Examples/sh_who_example.txt
ontrib/dtracetoolkit/Examples/shellsnoop_example.txt
ontrib/dtracetoolkit/Examples/shortlived_example.txt
ontrib/dtracetoolkit/Examples/sigdist_example.txt
ontrib/dtracetoolkit/Examples/stacksize_example.txt
ontrib/dtracetoolkit/Examples/statsnoop_example.txt
ontrib/dtracetoolkit/Examples/swapinfo_example.txt
ontrib/dtracetoolkit/Examples/sysbypid_example.txt
ontrib/dtracetoolkit/Examples/syscallbypid_example.txt
ontrib/dtracetoolkit/Examples/syscallbyproc_example.txt
ontrib/dtracetoolkit/Examples/syscallbysysc_example.txt
ontrib/dtracetoolkit/Examples/tcl_calldist_example.txt
ontrib/dtracetoolkit/Examples/tcl_calls_example.txt
ontrib/dtracetoolkit/Examples/tcl_calltime_example.txt
ontrib/dtracetoolkit/Examples/tcl_cpudist_example.txt
ontrib/dtracetoolkit/Examples/tcl_cputime_example.txt
ontrib/dtracetoolkit/Examples/tcl_flow_example.txt
ontrib/dtracetoolkit/Examples/tcl_flowtime_example.txt
ontrib/dtracetoolkit/Examples/tcl_ins_example.txt
ontrib/dtracetoolkit/Examples/tcl_insflow_example.txt
ontrib/dtracetoolkit/Examples/tcl_proccalls_example.txt
ontrib/dtracetoolkit/Examples/tcl_procflow_example.txt
ontrib/dtracetoolkit/Examples/tcl_stat_example.txt
ontrib/dtracetoolkit/Examples/tcl_syscalls_example.txt
ontrib/dtracetoolkit/Examples/tcl_syscolors_example.txt
ontrib/dtracetoolkit/Examples/tcl_who_example.txt
ontrib/dtracetoolkit/Examples/tcpsnoop_d_example.txt
ontrib/dtracetoolkit/Examples/tcpsnoop_example.txt
ontrib/dtracetoolkit/Examples/tcpsnoop_snv_d_example.txt
ontrib/dtracetoolkit/Examples/tcpsnoop_snv_example.txt
ontrib/dtracetoolkit/Examples/tcpstat_example.txt
ontrib/dtracetoolkit/Examples/tcptop_example.txt
ontrib/dtracetoolkit/Examples/tcptop_snv_example.txt
ontrib/dtracetoolkit/Examples/tcpwdist_example.txt
ontrib/dtracetoolkit/Examples/threaded_example.txt
ontrib/dtracetoolkit/Examples/topsyscall_example.txt
ontrib/dtracetoolkit/Examples/topsysproc_example.txt
ontrib/dtracetoolkit/Examples/udpstat_example.txt
ontrib/dtracetoolkit/Examples/uname-a_example.txt
ontrib/dtracetoolkit/Examples/vmbypid_example.txt
ontrib/dtracetoolkit/Examples/vmstat-p_example.txt
ontrib/dtracetoolkit/Examples/vmstat_example.txt
ontrib/dtracetoolkit/Examples/vopstat_example.txt
ontrib/dtracetoolkit/Examples/weblatency_example.txt
ontrib/dtracetoolkit/Examples/whatexec_example.txt
ontrib/dtracetoolkit/Examples/woof_example.txt
ontrib/dtracetoolkit/Examples/wpm_example.txt
ontrib/dtracetoolkit/Examples/writebytes_example.txt
ontrib/dtracetoolkit/Examples/writedist_example.txt
ontrib/dtracetoolkit/Examples/xcallsbypid_example.txt
ontrib/dtracetoolkit/Examples/xvmstat_example.txt
ontrib/dtracetoolkit/Examples/zvmstat_example.txt
ontrib/dtracetoolkit/FS/Readme
ontrib/dtracetoolkit/FS/fspaging.d
ontrib/dtracetoolkit/FS/fsrw.d
ontrib/dtracetoolkit/FS/rfileio.d
ontrib/dtracetoolkit/FS/rfsio.d
ontrib/dtracetoolkit/FS/vopstat
ontrib/dtracetoolkit/Guide
ontrib/dtracetoolkit/Include/Readme
ontrib/dtracetoolkit/Include/test.ksh
ontrib/dtracetoolkit/Include/time.h
ontrib/dtracetoolkit/Include/tostr.h
ontrib/dtracetoolkit/Java/Readme
ontrib/dtracetoolkit/Java/j_calldist.d
ontrib/dtracetoolkit/Java/j_calls.d
ontrib/dtracetoolkit/Java/j_calltime.d
ontrib/dtracetoolkit/Java/j_classflow.d
ontrib/dtracetoolkit/Java/j_cpudist.d
ontrib/dtracetoolkit/Java/j_cputime.d
ontrib/dtracetoolkit/Java/j_events.d
ontrib/dtracetoolkit/Java/j_flow.d
ontrib/dtracetoolkit/Java/j_flowtime.d
ontrib/dtracetoolkit/Java/j_methodcalls.d
ontrib/dtracetoolkit/Java/j_objnew.d
ontrib/dtracetoolkit/Java/j_package.d
ontrib/dtracetoolkit/Java/j_profile.d
ontrib/dtracetoolkit/Java/j_stat.d
ontrib/dtracetoolkit/Java/j_syscalls.d
ontrib/dtracetoolkit/Java/j_syscolors.d
ontrib/dtracetoolkit/Java/j_thread.d
ontrib/dtracetoolkit/Java/j_who.d
ontrib/dtracetoolkit/JavaScript/Readme
ontrib/dtracetoolkit/JavaScript/js_calldist.d
ontrib/dtracetoolkit/JavaScript/js_calls.d
ontrib/dtracetoolkit/JavaScript/js_calltime.d
ontrib/dtracetoolkit/JavaScript/js_cpudist.d
ontrib/dtracetoolkit/JavaScript/js_cputime.d
ontrib/dtracetoolkit/JavaScript/js_execs.d
ontrib/dtracetoolkit/JavaScript/js_flow.d
ontrib/dtracetoolkit/JavaScript/js_flowinfo.d
ontrib/dtracetoolkit/JavaScript/js_flowtime.d
ontrib/dtracetoolkit/JavaScript/js_objcpu.d
ontrib/dtracetoolkit/JavaScript/js_objgc.d
ontrib/dtracetoolkit/JavaScript/js_objnew.d
ontrib/dtracetoolkit/JavaScript/js_stat.d
ontrib/dtracetoolkit/JavaScript/js_who.d
ontrib/dtracetoolkit/Kernel/Readme
ontrib/dtracetoolkit/Kernel/cpudists
ontrib/dtracetoolkit/Kernel/cputimes
ontrib/dtracetoolkit/Kernel/cswstat.d
ontrib/dtracetoolkit/Kernel/dnlcps.d
ontrib/dtracetoolkit/Kernel/dnlcsnoop.d
ontrib/dtracetoolkit/Kernel/dnlcstat
ontrib/dtracetoolkit/Kernel/kstat_types.d
ontrib/dtracetoolkit/Kernel/modcalls.d
ontrib/dtracetoolkit/Kernel/priclass.d
ontrib/dtracetoolkit/Kernel/pridist.d
ontrib/dtracetoolkit/Kernel/putnexts.d
ontrib/dtracetoolkit/Kernel/whatexec.d
ontrib/dtracetoolkit/License
ontrib/dtracetoolkit/Locks/lockbydist.d
ontrib/dtracetoolkit/Locks/lockbyproc.d
ontrib/dtracetoolkit/Man/Readme
ontrib/dtracetoolkit/Man/man1m/anonpgpid.d.1m
ontrib/dtracetoolkit/Man/man1m/bitesize.d.1m
ontrib/dtracetoolkit/Man/man1m/connections.1m
ontrib/dtracetoolkit/Man/man1m/cpudists.1m
ontrib/dtracetoolkit/Man/man1m/cputimes.1m
ontrib/dtracetoolkit/Man/man1m/cputypes.d.1m
ontrib/dtracetoolkit/Man/man1m/cpuwalk.d.1m
ontrib/dtracetoolkit/Man/man1m/crash.d.1m
ontrib/dtracetoolkit/Man/man1m/creatbyproc.d.1m
ontrib/dtracetoolkit/Man/man1m/cswstat.d.1m
ontrib/dtracetoolkit/Man/man1m/dappprof.1m
ontrib/dtracetoolkit/Man/man1m/dapptrace.1m
ontrib/dtracetoolkit/Man/man1m/dexplorer.1m
ontrib/dtracetoolkit/Man/man1m/diskhits.1m
ontrib/dtracetoolkit/Man/man1m/dispqlen.d.1m
ontrib/dtracetoolkit/Man/man1m/dnlcps.d.1m
ontrib/dtracetoolkit/Man/man1m/dnlcsnoop.d.1m
ontrib/dtracetoolkit/Man/man1m/dnlcstat.1m
ontrib/dtracetoolkit/Man/man1m/dtruss.1m
ontrib/dtracetoolkit/Man/man1m/dvmstat.1m
ontrib/dtracetoolkit/Man/man1m/errinfo.1m
ontrib/dtracetoolkit/Man/man1m/execsnoop.1m
ontrib/dtracetoolkit/Man/man1m/fddist.1m
ontrib/dtracetoolkit/Man/man1m/filebyproc.d.1m
ontrib/dtracetoolkit/Man/man1m/fspaging.d.1m
ontrib/dtracetoolkit/Man/man1m/fsrw.d.1m
ontrib/dtracetoolkit/Man/man1m/guess.d.1m
ontrib/dtracetoolkit/Man/man1m/hotkernel.1m
ontrib/dtracetoolkit/Man/man1m/hotspot.d.1m
ontrib/dtracetoolkit/Man/man1m/hotuser.1m
ontrib/dtracetoolkit/Man/man1m/httpdstat.d.1m
ontrib/dtracetoolkit/Man/man1m/icmpstat.d.1m
ontrib/dtracetoolkit/Man/man1m/intbycpu.d.1m
ontrib/dtracetoolkit/Man/man1m/intoncpu.d.1m
ontrib/dtracetoolkit/Man/man1m/inttimes.d.1m
ontrib/dtracetoolkit/Man/man1m/iofile.d.1m
ontrib/dtracetoolkit/Man/man1m/iofileb.d.1m
ontrib/dtracetoolkit/Man/man1m/iopattern.1m
ontrib/dtracetoolkit/Man/man1m/iopending.1m
ontrib/dtracetoolkit/Man/man1m/iosnoop.1m
ontrib/dtracetoolkit/Man/man1m/iotop.1m
ontrib/dtracetoolkit/Man/man1m/j_calldist.d.1m
ontrib/dtracetoolkit/Man/man1m/j_calls.d.1m
ontrib/dtracetoolkit/Man/man1m/j_calltime.d.1m
ontrib/dtracetoolkit/Man/man1m/j_classflow.d.1m
ontrib/dtracetoolkit/Man/man1m/j_cpudist.d.1m
ontrib/dtracetoolkit/Man/man1m/j_cputime.d.1m
ontrib/dtracetoolkit/Man/man1m/j_events.d.1m
ontrib/dtracetoolkit/Man/man1m/j_flow.d.1m
ontrib/dtracetoolkit/Man/man1m/j_flowtime.d.1m
ontrib/dtracetoolkit/Man/man1m/j_methodcalls.d.1m
ontrib/dtracetoolkit/Man/man1m/j_objnew.d.1m
ontrib/dtracetoolkit/Man/man1m/j_package.d.1m
ontrib/dtracetoolkit/Man/man1m/j_profile.d.1m
ontrib/dtracetoolkit/Man/man1m/j_stat.d.1m
ontrib/dtracetoolkit/Man/man1m/j_syscalls.d.1m
ontrib/dtracetoolkit/Man/man1m/j_syscolors.d.1m
ontrib/dtracetoolkit/Man/man1m/j_thread.d.1m
ontrib/dtracetoolkit/Man/man1m/j_who.d.1m
ontrib/dtracetoolkit/Man/man1m/js_calldist.d.1m
ontrib/dtracetoolkit/Man/man1m/js_calls.d.1m
ontrib/dtracetoolkit/Man/man1m/js_calltime.d.1m
ontrib/dtracetoolkit/Man/man1m/js_cpudist.d.1m
ontrib/dtracetoolkit/Man/man1m/js_cputime.d.1m
ontrib/dtracetoolkit/Man/man1m/js_execs.d.1m
ontrib/dtracetoolkit/Man/man1m/js_flow.d.1m
ontrib/dtracetoolkit/Man/man1m/js_flowinfo.d.1m
ontrib/dtracetoolkit/Man/man1m/js_flowtime.d.1m
ontrib/dtracetoolkit/Man/man1m/js_objcpu.d.1m
ontrib/dtracetoolkit/Man/man1m/js_objgc.d.1m
ontrib/dtracetoolkit/Man/man1m/js_objnew.d.1m
ontrib/dtracetoolkit/Man/man1m/js_stat.d.1m
ontrib/dtracetoolkit/Man/man1m/js_who.d.1m
ontrib/dtracetoolkit/Man/man1m/kill.d.1m
ontrib/dtracetoolkit/Man/man1m/kstat_types.d.1m
ontrib/dtracetoolkit/Man/man1m/lastwords.1m
ontrib/dtracetoolkit/Man/man1m/loads.d.1m
ontrib/dtracetoolkit/Man/man1m/lockbydist.d.1m
ontrib/dtracetoolkit/Man/man1m/lockbyproc.d.1m
ontrib/dtracetoolkit/Man/man1m/minfbypid.d.1m
ontrib/dtracetoolkit/Man/man1m/minfbyproc.d.1m
ontrib/dtracetoolkit/Man/man1m/mmapfiles.d.1m
ontrib/dtracetoolkit/Man/man1m/modcalls.d.1m
ontrib/dtracetoolkit/Man/man1m/newproc.d.1m
ontrib/dtracetoolkit/Man/man1m/nfswizard.d.1m
ontrib/dtracetoolkit/Man/man1m/opensnoop.1m
ontrib/dtracetoolkit/Man/man1m/pathopens.d.1m
ontrib/dtracetoolkit/Man/man1m/pfilestat.1m
ontrib/dtracetoolkit/Man/man1m/pgpginbypid.d.1m
ontrib/dtracetoolkit/Man/man1m/pgpginbyproc.d.1m
ontrib/dtracetoolkit/Man/man1m/php_calldist.d.1m
ontrib/dtracetoolkit/Man/man1m/php_calltime.d.1m
ontrib/dtracetoolkit/Man/man1m/php_cpudist.d.1m
ontrib/dtracetoolkit/Man/man1m/php_cputime.d.1m
ontrib/dtracetoolkit/Man/man1m/php_flow.d.1m
ontrib/dtracetoolkit/Man/man1m/php_flowinfo.d.1m
ontrib/dtracetoolkit/Man/man1m/php_flowtime.d.1m
ontrib/dtracetoolkit/Man/man1m/php_funccalls.d.1m
ontrib/dtracetoolkit/Man/man1m/php_malloc.d.1m
ontrib/dtracetoolkit/Man/man1m/php_syscalls.d.1m
ontrib/dtracetoolkit/Man/man1m/php_syscolors.d.1m
ontrib/dtracetoolkit/Man/man1m/php_who.d.1m
ontrib/dtracetoolkit/Man/man1m/pidpersec.d.1m
ontrib/dtracetoolkit/Man/man1m/pl_calldist.d.1m
ontrib/dtracetoolkit/Man/man1m/pl_calltime.d.1m
ontrib/dtracetoolkit/Man/man1m/pl_cpudist.d.1m
ontrib/dtracetoolkit/Man/man1m/pl_cputime.d.1m
ontrib/dtracetoolkit/Man/man1m/pl_flow.d.1m
ontrib/dtracetoolkit/Man/man1m/pl_flowinfo.d.1m
ontrib/dtracetoolkit/Man/man1m/pl_flowtime.d.1m
ontrib/dtracetoolkit/Man/man1m/pl_malloc.d.1m
ontrib/dtracetoolkit/Man/man1m/pl_subcalls.d.1m
ontrib/dtracetoolkit/Man/man1m/pl_syscalls.d.1m
ontrib/dtracetoolkit/Man/man1m/pl_syscolors.d.1m
ontrib/dtracetoolkit/Man/man1m/pl_who.d.1m
ontrib/dtracetoolkit/Man/man1m/priclass.d.1m
ontrib/dtracetoolkit/Man/man1m/pridist.d.1m
ontrib/dtracetoolkit/Man/man1m/procsystime.1m
ontrib/dtracetoolkit/Man/man1m/putnexts.d.1m
ontrib/dtracetoolkit/Man/man1m/py_calldist.d.1m
ontrib/dtracetoolkit/Man/man1m/py_calltime.d.1m
ontrib/dtracetoolkit/Man/man1m/py_cpudist.d.1m
ontrib/dtracetoolkit/Man/man1m/py_cputime.d.1m
ontrib/dtracetoolkit/Man/man1m/py_flow.d.1m
ontrib/dtracetoolkit/Man/man1m/py_flowinfo.d.1m
ontrib/dtracetoolkit/Man/man1m/py_flowtime.d.1m
ontrib/dtracetoolkit/Man/man1m/py_funccalls.d.1m
ontrib/dtracetoolkit/Man/man1m/py_malloc.d.1m
ontrib/dtracetoolkit/Man/man1m/py_mallocstk.d.1m
ontrib/dtracetoolkit/Man/man1m/py_profile.d.1m
ontrib/dtracetoolkit/Man/man1m/py_syscalls.d.1m
ontrib/dtracetoolkit/Man/man1m/py_syscolors.d.1m
ontrib/dtracetoolkit/Man/man1m/py_who.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_calldist.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_calls.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_calltime.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_cpudist.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_cputime.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_flow.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_flowinfo.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_flowtime.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_funccalls.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_lines.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_malloc.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_objcpu.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_objnew.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_stat.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_syscalls.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_syscolors.d.1m
ontrib/dtracetoolkit/Man/man1m/rb_who.d.1m
ontrib/dtracetoolkit/Man/man1m/readbytes.d.1m
ontrib/dtracetoolkit/Man/man1m/readdist.d.1m
ontrib/dtracetoolkit/Man/man1m/rfileio.d.1m
ontrib/dtracetoolkit/Man/man1m/rfsio.d.1m
ontrib/dtracetoolkit/Man/man1m/runocc.d.1m
ontrib/dtracetoolkit/Man/man1m/rwbbypid.d.1m
ontrib/dtracetoolkit/Man/man1m/rwbypid.d.1m
ontrib/dtracetoolkit/Man/man1m/rwbytype.d.1m
ontrib/dtracetoolkit/Man/man1m/rwsnoop.1m
ontrib/dtracetoolkit/Man/man1m/rwtop.1m
ontrib/dtracetoolkit/Man/man1m/sampleproc.1m
ontrib/dtracetoolkit/Man/man1m/sar-c.d.1m
ontrib/dtracetoolkit/Man/man1m/seeksize.d.1m
ontrib/dtracetoolkit/Man/man1m/setuids.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_calldist.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_calls.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_calltime.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_cpudist.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_cputime.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_flow.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_flowinfo.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_flowtime.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_lines.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_pidcolors.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_stat.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_syscalls.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_syscolors.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_wasted.d.1m
ontrib/dtracetoolkit/Man/man1m/sh_who.d.1m
ontrib/dtracetoolkit/Man/man1m/shellsnoop.1m
ontrib/dtracetoolkit/Man/man1m/shortlived.d.1m
ontrib/dtracetoolkit/Man/man1m/sigdist.d.1m
ontrib/dtracetoolkit/Man/man1m/stacksize.d.1m
ontrib/dtracetoolkit/Man/man1m/statsnoop.1m
ontrib/dtracetoolkit/Man/man1m/swapinfo.d.1m
ontrib/dtracetoolkit/Man/man1m/sysbypid.d.1m
ontrib/dtracetoolkit/Man/man1m/syscallbypid.d.1m
ontrib/dtracetoolkit/Man/man1m/syscallbyproc.d.1m
ontrib/dtracetoolkit/Man/man1m/syscallbysysc.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_calldist.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_calls.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_calltime.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_cpudist.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_cputime.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_flow.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_flowtime.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_ins.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_insflow.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_proccalls.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_procflow.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_stat.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_syscalls.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_syscolors.d.1m
ontrib/dtracetoolkit/Man/man1m/tcl_who.d.1m
ontrib/dtracetoolkit/Man/man1m/tcpsnoop.1m
ontrib/dtracetoolkit/Man/man1m/tcpsnoop.d.1m
ontrib/dtracetoolkit/Man/man1m/tcpsnoop_snv.1m
ontrib/dtracetoolkit/Man/man1m/tcpsnoop_snv.d.1m
ontrib/dtracetoolkit/Man/man1m/tcpstat.d.1m
ontrib/dtracetoolkit/Man/man1m/tcptop.1m
ontrib/dtracetoolkit/Man/man1m/tcptop_snv.1m
ontrib/dtracetoolkit/Man/man1m/tcpwdist.d.1m
ontrib/dtracetoolkit/Man/man1m/threaded.d.1m
ontrib/dtracetoolkit/Man/man1m/topsyscall.1m
ontrib/dtracetoolkit/Man/man1m/topsysproc.1m
ontrib/dtracetoolkit/Man/man1m/udpstat.d.1m
ontrib/dtracetoolkit/Man/man1m/uname-a.d.1m
ontrib/dtracetoolkit/Man/man1m/vmbypid.d.1m
ontrib/dtracetoolkit/Man/man1m/vmstat-p.d.1m
ontrib/dtracetoolkit/Man/man1m/vmstat.d.1m
ontrib/dtracetoolkit/Man/man1m/vopstat.1m
ontrib/dtracetoolkit/Man/man1m/weblatency.d.1m
ontrib/dtracetoolkit/Man/man1m/whatexec.d.1m
ontrib/dtracetoolkit/Man/man1m/woof.d.1m
ontrib/dtracetoolkit/Man/man1m/wpm.d.1m
ontrib/dtracetoolkit/Man/man1m/writebytes.d.1m
ontrib/dtracetoolkit/Man/man1m/writedist.d.1m
ontrib/dtracetoolkit/Man/man1m/xcallsbypid.d.1m
ontrib/dtracetoolkit/Man/man1m/xvmstat.1m
ontrib/dtracetoolkit/Man/man1m/zvmstat.1m
ontrib/dtracetoolkit/Mem/Readme
ontrib/dtracetoolkit/Mem/anonpgpid.d
ontrib/dtracetoolkit/Mem/minfbypid.d
ontrib/dtracetoolkit/Mem/minfbyproc.d
ontrib/dtracetoolkit/Mem/pgpginbypid.d
ontrib/dtracetoolkit/Mem/pgpginbyproc.d
ontrib/dtracetoolkit/Mem/swapinfo.d
ontrib/dtracetoolkit/Mem/vmbypid.d
ontrib/dtracetoolkit/Mem/vmstat-p.d
ontrib/dtracetoolkit/Mem/vmstat.d
ontrib/dtracetoolkit/Mem/xvmstat
ontrib/dtracetoolkit/Misc/Readme
ontrib/dtracetoolkit/Misc/guess.d
ontrib/dtracetoolkit/Misc/woof.d
ontrib/dtracetoolkit/Misc/wpm.d
ontrib/dtracetoolkit/Net/Readme
ontrib/dtracetoolkit/Net/connections
ontrib/dtracetoolkit/Net/icmpstat.d
ontrib/dtracetoolkit/Net/tcpsnoop
ontrib/dtracetoolkit/Net/tcpsnoop.d
ontrib/dtracetoolkit/Net/tcpsnoop_snv
ontrib/dtracetoolkit/Net/tcpsnoop_snv.d
ontrib/dtracetoolkit/Net/tcpstat.d
ontrib/dtracetoolkit/Net/tcptop
ontrib/dtracetoolkit/Net/tcptop_snv
ontrib/dtracetoolkit/Net/tcpwdist.d
ontrib/dtracetoolkit/Net/udpstat.d
ontrib/dtracetoolkit/Notes/ALLcolors_notes.txt
ontrib/dtracetoolkit/Notes/ALLelapsed_notes.txt
ontrib/dtracetoolkit/Notes/ALLexclusive_notes.txt
ontrib/dtracetoolkit/Notes/ALLfbt_notes.txt
ontrib/dtracetoolkit/Notes/ALLflow_notes.txt
ontrib/dtracetoolkit/Notes/ALLinclusive_notes.txt
ontrib/dtracetoolkit/Notes/ALLjava_notes.txt
ontrib/dtracetoolkit/Notes/ALLoncpu_notes.txt
ontrib/dtracetoolkit/Notes/ALLoverhead.txt
ontrib/dtracetoolkit/Notes/ALLperl_notes.txt
ontrib/dtracetoolkit/Notes/ALLsnoop_notes.txt
ontrib/dtracetoolkit/Notes/Readme
ontrib/dtracetoolkit/Notes/cputimes_notes.txt
ontrib/dtracetoolkit/Notes/dappprof_notes.txt
ontrib/dtracetoolkit/Notes/dapptrace_notes.txt
ontrib/dtracetoolkit/Notes/dtruss_notes.txt
ontrib/dtracetoolkit/Notes/iosnoop_notes.txt
ontrib/dtracetoolkit/Notes/iotop_notes.txt
ontrib/dtracetoolkit/Notes/procsystime_notes.txt
ontrib/dtracetoolkit/Perl/Readme
ontrib/dtracetoolkit/Perl/pl_calldist.d
ontrib/dtracetoolkit/Perl/pl_calltime.d
ontrib/dtracetoolkit/Perl/pl_cpudist.d
ontrib/dtracetoolkit/Perl/pl_cputime.d
ontrib/dtracetoolkit/Perl/pl_flow.d
ontrib/dtracetoolkit/Perl/pl_flowinfo.d
ontrib/dtracetoolkit/Perl/pl_flowtime.d
ontrib/dtracetoolkit/Perl/pl_malloc.d
ontrib/dtracetoolkit/Perl/pl_subcalls.d
ontrib/dtracetoolkit/Perl/pl_syscalls.d
ontrib/dtracetoolkit/Perl/pl_syscolors.d
ontrib/dtracetoolkit/Perl/pl_who.d
ontrib/dtracetoolkit/Php/Readme
ontrib/dtracetoolkit/Php/php_calldist.d
ontrib/dtracetoolkit/Php/php_calltime.d
ontrib/dtracetoolkit/Php/php_cpudist.d
ontrib/dtracetoolkit/Php/php_cputime.d
ontrib/dtracetoolkit/Php/php_flow.d
ontrib/dtracetoolkit/Php/php_flowinfo.d
ontrib/dtracetoolkit/Php/php_flowtime.d
ontrib/dtracetoolkit/Php/php_funccalls.d
ontrib/dtracetoolkit/Php/php_malloc.d
ontrib/dtracetoolkit/Php/php_syscalls.d
ontrib/dtracetoolkit/Php/php_syscolors.d
ontrib/dtracetoolkit/Php/php_who.d
ontrib/dtracetoolkit/Proc/Readme
ontrib/dtracetoolkit/Proc/crash.d
ontrib/dtracetoolkit/Proc/creatbyproc.d
ontrib/dtracetoolkit/Proc/dappprof
ontrib/dtracetoolkit/Proc/dapptrace
ontrib/dtracetoolkit/Proc/fddist
ontrib/dtracetoolkit/Proc/filebyproc.d
ontrib/dtracetoolkit/Proc/kill.d
ontrib/dtracetoolkit/Proc/lastwords
ontrib/dtracetoolkit/Proc/mmapfiles.d
ontrib/dtracetoolkit/Proc/newproc.d
ontrib/dtracetoolkit/Proc/pathopens.d
ontrib/dtracetoolkit/Proc/pfilestat
ontrib/dtracetoolkit/Proc/pidpersec.d
ontrib/dtracetoolkit/Proc/readbytes.d
ontrib/dtracetoolkit/Proc/readdist.d
ontrib/dtracetoolkit/Proc/rwbbypid.d
ontrib/dtracetoolkit/Proc/rwbypid.d
ontrib/dtracetoolkit/Proc/rwbytype.d
ontrib/dtracetoolkit/Proc/sampleproc
ontrib/dtracetoolkit/Proc/shortlived.d
ontrib/dtracetoolkit/Proc/sigdist.d
ontrib/dtracetoolkit/Proc/stacksize.d
ontrib/dtracetoolkit/Proc/sysbypid.d
ontrib/dtracetoolkit/Proc/syscallbypid.d
ontrib/dtracetoolkit/Proc/syscallbyproc.d
ontrib/dtracetoolkit/Proc/threaded.d
ontrib/dtracetoolkit/Proc/topsysproc
ontrib/dtracetoolkit/Proc/writebytes.d
ontrib/dtracetoolkit/Proc/writedist.d
ontrib/dtracetoolkit/Python/Readme
ontrib/dtracetoolkit/Python/py_calldist.d
ontrib/dtracetoolkit/Python/py_calltime.d
ontrib/dtracetoolkit/Python/py_cpudist.d
ontrib/dtracetoolkit/Python/py_cputime.d
ontrib/dtracetoolkit/Python/py_flow.d
ontrib/dtracetoolkit/Python/py_flowinfo.d
ontrib/dtracetoolkit/Python/py_flowtime.d
ontrib/dtracetoolkit/Python/py_funccalls.d
ontrib/dtracetoolkit/Python/py_malloc.d
ontrib/dtracetoolkit/Python/py_mallocstk.d
ontrib/dtracetoolkit/Python/py_profile.d
ontrib/dtracetoolkit/Python/py_syscalls.d
ontrib/dtracetoolkit/Python/py_syscolors.d
ontrib/dtracetoolkit/Python/py_who.d
ontrib/dtracetoolkit/README
ontrib/dtracetoolkit/Ruby/Readme
ontrib/dtracetoolkit/Ruby/rb_calldist.d
ontrib/dtracetoolkit/Ruby/rb_calls.d
ontrib/dtracetoolkit/Ruby/rb_calltime.d
ontrib/dtracetoolkit/Ruby/rb_cpudist.d
ontrib/dtracetoolkit/Ruby/rb_cputime.d
ontrib/dtracetoolkit/Ruby/rb_flow.d
ontrib/dtracetoolkit/Ruby/rb_flowinfo.d
ontrib/dtracetoolkit/Ruby/rb_flowtime.d
ontrib/dtracetoolkit/Ruby/rb_funccalls.d
ontrib/dtracetoolkit/Ruby/rb_lines.d
ontrib/dtracetoolkit/Ruby/rb_malloc.d
ontrib/dtracetoolkit/Ruby/rb_objcpu.d
ontrib/dtracetoolkit/Ruby/rb_objnew.d
ontrib/dtracetoolkit/Ruby/rb_stat.d
ontrib/dtracetoolkit/Ruby/rb_syscalls.d
ontrib/dtracetoolkit/Ruby/rb_syscolors.d
ontrib/dtracetoolkit/Ruby/rb_who.d
ontrib/dtracetoolkit/Shell/Readme
ontrib/dtracetoolkit/Shell/sh_calldist.d
ontrib/dtracetoolkit/Shell/sh_calls.d
ontrib/dtracetoolkit/Shell/sh_calltime.d
ontrib/dtracetoolkit/Shell/sh_cpudist.d
ontrib/dtracetoolkit/Shell/sh_cputime.d
ontrib/dtracetoolkit/Shell/sh_flow.d
ontrib/dtracetoolkit/Shell/sh_flowinfo.d
ontrib/dtracetoolkit/Shell/sh_flowtime.d
ontrib/dtracetoolkit/Shell/sh_lines.d
ontrib/dtracetoolkit/Shell/sh_pidcolors.d
ontrib/dtracetoolkit/Shell/sh_stat.d
ontrib/dtracetoolkit/Shell/sh_syscalls.d
ontrib/dtracetoolkit/Shell/sh_syscolors.d
ontrib/dtracetoolkit/Shell/sh_wasted.d
ontrib/dtracetoolkit/Shell/sh_who.d
ontrib/dtracetoolkit/Snippits/Readme
ontrib/dtracetoolkit/Snippits/fd2pathname.txt
ontrib/dtracetoolkit/System/Readme
ontrib/dtracetoolkit/System/sar-c.d
ontrib/dtracetoolkit/System/syscallbysysc.d
ontrib/dtracetoolkit/System/topsyscall
ontrib/dtracetoolkit/System/uname-a.d
ontrib/dtracetoolkit/Tcl/Readme
ontrib/dtracetoolkit/Tcl/tcl_calldist.d
ontrib/dtracetoolkit/Tcl/tcl_calls.d
ontrib/dtracetoolkit/Tcl/tcl_calltime.d
ontrib/dtracetoolkit/Tcl/tcl_cpudist.d
ontrib/dtracetoolkit/Tcl/tcl_cputime.d
ontrib/dtracetoolkit/Tcl/tcl_flow.d
ontrib/dtracetoolkit/Tcl/tcl_flowtime.d
ontrib/dtracetoolkit/Tcl/tcl_ins.d
ontrib/dtracetoolkit/Tcl/tcl_insflow.d
ontrib/dtracetoolkit/Tcl/tcl_proccalls.d
ontrib/dtracetoolkit/Tcl/tcl_procflow.d
ontrib/dtracetoolkit/Tcl/tcl_stat.d
ontrib/dtracetoolkit/Tcl/tcl_syscalls.d
ontrib/dtracetoolkit/Tcl/tcl_syscolors.d
ontrib/dtracetoolkit/Tcl/tcl_who.d
ontrib/dtracetoolkit/User/Readme
ontrib/dtracetoolkit/User/setuids.d
ontrib/dtracetoolkit/Version
ontrib/dtracetoolkit/Zones/Readme
ontrib/dtracetoolkit/Zones/zvmstat
ontrib/dtracetoolkit/dexplorer
ontrib/dtracetoolkit/dtruss
ontrib/dtracetoolkit/dvmstat
ontrib/dtracetoolkit/errinfo
ontrib/dtracetoolkit/execsnoop
ontrib/dtracetoolkit/hotkernel
ontrib/dtracetoolkit/hotuser
ontrib/dtracetoolkit/install
ontrib/dtracetoolkit/iopattern
ontrib/dtracetoolkit/iosnoop
ontrib/dtracetoolkit/iotop
ontrib/dtracetoolkit/opensnoop
ontrib/dtracetoolkit/procsystime
ontrib/dtracetoolkit/rwsnoop
ontrib/dtracetoolkit/rwtop
ontrib/dtracetoolkit/statsnoop
sr.sbin/Makefile
sr.sbin/dtruss/Makefile
sr.sbin/dtruss/Makefile.depend
sr.sbin/dtruss/dtruss.1
61bb2811b23d7a5494ab8475d97b0d4186c4ce1e 10-May-2016 markj <markj@FreeBSD.org> Fix DTrace test ATF wrapper generation.
sr.sbin/dtrace/tests/dtrace.test.mk
9ac0499d2dd27b67586642fac68b49caae0c7c31 10-May-2016 bapt <bapt@FreeBSD.org> Rename dprintf into dbg_printf to avoid collision with dprintf(3)

When dprintf(3) in 2009 was added a _WITH_DPRINTF guard has also been added.
This rename is made in preparation for the removal of this guard
ontrib/opensolaris/lib/libdtrace/common/drti.c
b4d6cff400c381941a327609d63788c361032954 10-May-2016 bapt <bapt@FreeBSD.org> rename getline into zgetline to avoid collision with getline(3)

When getline(3) in 2009 was added a _WITH_GETLINE guard has also been added.
This rename is made in preparation for the removal of this guard

Obtained from: NetBSD
ompat/opensolaris/misc/fsshare.c
92100036c841e961994633b0de4fdbc3c8217fb7 04-May-2016 ngie <ngie@FreeBSD.org> Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
after r298107

Summary of changes:

- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
namespacing is kept with FILES appropriately, and that this shouldn't need
to be repeated if the namespace changes -- only the definition of PACKAGE
needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
`tests`. In the event we get to the point where things can be split up
enough in the base system, it would make more sense to group the tests
with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)

Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.

MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division
ib/tests/Makefile
bin/tests/Makefile
ests/Makefile
sr.bin/tests/Makefile
sr.sbin/dtrace/tests/Makefile
sr.sbin/dtrace/tests/common/aggs/Makefile
sr.sbin/dtrace/tests/common/arithmetic/Makefile
sr.sbin/dtrace/tests/common/arrays/Makefile
sr.sbin/dtrace/tests/common/assocs/Makefile
sr.sbin/dtrace/tests/common/begin/Makefile
sr.sbin/dtrace/tests/common/bitfields/Makefile
sr.sbin/dtrace/tests/common/buffering/Makefile
sr.sbin/dtrace/tests/common/builtinvar/Makefile
sr.sbin/dtrace/tests/common/cg/Makefile
sr.sbin/dtrace/tests/common/clauses/Makefile
sr.sbin/dtrace/tests/common/cpc/Makefile
sr.sbin/dtrace/tests/common/decls/Makefile
sr.sbin/dtrace/tests/common/docsExamples/Makefile
sr.sbin/dtrace/tests/common/drops/Makefile
sr.sbin/dtrace/tests/common/dtraceUtil/Makefile
sr.sbin/dtrace/tests/common/end/Makefile
sr.sbin/dtrace/tests/common/enum/Makefile
sr.sbin/dtrace/tests/common/error/Makefile
sr.sbin/dtrace/tests/common/exit/Makefile
sr.sbin/dtrace/tests/common/fbtprovider/Makefile
sr.sbin/dtrace/tests/common/funcs/Makefile
sr.sbin/dtrace/tests/common/grammar/Makefile
sr.sbin/dtrace/tests/common/include/Makefile
sr.sbin/dtrace/tests/common/inline/Makefile
sr.sbin/dtrace/tests/common/io/Makefile
sr.sbin/dtrace/tests/common/ip/Makefile
sr.sbin/dtrace/tests/common/java_api/Makefile
sr.sbin/dtrace/tests/common/json/Makefile
sr.sbin/dtrace/tests/common/lexer/Makefile
sr.sbin/dtrace/tests/common/llquantize/Makefile
sr.sbin/dtrace/tests/common/mdb/Makefile
sr.sbin/dtrace/tests/common/mib/Makefile
sr.sbin/dtrace/tests/common/misc/Makefile
sr.sbin/dtrace/tests/common/multiaggs/Makefile
sr.sbin/dtrace/tests/common/nfs/Makefile
sr.sbin/dtrace/tests/common/offsetof/Makefile
sr.sbin/dtrace/tests/common/operators/Makefile
sr.sbin/dtrace/tests/common/pid/Makefile
sr.sbin/dtrace/tests/common/plockstat/Makefile
sr.sbin/dtrace/tests/common/pointers/Makefile
sr.sbin/dtrace/tests/common/pragma/Makefile
sr.sbin/dtrace/tests/common/predicates/Makefile
sr.sbin/dtrace/tests/common/preprocessor/Makefile
sr.sbin/dtrace/tests/common/print/Makefile
sr.sbin/dtrace/tests/common/printa/Makefile
sr.sbin/dtrace/tests/common/printf/Makefile
sr.sbin/dtrace/tests/common/privs/Makefile
sr.sbin/dtrace/tests/common/probes/Makefile
sr.sbin/dtrace/tests/common/proc/Makefile
sr.sbin/dtrace/tests/common/profile-n/Makefile
sr.sbin/dtrace/tests/common/providers/Makefile
sr.sbin/dtrace/tests/common/raise/Makefile
sr.sbin/dtrace/tests/common/rates/Makefile
sr.sbin/dtrace/tests/common/safety/Makefile
sr.sbin/dtrace/tests/common/scalars/Makefile
sr.sbin/dtrace/tests/common/sched/Makefile
sr.sbin/dtrace/tests/common/scripting/Makefile
sr.sbin/dtrace/tests/common/sdt/Makefile
sr.sbin/dtrace/tests/common/sizeof/Makefile
sr.sbin/dtrace/tests/common/speculation/Makefile
sr.sbin/dtrace/tests/common/stability/Makefile
sr.sbin/dtrace/tests/common/stack/Makefile
sr.sbin/dtrace/tests/common/stackdepth/Makefile
sr.sbin/dtrace/tests/common/stop/Makefile
sr.sbin/dtrace/tests/common/strlen/Makefile
sr.sbin/dtrace/tests/common/strtoll/Makefile
sr.sbin/dtrace/tests/common/struct/Makefile
sr.sbin/dtrace/tests/common/syscall/Makefile
sr.sbin/dtrace/tests/common/sysevent/Makefile
sr.sbin/dtrace/tests/common/tick-n/Makefile
sr.sbin/dtrace/tests/common/trace/Makefile
sr.sbin/dtrace/tests/common/tracemem/Makefile
sr.sbin/dtrace/tests/common/translators/Makefile
sr.sbin/dtrace/tests/common/typedef/Makefile
sr.sbin/dtrace/tests/common/types/Makefile
sr.sbin/dtrace/tests/common/uctf/Makefile
sr.sbin/dtrace/tests/common/union/Makefile
sr.sbin/dtrace/tests/common/usdt/Makefile
sr.sbin/dtrace/tests/common/ustack/Makefile
sr.sbin/dtrace/tests/common/vars/Makefile
sr.sbin/dtrace/tests/common/version/Makefile
sr.sbin/dtrace/tests/dtrace.test.mk
sr.sbin/dtrace/tests/tools/genmakefiles.sh
sr.sbin/tests/Makefile
06b209e9f5a8dcaee81d632c1c5b3785a1ec6382 29-Apr-2016 gjb <gjb@FreeBSD.org> Fix including Kyuafile in packaged base system.

Fix a related typo while here.

Note, this change results in the Kyuafile inclusion in the runtime
package, which needs to be fixed, however addresses the PR as far
as I can tell in my tests.

PR: 209114
Submitted by: ngie
Sponsored by: The FreeBSD Foundation
ib/tests/Makefile
bin/tests/Makefile
ests/Makefile
sr.bin/tests/Makefile
sr.sbin/tests/Makefile
2a471649019b98c148ff2ee6e1ab87cc96a3a845 22-Apr-2016 avg <avg@FreeBSD.org> MFV r298471: 6052 decouple lzc_create() from the implementation details

illumos/illumos-gate@26455f9efcf9b1e44937d4d86d1ce37b006f25a9
https://github.com/illumos/illumos-gate/commit/26455f9efcf9b1e44937d4d86d1ce37b006f25a9

https://www.illumos.org/issues/6052
At the moment type parameter of lzc_create() is of dmu_objset_type_t type.
That exposes an implementation detail and requires sys/fs/zfs.h to be included
in libzfs_core.h creating unnecessary coupling between libzfs_core interface
and ZFS internals.
I think that dmu_objset_type_t should be replaced with a libzfs_core
enumeration of supported dataset types.
For ABI reasons the new enumeration could be bit-compatible with
dmu_objset_type_t.
For example:
typedef enum {
LZC_DST_ZFS = 2,
LZC_DST_ZVOL
} lzc_dataset_type_t;

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Andriy Gapon <andriy.gapon@clusterhq.com>

MFC after: 2 weeks
Sponsored by: ClusterHQ
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
6a3bf4fe17acd8740c761dbeba19407a21635508 16-Apr-2016 bapt <bapt@FreeBSD.org> Print error messages to stderr
ontrib/opensolaris/cmd/zdb/zdb.c
6549ef7d128d37c0dfff87f6c1c189b42ed3e1ef 16-Apr-2016 gjb <gjb@FreeBSD.org> MFH

Sponsored by: The FreeBSD Foundation
c3acce238045e8d2f24015ef62e54c892092db8f 15-Apr-2016 hiren <hiren@FreeBSD.org> Fix the 'type' for a few variables from tcpcb.

Reviewed by: markj
Sponsored by: Limelight Networks
Differential Revision: https://reviews.freebsd.org/D5973
ib/libdtrace/tcp.d
2d6ac6ea572ca93a1ff4e32936214246cc9b2551 12-Apr-2016 gjb <gjb@FreeBSD.org> MFH

Sponsored by: The FreeBSD Foundation
ontrib/opensolaris/lib/libdtrace/common/dt_module.c
6cd8ffac11893ddd3a014b90212e09deacd8ab92 11-Apr-2016 markj <markj@FreeBSD.org> libdtrace: Add a missing unlock to an error handler.

Submitted by: Jihyun Yu <yjh0502@gmail.com>
MFC after: 3 days
ontrib/opensolaris/lib/libdtrace/common/dt_module.c
e0e3598ce13850597a66fd28d102b36881f7d610 11-Apr-2016 gjb <gjb@FreeBSD.org> MFH

Sponsored by: The FreeBSD Foundation
61ede4b2ecba0e7719312562eabb9f52e4d7ecfd 10-Apr-2016 markj <markj@FreeBSD.org> Implement support for boot-time DTrace.

This allows one to enable DTrace probes relatively early during boot,
during SI_SUB_DTRACE_ANON, before dtrace(1) can invoked. The desired
enabling is created using dtrace -A, which writes a /boot/dtrace.dof
file and uses nextboot(8) to ensure that DTrace kernel modules are loaded
and that the DOF file describing the enabling is loaded by loader(8)
during the subsequent boot. The trace output can then be fetched with
dtrace -a.

With this commit, boot-time DTrace is only functional on i386 and amd64: on
other architectures, the high-resolution timer frequency is initialized
during SI_SUB_CLOCKS and is thus not available when the anonymous
tracing state is initialized. On x86, the TSC is used and is thus available
earlier.

MFC after: 1 month
Relnotes: yes
ontrib/opensolaris/cmd/dtrace/dtrace.c
6dcdb61ae36b64cef3125daa63d6dc75f5bcdadd 09-Apr-2016 mav <mav@FreeBSD.org> MFV r297760: 6418 zpool should have a label clearing command

Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Author: Will Andrews <will@firepipe.net>

Closes #83
Closes #32

openzfs/openzfs@9663688425131744221ea99f9e66b9ed964492ae

FreeBSD already had `zpool labelclear` functionality, so this is mostly
just a diff reduction.

MFC after: 1 month
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/cmd/zpool/zpool_vdev.c
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
1dc4c40e3b35564cb2e787ad968e6b4a9fb7eb0f 04-Apr-2016 gjb <gjb@FreeBSD.org> MFH

Sponsored by: The FreeBSD Foundation
3c617afe6f35f75f6c130b29414371425e535c66 03-Apr-2016 avg <avg@FreeBSD.org> fix zfs set canmount=off on an unmounted filesystem

Previously this operation tried to unmount and remount children.
Also see https://www.illumos.org/issues/6428.

MFC after: 2 weeks
X-Needs-Upstreaming: illumos
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
6ba2768c8e47103fa98249ad322514fdb95fdb8c 03-Apr-2016 avg <avg@FreeBSD.org> zfs receive: -u can be ignored sometimes

When force-receiving a filesystem that was already mounted the re-created
filesystem is mounted despite -u flag.

Also see https://www.illumos.org/issues/6412.

PR: 204705
Tested by: Vladimir Krstulja <vlad-fbsd@acheronmedia.com>
MFC after: 2 weeks
X-Needs-Upstreaming: illumos
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
4c1345f8596b6345eb8ad548cdda52b8dc6d41ad 02-Apr-2016 mav <mav@FreeBSD.org> MFV r297505:
6739 userland version of cv_timedwait_hires() always assumes absolute time

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: George Wilson <george.wilson@delphix.com>

illumos/illumos-gate@41c6413cb54bf338d7a59ed789ec2e0e44c35e6f
ontrib/opensolaris/lib/libzpool/common/kernel.c
ontrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
086e6f562ffbb6de24f1e51c7df40f403dd1522b 14-Mar-2016 gjb <gjb@FreeBSD.org> MFH

Sponsored by: The FreeBSD Foundation
3d8720ff799fbd99cbd49536db33d966c305435f 14-Mar-2016 pfg <pfg@FreeBSD.org> libdtrace: use calloc(3) instead of malloc(3) when it makes sense.

calloc(3) is faster and occasionally safer than malloc(3) + bzero(3).

In one case, pointed out by Mark[1], this also cleans up a calculation.

Reviewed by: markj [1]
MFC after: 1 week
ontrib/opensolaris/lib/libdtrace/common/dt_module.c
ontrib/opensolaris/lib/libdtrace/common/dt_regset.c
ontrib/opensolaris/lib/libdtrace/common/dt_strtab.c
1c7e318a9a31cae130bd5b2de01d93e7800f66ff 10-Mar-2016 gjb <gjb@FreeBSD.org> MFH

Sponsored by: The FreeBSD Foundation
aab40fdc3dd7956f91ad07b7f4503747162b3587 09-Mar-2016 bdrewery <bdrewery@FreeBSD.org> DIRDEPS_BUILD: Connect MK_TESTS.

Sponsored by: EMC / Isilon Storage Division
ib/tests/Makefile.depend
bin/tests/Makefile.depend
ests/Makefile.depend
sr.bin/tests/Makefile.depend
sr.sbin/dtrace/tests/Makefile.depend
sr.sbin/dtrace/tests/common/Makefile.depend
sr.sbin/dtrace/tests/common/aggs/Makefile.depend
sr.sbin/dtrace/tests/common/arithmetic/Makefile.depend
sr.sbin/dtrace/tests/common/arrays/Makefile.depend
sr.sbin/dtrace/tests/common/assocs/Makefile.depend
sr.sbin/dtrace/tests/common/begin/Makefile.depend
sr.sbin/dtrace/tests/common/bitfields/Makefile.depend
sr.sbin/dtrace/tests/common/buffering/Makefile.depend
sr.sbin/dtrace/tests/common/builtinvar/Makefile.depend
sr.sbin/dtrace/tests/common/cg/Makefile.depend
sr.sbin/dtrace/tests/common/clauses/Makefile.depend
sr.sbin/dtrace/tests/common/cpc/Makefile.depend
sr.sbin/dtrace/tests/common/decls/Makefile.depend
sr.sbin/dtrace/tests/common/docsExamples/Makefile.depend
sr.sbin/dtrace/tests/common/drops/Makefile.depend
sr.sbin/dtrace/tests/common/dtraceUtil/Makefile.depend
sr.sbin/dtrace/tests/common/end/Makefile.depend
sr.sbin/dtrace/tests/common/enum/Makefile.depend
sr.sbin/dtrace/tests/common/error/Makefile.depend
sr.sbin/dtrace/tests/common/exit/Makefile.depend
sr.sbin/dtrace/tests/common/fbtprovider/Makefile.depend
sr.sbin/dtrace/tests/common/funcs/Makefile.depend
sr.sbin/dtrace/tests/common/grammar/Makefile.depend
sr.sbin/dtrace/tests/common/include/Makefile.depend
sr.sbin/dtrace/tests/common/inline/Makefile.depend
sr.sbin/dtrace/tests/common/io/Makefile.depend
sr.sbin/dtrace/tests/common/ip/Makefile.depend
sr.sbin/dtrace/tests/common/java_api/Makefile.depend
sr.sbin/dtrace/tests/common/json/Makefile.depend
sr.sbin/dtrace/tests/common/lexer/Makefile.depend
sr.sbin/dtrace/tests/common/llquantize/Makefile.depend
sr.sbin/dtrace/tests/common/mdb/Makefile.depend
sr.sbin/dtrace/tests/common/mib/Makefile.depend
sr.sbin/dtrace/tests/common/misc/Makefile.depend
sr.sbin/dtrace/tests/common/multiaggs/Makefile.depend
sr.sbin/dtrace/tests/common/offsetof/Makefile.depend
sr.sbin/dtrace/tests/common/operators/Makefile.depend
sr.sbin/dtrace/tests/common/pid/Makefile.depend
sr.sbin/dtrace/tests/common/plockstat/Makefile.depend
sr.sbin/dtrace/tests/common/pointers/Makefile.depend
sr.sbin/dtrace/tests/common/pragma/Makefile.depend
sr.sbin/dtrace/tests/common/predicates/Makefile.depend
sr.sbin/dtrace/tests/common/preprocessor/Makefile.depend
sr.sbin/dtrace/tests/common/print/Makefile.depend
sr.sbin/dtrace/tests/common/printa/Makefile.depend
sr.sbin/dtrace/tests/common/printf/Makefile.depend
sr.sbin/dtrace/tests/common/privs/Makefile.depend
sr.sbin/dtrace/tests/common/probes/Makefile.depend
sr.sbin/dtrace/tests/common/proc/Makefile.depend
sr.sbin/dtrace/tests/common/profile-n/Makefile.depend
sr.sbin/dtrace/tests/common/providers/Makefile.depend
sr.sbin/dtrace/tests/common/raise/Makefile.depend
sr.sbin/dtrace/tests/common/rates/Makefile.depend
sr.sbin/dtrace/tests/common/safety/Makefile.depend
sr.sbin/dtrace/tests/common/scalars/Makefile.depend
sr.sbin/dtrace/tests/common/sched/Makefile.depend
sr.sbin/dtrace/tests/common/scripting/Makefile.depend
sr.sbin/dtrace/tests/common/sdt/Makefile.depend
sr.sbin/dtrace/tests/common/sizeof/Makefile.depend
sr.sbin/dtrace/tests/common/speculation/Makefile.depend
sr.sbin/dtrace/tests/common/stability/Makefile.depend
sr.sbin/dtrace/tests/common/stack/Makefile.depend
sr.sbin/dtrace/tests/common/stackdepth/Makefile.depend
sr.sbin/dtrace/tests/common/stop/Makefile.depend
sr.sbin/dtrace/tests/common/strlen/Makefile.depend
sr.sbin/dtrace/tests/common/strtoll/Makefile.depend
sr.sbin/dtrace/tests/common/struct/Makefile.depend
sr.sbin/dtrace/tests/common/syscall/Makefile.depend
sr.sbin/dtrace/tests/common/tick-n/Makefile.depend
sr.sbin/dtrace/tests/common/trace/Makefile.depend
sr.sbin/dtrace/tests/common/tracemem/Makefile.depend
sr.sbin/dtrace/tests/common/translators/Makefile.depend
sr.sbin/dtrace/tests/common/typedef/Makefile.depend
sr.sbin/dtrace/tests/common/types/Makefile.depend
sr.sbin/dtrace/tests/common/uctf/Makefile.depend
sr.sbin/dtrace/tests/common/union/Makefile.depend
sr.sbin/dtrace/tests/common/usdt/Makefile.depend
sr.sbin/dtrace/tests/common/ustack/Makefile.depend
sr.sbin/dtrace/tests/common/vars/Makefile.depend
sr.sbin/dtrace/tests/common/version/Makefile.depend
sr.sbin/tests/Makefile.depend
415416ac5a41daf72b6afe63c63b0d0409c7f9e1 09-Mar-2016 mav <mav@FreeBSD.org> Missed addition to r296563 to fix newer tools to work with older kernel.
ontrib/opensolaris/lib/libzfs/common/libzfs_compat.c
97c61b2440bce22f5cd8fbb32df5a0d2559e352f 08-Mar-2016 mav <mav@FreeBSD.org> MFV r296540: 4448 zfs diff misprints unicode characters

Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
Author: Joshua M. Clulow <jmc@joyent.com>

illumos/illumos-gate@b211eb9181f99c20acbf4c528f94cb44b4ca8c31
ontrib/opensolaris/lib/libzfs/common/libzfs_diff.c
129937ee6d1df268cf677ace416f2b6c1a8c157a 08-Mar-2016 mav <mav@FreeBSD.org> MFV r296538: 6544 incorrect comment in libzfs.h about offline status

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Gerhard Roethlin <git@the-color-black.net>

illumos/illumos-gate@cb605c4d8ab24b5a900b8b4ca85db65c22d05fad
ontrib/opensolaris/lib/libzfs/common/libzfs.h
d50062391e3409842d3a4ce6c239513c07c89984 08-Mar-2016 mav <mav@FreeBSD.org> MFV r296536: 6551 cmd/zpool: cleanup gcc warnings

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Robert Mustacchi <rm@joyent.com>

illumos/illumos-gate@b327cd3f3b4dab4f29e7140159b1e01ed2ceef2a
ontrib/opensolaris/cmd/zpool/zpool_iter.c
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/cmd/zpool/zpool_vdev.c
742cbdc12e16b9ef85fd04be628a4bd9e83ba82a 08-Mar-2016 mav <mav@FreeBSD.org> MFV r296534: 6550 cmd/zfs: cleanup gcc warnings

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Igor Kozhukhov <ikozhukhov@gmail.com>

illumos/illumos-gate@c16bcc4577f389573eff411c7b7e040294078c3b
ontrib/opensolaris/cmd/zfs/zfs_main.c
f200ff4e7593123220aabb2b19a5cd5adfd56529 08-Mar-2016 mav <mav@FreeBSD.org> MFV r296532: 6637 replacing "dontclose" with "should_close"

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: David Schwartz <dschwartz783@gmail.com>

illumos/illumos-gate@d189620258b3c9b0e2f7e2104840be2eee7c68e5
ontrib/opensolaris/cmd/zfs/zfs_iter.c
2ad69bb39b85e2c0ebe93a129ec61a5d1aa71407 08-Mar-2016 mav <mav@FreeBSD.org> MFV r296527: 6659 nvlist_free(NULL) is a no-op

Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Marcel Telka <marcel@telka.sk>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>

illumos/illumos-gate@aab83bb83be7342f6cfccaed8d5fe0b2f404855d
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/cmd/zpool/zpool_vdev.c
ontrib/opensolaris/lib/libzfs/common/libzfs_config.c
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
eb06d29389f4f401f2ae07d826816af25221edca 08-Mar-2016 mav <mav@FreeBSD.org> MFV r296518: 5027 zfs large block support (add copyright)

Author: Matthew Ahrens <matt@mahrens.org>

illumos/illumos-gate@c3d26abc9ee97b4f60233556aadeb57e0bd30bb9
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/cmd/zstreamdump/zstreamdump.c
ontrib/opensolaris/cmd/ztest/ztest.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
dca4cd64ea6b1e8db72455a81d48e7d323aead09 08-Mar-2016 mav <mav@FreeBSD.org> MFV r296505: 6531 Provide mechanism to artificially limit disk performance

Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Prakash Surya <prakash.surya@delphix.com>

illumos/illumos-gate@97e81309571898df9fdd94aab1216dfcf23e060b
ontrib/opensolaris/cmd/zinject/zinject.c
f4bd2481be4a57485def5a36b1489879e5d7a470 06-Mar-2016 gjb <gjb@FreeBSD.org> MFH

Sponsored by: The FreeBSD Foundation
d74d168b0f125a4b155175b6593dc09109d035d5 03-Mar-2016 gnn <gnn@FreeBSD.org> fix tcpdebug: - assign to "flags" in each probe, not only debug-input
compute "len" in the same way in each probe

Submitted by: Hannes Mehnert
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D5524
ib/libdtrace/tcp.d
955ce29ea33f5aa2d5477a1fe1a2735ac278cd0d 02-Mar-2016 gjb <gjb@FreeBSD.org> MFH

Sponsored by: The FreeBSD Foundation
2a891f1feb2e67ab5fdbb473405797c2efc34caf 24-Feb-2016 bdrewery <bdrewery@FreeBSD.org> DIRDEPS_BUILD: Regenerate without local dependencies.

These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by: EMC / Isilon Storage Division
ib/libdtrace/Makefile.depend
8bfb527a82b3844c875182139d053826902f90d6 22-Feb-2016 gjb <gjb@FreeBSD.org> MFH

Sponsored by: The FreeBSD Foundation
579b7ad49fdbcb4dd1e016603c5d0774b32c12d1 21-Feb-2016 dim <dim@FreeBSD.org> Fix "invalid type '(null)'" usage messages in zfs(8) and zpool(8).

Currently, zfs(8) and zpool(8) print "invalid type '(null)'" or similar
messages, if you pass in invalid types, sources or column names for "zfs
get", "zfs list" and "zpool get". This is because the commands use
getsubopt(3), and in case of failure, they print 'value', which is NULL
when sub options don't match.

They should print 'suboptarg' instead, which is the documented way to
get at the non-matching sub option value.

Reviewed by: smh
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D5365
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/cmd/zpool/zpool_main.c
adbdbd2fff21519f0d418a20255dfd18a2381dbc 18-Feb-2016 gjb <gjb@FreeBSD.org> MFH

Sponsored by: The FreeBSD Foundation
002a527f3e3443a202e22ac490a3f232dc70f2fc 16-Feb-2016 bdrewery <bdrewery@FreeBSD.org> Test directories can build in parallel fine.

Sponsored by: EMC / Isilon Storage Division
sr.sbin/dtrace/tests/common/Makefile
ae6f20360349bac54d30fa9c9c20a2366905b725 03-Feb-2016 gjb <gjb@FreeBSD.org> More 'tests' packaging fixes.

Sponsored by: The FreeBSD Foundation
ests/Makefile
efd5551e55b056811a107b33e1c30676ee37d0e8 02-Feb-2016 gjb <gjb@FreeBSD.org> MFH

Sponsored by: The FreeBSD Foundation
a6998ad84f9722c560a80302a74fa495e818a153 02-Feb-2016 gjb <gjb@FreeBSD.org> First pass to fix the 'tests' packages.

Sponsored by: The FreeBSD Foundation
ib/tests/Makefile
bin/tests/Makefile
sr.bin/tests/Makefile
sr.sbin/tests/Makefile
e0bef7b56ab0c598635299782cf1a502c6605ef1 29-Jan-2016 mav <mav@FreeBSD.org> MFV 295046: 6358 A faulted pool with only unavailable vdevs triggers
assertion failure in libzfs

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
Reviewed by: Serban Maduta <serban.maduta@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Dan Vatca <dan.vatca@gmail.com>

illumos/illumos-gate@b289d045e084af53efcc025255af8242e41f28fa
ontrib/opensolaris/lib/libzfs/common/libzfs_config.c
3e9d02a4043d187ef743d95070d1774c7348eea0 26-Jan-2016 mav <mav@FreeBSD.org> MFV r294816: 4986 receiving replication stream fails if any snapshot
exceeds refquota

Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Approved by: Gordon Ross <gordon.ross@nexenta.com>
Author: Dan McDonald <danmcd@omniti.com>

illumos/illumos-gate@5878fad70d76d8711f6608c1f80b0447601261c6
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
f904c5a333da8e5dc66548da80c974216ef23c97 26-Jan-2016 mav <mav@FreeBSD.org> MFV r294814: 6393 zfs receive a full send as a clone

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Paul Dagnelie <pcd@delphix.com>

illumos/illumos-gate@68ecb2ec930c4b0f00acaf8e0abb2b19c4b8b76f

This allows to do a full (non-incremental send) and receive it as a clone
of an existing dataset. It can leverage nopwrite to share blocks with the
origin. This can be used to change the relationship of datasets on the
target. For example, maybe on the source you have:

A ---- B ---- C

And you have sent to the target a full of B, and the incremental B->C:

B ---- C

You later realize that you want to have A on the target. You will have to
do a full send of A, but nopwrite can save you space on the target if you
receive it as a clone of B, assuming that A and B have some blocks inxi
common:

B ---- C
\
A
ontrib/opensolaris/cmd/zfs/zfs.8
d38e16a2545f225be0520be44f7ec3aa5dc58d9b 25-Jan-2016 br <br@FreeBSD.org> We don't support libdtrace for RISC-V yet.
ib/Makefile
994c79846a85f23806c9a19711ca9406bee9e50e 14-Jan-2016 markj <markj@FreeBSD.org> Remove a dead local variable, missed in r274565.

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
ontrib/opensolaris/tools/ctf/cvt/merge.c
09f193f6239bfc4e2f7250be4583d1a21e0c1a3d 24-Dec-2015 bapt <bapt@FreeBSD.org> Reduce zfs utilities overlinking
sr.sbin/zdb/Makefile
sr.sbin/zhack/Makefile
2c892ac1f1e544fff0b6fb9559cc17cb5c50e3f3 24-Dec-2015 bapt <bapt@FreeBSD.org> Reduce overlinking
bin/zfs/Makefile
bin/zpool/Makefile
5275d9d01cfce568605fed9eb0d0a0d6963a7b3b 23-Dec-2015 bapt <bapt@FreeBSD.org> Report an error if zdb cannot initialize zfs

If the zfs module is not present and not loadable, report an error
to the user instead of crashing

Reviewed by: mahrens
Sponsored by: Gandi.net
Differential Revision: https://reviews.freebsd.org/D4691
ontrib/opensolaris/cmd/zdb/zdb.c
c4d5e0e59031ab795fa43591ac05289871a4a473 07-Dec-2015 markj <markj@FreeBSD.org> Add a trailing newline to the expected output for tst.walltimestamp.ksh.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out
da2ed3e6e3499ff6198fa0b0d259d9e11ae4a5fb 07-Dec-2015 markj <markj@FreeBSD.org> Fix a discrepancy in r291738.

The script that generates these makefiles was changed to modify LIBADD
rather than LDADD/DPADD, but the makefile itself was also changed in a
slightly different way.
sr.sbin/dtrace/tests/common/proc/Makefile
d51ee4b656e08a25002de0cdb174aedb01a0f1a2 07-Dec-2015 markj <markj@FreeBSD.org> Update DTrace test suite makefiles after r291963.
sr.sbin/dtrace/tests/common/usdt/Makefile
8fdcecf370f4a3c549ff1edc8228634b7d16b666 07-Dec-2015 markj <markj@FreeBSD.org> MFV r289003:
6271 dtrace caused excessive fork time

Author: Bryan Cantrill <bryan@joyent.com>
Reviewed by: Adam Leventhal <ahl@delphix.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Gordon Ross <gwr@nexenta.com>

illumos/illumos-gate@7bd3c1d12d0c764e1517c3aca62c634409356764
6744527ba7a66fb8f409c8aea6c9c6ac3b8b84c6 07-Dec-2015 markj <markj@FreeBSD.org> Modify DTRACEHIOC_ADDDOF to copy the DOF section from the target process.

r281257 added support for lazyload mode by allowing dtrace(1) to register
a DOF section on behalf of a traced process. This was implemented by
having libdtrace copy the DOF section into a heap-allocated buffer and
passing its address to the ioctl handler. However, DTrace uses the DOF
section address as a lookup key in certain cases, so the ioctl handler
should be given the target process' DOF section address instead. This
change modifies the ADDDOF handler to copy the DOF section in from the
target process, rather than from dtrace(1).
ontrib/opensolaris/lib/libdtrace/common/dt_pid.c
bb97a3d43c2b7f2a5b4f05069e3bb12383a9e20d 04-Dec-2015 bdrewery <bdrewery@FreeBSD.org> Fix LDADD/DPADD that should be LIBADD.

Sponsored by: EMC / Isilon Storage Division
ib/libctf/Makefile
ib/libzfs/Makefile
ib/libzfs_core/Makefile
ib/libzpool/Makefile
bin/zfs/Makefile
bin/zpool/Makefile
sr.bin/zinject/Makefile
sr.bin/zstreamdump/Makefile
sr.bin/ztest/Makefile
sr.sbin/dtrace/tests/common/proc/Makefile
sr.sbin/dtrace/tests/tools/genmakefiles.sh
sr.sbin/zdb/Makefile
sr.sbin/zhack/Makefile
bec433de08095b2933ceea82a956e68b852e606a 04-Dec-2015 bdrewery <bdrewery@FreeBSD.org> Simplify the LIBRARIES_ONLY hacks so that install: is not needed here.

This uses the same pattern that I applied to the other cases of this in
the csu directories.

Sponsored by: EMC / Isilon Storage Division
ib/drti/Makefile
449c785f1a7bca246c222cc63fbdbffaa0462c24 02-Dec-2015 bdrewery <bdrewery@FreeBSD.org> Fix the build for non-amd64.
ontrib/opensolaris/cmd/plockstat/plockstat.c
975d29fe5768828bad1af03d20f4e9f56086be9f 02-Dec-2015 bdrewery <bdrewery@FreeBSD.org> Reduce overlinking of libdtrace consumers with libctf, libelf, libproc.

The proper place for this list is _DP_dtrace.

Due to removing the LDADD_dtrace, more LIBADD are needed in
cddl/usr.sbin/dtrace to prevent underlinking.

This fixes overlinking in cddl/usr.sbin/lockstat and
cddl/usr.sbin/plockstat.

Sponsored by: EMC / Isilon Storage Division
sr.sbin/dtrace/Makefile
ba39dbdfa20e0d61af41cf86f86bc9298075903f 02-Dec-2015 bdrewery <bdrewery@FreeBSD.org> Fully connect cddl/usr.sbin/plockstat.

There seems to be no reason to keep this so private.

Also add missing optional MK_CDDL files.

Sponsored by: EMC / Isilon Storage Division
sr.sbin/Makefile
sr.sbin/plockstat/Makefile.depend
fe1ef27d4aa7466620f722f3d6685366106bfc53 01-Dec-2015 bdrewery <bdrewery@FreeBSD.org> META MODE: Update dependencies with 'the-lot' and add missing directories.

This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so. A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR. These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package. The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by: EMC / Isilon Storage Division
ib/libzfs/Makefile.depend
bin/zfs/Makefile.depend
bin/zpool/Makefile.depend
3ed6ae60128e473ae6df6eecc77fb97509dd1078 01-Dec-2015 bdrewery <bdrewery@FreeBSD.org> META MODE: Fix userland/cddl.

MK_CTF controls whether ctfmerge is ran against the binaries, not
whether CTF tools should be built.

Sponsored by: EMC / Isilon Storage Division
sr.bin/ctfconvert/Makefile.depend
sr.bin/ctfdump/Makefile.depend
sr.bin/ctfmerge/Makefile.depend
sr.sbin/dtrace/Makefile.depend
57aa1bddef6d553046acf7b35aadde1ac1843861 25-Nov-2015 bdrewery <bdrewery@FreeBSD.org> Rename Makefile.inc1 to dtrace.test.mk to avoid clash with top-level Makefile.inc1.

Discussed with: ngie, markj
Sponsored by: EMC / Isilon Storage Division
sr.sbin/dtrace/tests/Makefile.inc1
sr.sbin/dtrace/tests/common/aggs/Makefile
sr.sbin/dtrace/tests/common/arithmetic/Makefile
sr.sbin/dtrace/tests/common/arrays/Makefile
sr.sbin/dtrace/tests/common/assocs/Makefile
sr.sbin/dtrace/tests/common/begin/Makefile
sr.sbin/dtrace/tests/common/bitfields/Makefile
sr.sbin/dtrace/tests/common/buffering/Makefile
sr.sbin/dtrace/tests/common/builtinvar/Makefile
sr.sbin/dtrace/tests/common/cg/Makefile
sr.sbin/dtrace/tests/common/clauses/Makefile
sr.sbin/dtrace/tests/common/cpc/Makefile
sr.sbin/dtrace/tests/common/decls/Makefile
sr.sbin/dtrace/tests/common/docsExamples/Makefile
sr.sbin/dtrace/tests/common/drops/Makefile
sr.sbin/dtrace/tests/common/dtraceUtil/Makefile
sr.sbin/dtrace/tests/common/end/Makefile
sr.sbin/dtrace/tests/common/enum/Makefile
sr.sbin/dtrace/tests/common/error/Makefile
sr.sbin/dtrace/tests/common/exit/Makefile
sr.sbin/dtrace/tests/common/fbtprovider/Makefile
sr.sbin/dtrace/tests/common/funcs/Makefile
sr.sbin/dtrace/tests/common/grammar/Makefile
sr.sbin/dtrace/tests/common/include/Makefile
sr.sbin/dtrace/tests/common/inline/Makefile
sr.sbin/dtrace/tests/common/io/Makefile
sr.sbin/dtrace/tests/common/ip/Makefile
sr.sbin/dtrace/tests/common/java_api/Makefile
sr.sbin/dtrace/tests/common/json/Makefile
sr.sbin/dtrace/tests/common/lexer/Makefile
sr.sbin/dtrace/tests/common/llquantize/Makefile
sr.sbin/dtrace/tests/common/mdb/Makefile
sr.sbin/dtrace/tests/common/mib/Makefile
sr.sbin/dtrace/tests/common/misc/Makefile
sr.sbin/dtrace/tests/common/multiaggs/Makefile
sr.sbin/dtrace/tests/common/nfs/Makefile
sr.sbin/dtrace/tests/common/offsetof/Makefile
sr.sbin/dtrace/tests/common/operators/Makefile
sr.sbin/dtrace/tests/common/pid/Makefile
sr.sbin/dtrace/tests/common/plockstat/Makefile
sr.sbin/dtrace/tests/common/pointers/Makefile
sr.sbin/dtrace/tests/common/pragma/Makefile
sr.sbin/dtrace/tests/common/predicates/Makefile
sr.sbin/dtrace/tests/common/preprocessor/Makefile
sr.sbin/dtrace/tests/common/print/Makefile
sr.sbin/dtrace/tests/common/printa/Makefile
sr.sbin/dtrace/tests/common/printf/Makefile
sr.sbin/dtrace/tests/common/privs/Makefile
sr.sbin/dtrace/tests/common/probes/Makefile
sr.sbin/dtrace/tests/common/proc/Makefile
sr.sbin/dtrace/tests/common/profile-n/Makefile
sr.sbin/dtrace/tests/common/providers/Makefile
sr.sbin/dtrace/tests/common/raise/Makefile
sr.sbin/dtrace/tests/common/rates/Makefile
sr.sbin/dtrace/tests/common/safety/Makefile
sr.sbin/dtrace/tests/common/scalars/Makefile
sr.sbin/dtrace/tests/common/sched/Makefile
sr.sbin/dtrace/tests/common/scripting/Makefile
sr.sbin/dtrace/tests/common/sdt/Makefile
sr.sbin/dtrace/tests/common/sizeof/Makefile
sr.sbin/dtrace/tests/common/speculation/Makefile
sr.sbin/dtrace/tests/common/stability/Makefile
sr.sbin/dtrace/tests/common/stack/Makefile
sr.sbin/dtrace/tests/common/stackdepth/Makefile
sr.sbin/dtrace/tests/common/stop/Makefile
sr.sbin/dtrace/tests/common/strlen/Makefile
sr.sbin/dtrace/tests/common/strtoll/Makefile
sr.sbin/dtrace/tests/common/struct/Makefile
sr.sbin/dtrace/tests/common/syscall/Makefile
sr.sbin/dtrace/tests/common/sysevent/Makefile
sr.sbin/dtrace/tests/common/tick-n/Makefile
sr.sbin/dtrace/tests/common/trace/Makefile
sr.sbin/dtrace/tests/common/tracemem/Makefile
sr.sbin/dtrace/tests/common/translators/Makefile
sr.sbin/dtrace/tests/common/typedef/Makefile
sr.sbin/dtrace/tests/common/types/Makefile
sr.sbin/dtrace/tests/common/uctf/Makefile
sr.sbin/dtrace/tests/common/union/Makefile
sr.sbin/dtrace/tests/common/usdt/Makefile
sr.sbin/dtrace/tests/common/ustack/Makefile
sr.sbin/dtrace/tests/common/vars/Makefile
sr.sbin/dtrace/tests/common/version/Makefile
sr.sbin/dtrace/tests/dtrace.test.mk
sr.sbin/dtrace/tests/tools/genmakefiles.sh
e13d6f8b3f1e6da25895f42f0e3321a23b4d2132 25-Nov-2015 bdrewery <bdrewery@FreeBSD.org> META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.

This both avoids some dependencies on xinstall.host and allows
bootstrapping on older releases to work due to lack of at least 'install -l'
support.

Sponsored by: EMC / Isilon Storage Division
ib/libavl/Makefile.depend
ib/libctf/Makefile.depend
ib/libdtrace/Makefile.depend
ib/libnvpair/Makefile.depend
ib/libumem/Makefile.depend
ib/libuutil/Makefile.depend
ib/libzfs/Makefile.depend
ib/libzfs_core/Makefile.depend
ib/libzpool/Makefile.depend
0b49a79f5ea54e4c5853245c9ea003f08d2cca63 19-Nov-2015 smh <smh@FreeBSD.org> Fix zfs(8) set options

Fix zfs(8) not formatting due to wrong macro (Oc) in the syntax for the new
zfs set multiple dataset properties option.

PR: 204631
Submitted by: Thomas Eberhardt
Sponsored by: Multiplay
ontrib/opensolaris/cmd/zfs/zfs.8
49850d4b70492ce8bdb6e2126891c1ce23505784 09-Nov-2015 ngie <ngie@FreeBSD.org> Reduce the Makefile snippet complexity a bit

- Set BINDIR to TESTSDIR globally (and subsequently, remove all
`${FILESGROUP}DIR` setting because BINDIR is set to `TESTSDIR`)
- Set MAN to "" globally, instead of per-PROG

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
sr.sbin/dtrace/tests/Makefile.inc1
b3a321592a433d57be702defd112918f9fb8af9b 30-Oct-2015 bdrewery <bdrewery@FreeBSD.org> Remove unneeded _RECURSING_PROGS check.

It is definitely not needed after r288158, and is a private variable as well
that should not be checked here.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
sr.sbin/dtrace/tests/Makefile.inc1
4abd22e8d7407825e7426edfd01fae19644a3ef6 26-Oct-2015 allanjude <allanjude@FreeBSD.org> Allow 'zfs holds -r' to recurse over a file system or volume to find holds

Previously, the parameters of 'zfs holds' could only be snapshots

Add -d <depth> flag to limit depth of recursion
Add -p flag to print literal values, rather than interpreted values
Add -H flag to suppress header output and use tabs rather than whitespace

Reviewed by: mahrens, smh, dteske
Approved by: bapt (mentor)
MFC after: 3 weeks
Relnotes: yes
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D3994
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zfs/zfs_main.c
3ef7519b6e055158d1266eb7951bd9a932dcb96c 24-Oct-2015 markj <markj@FreeBSD.org> DWARF emitted by clang 3.7 encodes array sizes using the DW_AT_count
attribute rather than DW_AT_upper_bound. Teach ctfconvert about this so that
array type sizes are encoded correctly.

PR: 203772
MFC after: 1 week
ontrib/opensolaris/tools/ctf/cvt/dwarf.c
f204be76de3ab32ce7e295d0767252f547d6075f 19-Oct-2015 mav <mav@FreeBSD.org> MFV r289561: 6328 Fix cstyle errors in zfs codebase

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed by: Jorgen Lundman <lundman@lundman.net>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Paul Dagnelie <pcd@delphix.com>

illumos/illumos-gate@9a686fbc186e8e2a64e9a5094d44c7d6fa0ea167
ontrib/opensolaris/cmd/zpool/zpool_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs_iter.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
ontrib/opensolaris/lib/libzfs/common/libzfs_util.c
ontrib/opensolaris/lib/libzpool/common/kernel.c
82b76061b617fdfb2755d8ab5bdaed2f707ea818 18-Oct-2015 mav <mav@FreeBSD.org> MFV r289535: 5767 fix several problems with zfs test suite

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: John Wren Kennedy <john.kennedy@delphix.com>

illumos/illumos-gate@52244c0958bdf281ca42932b449f644b4decfdc2

In fact, only unrelated part of that commit is applicable:
8. zpool list -v doesn't print spares
It also doesn't correctly identify log devices.
ontrib/opensolaris/cmd/zpool/zpool_main.c
14f613391579f707498faa0327abbbdbe979a1bb 18-Oct-2015 mav <mav@FreeBSD.org> MFV r289530: 5847 libzfs_diff should check zfs_prop_get() return

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Albert Lee <trisk@omniti.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Alexander Eremin <a.eremin@nexenta.com>

illumos/illumos-gate@8430278980a48338e04c7dd52b495b7f1551367a
ontrib/opensolaris/lib/libzfs/common/libzfs_diff.c
93afe7bdc606349a681a0e5518afa7640d4ee4d6 18-Oct-2015 mav <mav@FreeBSD.org> Reduce diff from upstream.

Should be no functional change.
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
1c4271d11bbe87be208c21d7f42a533582b2a2e4 18-Oct-2015 mav <mav@FreeBSD.org> MFV r289526:
5561 support root pools on EFI/GPT partitioned disks
5125 update zpool/libzfs to manage bootable whole disk pools (EFI/GPT labeled disks)

Reviewed by: Jean McCormack <jean.mccormack@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Hans Rosenfeld <hans.rosenfeld@nexenta.com>

illumos/illumos-gate@1a902ef8628b0dffd6df5442354ab59bb8530962

This is NOP changes for FreeBSD.
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
97500960c515969155e2b3bc490ce191e40254ee 18-Oct-2015 mav <mav@FreeBSD.org> MFC r289498: 6298 zfs_create_008_neg and zpool_create_023_neg need to be
updated for large block support.

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Joe Stein <joe.stein@delphix.com>

illumos/illumos-gate@e9316f7696401f3e5e263a5939031cb8d5641a88
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
a715e58b8c9563e168cabb7f06e58523d5ba33c1 18-Oct-2015 mav <mav@FreeBSD.org> MFV r247180: Update vendor/illumos/dist and vendor-sys/illumos/dist
to illumos-gate 13967:92bec6d87f59

Illumos ZFS issues:
3557 dumpvp_size is not updated correctly when a dump zvol's size is
changed
3558 setting the volsize on a dump device does not return back ENOSPC
3559 setting a volsize larger than the space available sometimes succeeds
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
4fb8e1965fbd0cdf69e826ebec0c93501cf890cf 18-Oct-2015 mav <mav@FreeBSD.org> MFV r289493: 5745 zfs set allows only one dataset property to be set at a time

Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com>
Reviewed by: Richard PALO <richard@NetBSD.org>
Reviewed by: Steven Hartland <killing@multiplay.co.uk>
Approved by: Rich Lowe <richlowe@richlowe.net>
Author: Chris Williamson <chris.williamson@delphix.com>

illumos/illumos-gate@30925561c223021e91d15899cbe75f80e54d8889
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_util.c
d58e8ed932a37bd1eefd67ead3dda35687d3a9f1 16-Oct-2015 mav <mav@FreeBSD.org> MFV r289310:
4185 add new cryptographic checksums to ZFS: SHA-512, Skein, Edon-R

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Matthew Ahrens <mahrens@delphix.com>

illumos/illumos-gate@45818ee124adeaaf947698996b4f4c722afc6d1f

This is only a partial merge of respective ZFS infrastructure changes.
At this moment FreeBSD kernel has no those crypto algorithms, so the
parts of the code to enable them are commented out. When they are
implemented, it will be trivial to plug them in.
153205e33f5afb4965e71c9a5bab7edd7ec215af 15-Oct-2015 bdrewery <bdrewery@FreeBSD.org> Add more SUBDIR_PARALLEL.

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
akefile
c1c5997359a0319d0b6984203c5c3bb10c28274c 15-Oct-2015 mav <mav@FreeBSD.org> MFV r289312: 2605 want to resume interrupted zfs send

Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed by: Xin Li <delphij@freebsd.org>
Reviewed by: Arne Jansen <sensille@gmx.net>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

illumos/illumos-gate@9c3fd1216fa7fb02cfbc78a2518a686d54b48ab8

For more info, see:
- slides http://www.slideshare.net/MatthewAhrens/openzfs-send-and-receive
- video https://www.youtube.com/watch?v=iY44jPMvxog
- manpage changes (for zfs resume -s and zfs send -t)
- upcoming talk at the OpenZFS Developer Summit

The TL;DR is:
Use "zfs receive -s" to save the partially received state on failure.
On failure, get the receive token with "zfs get receive_resume_token <fs>"
Resume the send with "zfs send -t <token_value>"

Relnotes: yes
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/cmd/zstreamdump/zstreamdump.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_compat.c
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
ib/libzfs/Makefile
b800f004107ceb768773500aa53149cd9cc29f77 14-Oct-2015 mav <mav@FreeBSD.org> MFV r289311: 5764 "zfs send -nv" directs output to stderr

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Basil Crow <basil.crow@delphix.com>
Reviewed by: Steven Hartland <killing@multiplay.co.uk>
Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Manoj Joseph <manoj.joseph@delphix.com>

illumos/illumos-gate@dc5f28a3c341db7c241bba77ddc109c141072f27
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
dd1f61836762d6bb73b65e51a11b769b15667412 12-Oct-2015 ngie <ngie@FreeBSD.org> Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison
ib/tests/Makefile
bin/tests/Makefile
ests/Makefile
sr.bin/tests/Makefile
sr.sbin/dtrace/tests/Makefile
sr.sbin/tests/Makefile
a6fac84fcf38d1a17650296ab2f345d62e855db1 30-Sep-2015 markj <markj@FreeBSD.org> Have lockstat(1) trace locks by name rather than by address.

Previously, lockstat(1) would use a lock's address as its identifier when
consuming data describing lock contention and hold events. After collecting
the requested data, it would use ksyms(4) to resolve lock addresses to
names. Of course, this doesn't work too well for locks contained in
dynamically-allocated memory. This change modifies lockstat(1) to trace the
lock names obtained from the base struct lock_object instead, leading to
output that is generally much more useful.

This change also removes the -c option, which is used to coalesce data for
locks in an array. It's not possible to support this option without also
tracing lock addresses, and since lock arrays in which the lock names are
distinct are not very common in FreeBSD, it's simpler to just remove the
option.

Reviewed by: avg (earlier revision)
Differential Revision: https://reviews.freebsd.org/D3661
ontrib/opensolaris/cmd/lockstat/lockstat.1
ontrib/opensolaris/cmd/lockstat/lockstat.c
5f05617bfc4be8dddb44c324b5036b2a08f969a5 30-Sep-2015 markj <markj@FreeBSD.org> Update DTrace test makefiles after r288415.
sr.sbin/dtrace/tests/common/privs/Makefile
sr.sbin/dtrace/tests/common/scalars/Makefile
2571010394cf1c85899a675a6bb4d59c31053614 30-Sep-2015 markj <markj@FreeBSD.org> MFV r288408:
6266 harden dtrace_difo_chunksize() with respect to malicious DIF

illumos/illumos-gate@395c7a3dcfc66b8b671dc4b3c4a2f0ca26449922

Reviewed by: Alex Wilson <alex.wilson@joyent.com>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Author: Bryan Cantrill <bryan@joyent.com>

MFC after: 1 week
cfe011a9e5ef0044a47d46c950f4d7577435a97e 30-Sep-2015 markj <markj@FreeBSD.org> Stop hard-coding a 32-bit data model for USDT tests, and just use the native
model. This was causing many of the tests to fail on amd64 since USDT
support for 32-bit programs is currently non-functional.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.header.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh
9e11cda474d69a5e6d3857d6eafc36c235d8f326 28-Sep-2015 avg <avg@FreeBSD.org> define aok in libnvpair which is linked to all zfs libraries that need aok

This removes the circular dependency of libnvpair on libzfs / libzpool.

PR: 199811
Obtained from: bapt
MFC after: 23 days
ontrib/opensolaris/lib/libzfs/common/libzfs_util.c
ontrib/opensolaris/lib/libzpool/common/kernel.c
b65b1a0f9ea4250428bd69317d5b59aa809d6496 28-Sep-2015 avg <avg@FreeBSD.org> remove unused sgsmsg utility (originally imported from opensolaris)

MFC after: 25 days
ontrib/opensolaris/cmd/sgs/include/_string_table.h
ontrib/opensolaris/cmd/sgs/include/alist.h
ontrib/opensolaris/cmd/sgs/include/debug.h
ontrib/opensolaris/cmd/sgs/include/sgs.h
ontrib/opensolaris/cmd/sgs/include/string_table.h
ontrib/opensolaris/cmd/sgs/messages/sgs.ident
ontrib/opensolaris/cmd/sgs/tools/common/findprime.c
ontrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c
ontrib/opensolaris/cmd/sgs/tools/common/string_table.c
sr.bin/Makefile
sr.bin/sgsmsg/Makefile
sr.bin/sgsmsg/Makefile.depend
5ea7b52a88404665ea0fa36d64f47b2f50d05da5 28-Sep-2015 avg <avg@FreeBSD.org> remove an extra copy of avl.c from illumos contrib code

MFC after: 20 days
ontrib/opensolaris/common/avl/avl.c
f37faa57f7bfd8dc979675bdee67a751a93f8bb6 25-Sep-2015 bdrewery <bdrewery@FreeBSD.org> META_MODE: Remove DEP_RELDIR from Makefile.depend files.

This has not been needed since r284171 in projects/bmake.

Sponsored by: EMC / Isilon Storage Division
sr.bin/ctfconvert/Makefile.depend
sr.bin/ctfdump/Makefile.depend
sr.bin/ctfmerge/Makefile.depend
sr.sbin/dtrace/Makefile.depend
sr.sbin/dtruss/Makefile.depend
d6054a61ef48d446819e69e74b672a259cdd0f94 18-Sep-2015 bdrewery <bdrewery@FreeBSD.org> Use FILES for installing the dtrace scripts.

The BSD.usr.dist mtree always creates /usr/lib/dtrace so there is no
need to check if it exists.

The FILES mechanism already supports LIBRARIES_ONLY.

Sponsored by: EMC / Isilon Storage Division
ib/libdtrace/Makefile
08f689683b70b0bfa3c746259f1038cc089c5f7c 15-Sep-2015 markj <markj@FreeBSD.org> Remove an unneeded typedef of ip6_t from the DTrace ip provider library.
It causes an error when ipfilter is enabled, since ipl.ko contains an
identical typedef.

PR: 203092
MFC after: 1 week
ib/libdtrace/ip.d
15c18a3cba2d0bc8f705f9f03d94d405cb21614d 14-Sep-2015 delphij <delphij@FreeBSD.org> MFV r286224: 5695 dmu_sync'ed holes do not retain birth time
(userland portion that was not merged in r286677)

Update zdb to also print ltime, type, and level information
for these new style holes. Previously, only the logical birth
time would be printed.
ontrib/opensolaris/cmd/zdb/zdb.c
0187024b8d77afba20232aa7a8c895a30fd13cd2 14-Sep-2015 delphij <delphij@FreeBSD.org> MFV r277429:

Document -S option when zfs inherit fails on quota and
in manual pages.

Illumos ZFS issues:

5410 Document -S option to zfs inherit
https://illumos.org/issues/5410

5412 Mention -S option when zfs inherit fails on quota
https://illumos.org/issues/5412

illumos/illumos-gate@5ff8cfa92ec8ea0f8593ad21aa2a04829b0ef5ea

MFC after: 2 weeks
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zfs/zfs_main.c
e39dbc6166a5224eb3a9e6e2dce0ca9da10f8853 13-Sep-2015 gnn <gnn@FreeBSD.org> dd DTrace probe points, translators and a corresponding script
to provide the TCPDEBUG functionality with pure DTrace.

Reviewed by: rwatson
MFC after: 2 weeks
Sponsored by: Limelight Networks
Differential Revision: D3530
ib/libdtrace/tcp.d
e9ff0b2b14b46c9e98990600083e15a5764a8110 12-Sep-2015 delphij <delphij@FreeBSD.org> Fix build (r287703). Lesson learned: no matter how a change looks like an
innocent one, always do a build test first.

Pointy hat to: delphij
ontrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c
97c6fe6d1e7e96a9606a6c4226fdb981931caee7 31-Aug-2015 allanjude <allanjude@FreeBSD.org> Remove duplicate defines introduced in initial ZFS import (r168404)

This change reduces compiler warnings by removing duplicate defines

Line numbers are from r168404 (and r284648)
#define lbolt: lines 384 and 459 (531 and 648) (original was renamed later)
#define lbolt64: lines 385 and 460 (532 and 649) (original was renamed later)
#define gethrestime_sec: lines 390 and 465 (540 and 653)
uint64_t physmem: lines 402 and 463 (561 and 651)

Reviewed by: smh, delphij
Approved by: bapt (mentor)
Sponsored by: ScaleEngine Inc.
Differential Revision: https://reviews.freebsd.org/D2878
ontrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
251669654ae50bb6b39f71a6524c152123e2bcc8 28-Aug-2015 markj <markj@FreeBSD.org> Re-apply r274569. It was reverted in r276848 since that appeared to fix
some ctfmerge crashes that started to occur on i386 weeks after r274569 was
committed. Some later investigation indicated that the crashes were caused
by malformed CTF info that led to a stack overflow. The issue with CTF
info in i386 kernels seems to have been resolved by r261246, which updated
libdwarf and libelf.

r274569 fixes a bug which caused duplicate types to appear in the kernel's
CTF info. This duplication generally does not cause problems when using
DTrace, but makes it easier to hit the limit of 2^15 - 1 distinct type
definitions in a CTF container.

MFC after: 2 weeks
ontrib/opensolaris/tools/ctf/cvt/merge.c
791d6a6004cec6ee640ac7682f9bf004085cbfae 23-Aug-2015 imp <imp@FreeBSD.org> Sparc64 is the odd-man out, so form the if that way rather than
listing everybody else.
ib/Makefile
2c7c53008ad9f471f8f4819c80157a51feadfa99 13-Aug-2015 delphij <delphij@FreeBSD.org> Plug a memory leak.

MFC after: 2 weeks
ontrib/opensolaris/cmd/ztest/ztest.c
95e93478d428d5dde3e6e0e5ab08d3e1bbcf8290 12-Aug-2015 mav <mav@FreeBSD.org> MFV 286707: 5959 clean up per-dataset feature count code

Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Approved by: Richard Lowe <richlowe@richlowe.net>
Author: Matthew Ahrens <mahrens@delphix.com>

illumos/illumos-gate@ca0cc3918a1789fa839194af2a9245f801a06b1a

A ZFS feature flags (large blocks) tracks its refcounts as the number of
datasets that have ever used the feature. Several features of this type
are planned to be added (new checksum functions). This code should be made
common infrastructure rather than duplicating the code for each feature.
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/zhack/zhack.c
ontrib/opensolaris/cmd/zpool/zpool_main.c
99cadf9eedff63c2d1d6b1a5296b21ca12ac2aa0 12-Aug-2015 mav <mav@FreeBSD.org> MFV r286704: 5960 zfs recv should prefetch indirect blocks
5925 zfs receive -o origin=

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Author: Paul Dagnelie <pcd@delphix.com>

While running 'zfs recv' we noticed that every 128th 8K block required a
read. We were seeing that restore_write() was calling dmu_tx_hold_write()
and the indirect block was not cached. We should prefetch upcoming indirect
blocks to avoid having to go to disk and blocking the restore_write().

Allow an incremental send stream to be received as a clone, even if the
stream does not mark it as a clone.
ontrib/opensolaris/cmd/zdb/zdb.c
ontrib/opensolaris/cmd/zfs/zfs.8
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/cmd/ztest/ztest.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
ontrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
53d48e6cc191a84ab881b32c7ed3b412526830db 12-Aug-2015 mav <mav@FreeBSD.org> MFV r286682: 5765 add support for estimating send stream size with
lzc_send_space when source is a bookmark

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: Steven Hartland <killing@multiplay.co.uk>
Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com>
Approved by: Albert Lee <trisk@nexenta.com>
Author: Max Grossman <max.grossman@delphix.com>

illumos/illumos-gate@643da460c8ca583e39ce053081754e24087f84c8
ontrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
7473557e25d60abdeedde38fd841ac8247f99d01 10-Aug-2015 mav <mav@FreeBSD.org> MFV 286602: 5810 zdb should print details of bpobj

Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Alex Reece <alex@delphix.com>
Reviewed by: George Wilson <george@delphix.com>
Reviewed by: Will Andrews <will@freebsd.org>
Reviewed by: Simon Klinkert <simon.klinkert@gmail.com>
Approved by: Gordon Ross <gwr@nexenta.com>
Author: Matthew Ahrens <mahrens@delphix.com>

illumos/illumos-gate@732885fca09e11183dd0ea69aaaab5588fb7dbff
ontrib/opensolaris/cmd/zdb/zdb.c
8fa4822e3df2b60f8fdead79ed582424ac807002 10-Aug-2015 mav <mav@FreeBSD.org> MFV 286586: 5746 more checksumming in zfs send

Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Bayard Bell <buffer.g.overflow@gmail.com>
Approved by: Albert Lee <trisk@omniti.com>
Author: Matthew Ahrens <mahrens@delphix.com>

illumos/illumos-gate@98110f08fa182032082d98be2ddb9391fcd62bf1
ontrib/opensolaris/cmd/zstreamdump/zstreamdump.c
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
3a572fa507ffd20613152ebc945772ec9503bea2 09-Aug-2015 mav <mav@FreeBSD.org> MFV 286546:
5661 ZFS: "compression = on" should use lz4 if feature is enabled

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Xin LI <delphij@freebsd.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Justin T. Gibbs <justing@spectralogic.com>

illumos/illumos-gate@db1741f555ec79def5e9846e6bfd132248514ffe
ontrib/opensolaris/cmd/zfs/zfs.8
4c6e75e399092eee840af6c4753849ead0774993 07-Aug-2015 markj <markj@FreeBSD.org> - Use an explicit "depends_on module kernel" guard in DTrace libraries that
reference types defined in the kernel. Otherwise dtrace(1) expects to find
CTF definitions for all referenced types, which is not very reasonable
when it is being used in a build environment. This was previously worked
around by adding "-x nolibs" to dtrace -h or -G invocations, but as of
r283025, dtrace(1) actually handles dependencies properly, so this is no
longer necessary.
- Remove "pragma ident" directives from DTrace libraries, as they're being
phased out upstream as well.

Submitted by: Krister Johansen <Krister.Johansen@isilon.com> [1]
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
> Description of fields to fill in above: 76 columns --|
> PR: If a GNATS PR is affected by the change.
> Submitted by: If someone else sent in the change.
> Reviewed by: If someone else reviewed your modification.
> Approved by: If you needed approval for this commit.
> Obtained from: If the change is from a third party.
> MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email.
> MFH: Ports tree branch name. Request approval for merge.
> Relnotes: Set to 'yes' for mention in release notes.
> Security: Vulnerability reference (one per line) or description.
> Sponsored by: If the change was sponsored by an organization.
> Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed).
> Empty fields above will be automatically removed.

M libdtrace/io.d
M libdtrace/ip.d
M libdtrace/nfs.d
M libdtrace/nfssrv.d
M libdtrace/psinfo.d
M libdtrace/regs_x86.d
M libdtrace/sched.d
M libdtrace/siftr.d
M libdtrace/tcp.d
M libdtrace/udp.d
ib/libdtrace/io.d
ib/libdtrace/ip.d
ib/libdtrace/nfs.d
ib/libdtrace/nfssrv.d
ib/libdtrace/psinfo.d
ib/libdtrace/regs_x86.d
ib/libdtrace/sched.d
ib/libdtrace/siftr.d
ib/libdtrace/tcp.d
ib/libdtrace/udp.d
1ce9c620ee9f61a1157fba7e3cbaf3eca1709fb0 02-Aug-2015 markj <markj@FreeBSD.org> Add a src.conf option to build and install the DTrace test suite.

Reviewed by: gnn, ngie
Differential Revision: https://reviews.freebsd.org/D3195
sr.sbin/dtrace/Makefile
a9f0d5f01d89f026285de77118562f5aeded6efe 02-Aug-2015 markj <markj@FreeBSD.org> Don't hardcode the module or function component of lockstat probes.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_owner.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.mutex_type_adaptive.d
0de52e9e95c185a617fba3793d130a6494cbe270 02-Aug-2015 markj <markj@FreeBSD.org> - Remove hardcoded paths for the perl executable.
- Rather than assuming that a process is listening on 127.0.0.1:22, use
nc(1) to find an available port and bind to it for the duration of the
test.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh
f6c32e46b93593ff9509668b49f306bc23267a40 02-Aug-2015 markj <markj@FreeBSD.org> Perform bounds checking when constructing a format string.

This was detected by the FORTIFY_SOURCE build.

PR: 201657
Reported by: pfg
MFC after: 2 weeks
ontrib/opensolaris/lib/libdtrace/common/dt_printf.c
ce02aeb9eb7500fe5e8bd40540b6ad3d5875fb2d 30-Jul-2015 gjb <gjb@FreeBSD.org> Fix a rendering issue in the zfs(8) manual.

MFC after: 3 days
Sponsored by: The FreeBSD Foundation
ontrib/opensolaris/cmd/zfs/zfs.8
2092d6ebaa81c46605e634d0491d84b53757d44f 19-Jul-2015 markj <markj@FreeBSD.org> Consistently use a reader/writer flag for lockstat probes in rwlock(9) and
sx(9), rather than using the probe function name to determine whether a
given lock is a read lock or a write lock. Update lockstat(1) accordingly.
ontrib/opensolaris/cmd/lockstat/lockstat.c
3f0ef50892e3092893c7c05c5a22d9f1f3646a86 09-Jul-2015 oshogbo <oshogbo@FreeBSD.org> Rename zfs nvpair files to not colidate with our nvlist.

PR: 201356
Approved by: pjd (mentor)
ib/libnvpair/Makefile
70d4d5a42d9036c0ff34c844811fa1aab3ab394c 01-Jul-2015 br <br@FreeBSD.org> First cut of DTrace for AArch64.

Reviewed by: andrew, emaste
Sponsored by: ARM Limited
Differential Revision: https://reviews.freebsd.org/D2738
ontrib/opensolaris/lib/libdtrace/aarch64/dt_isadep.c
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
ib/Makefile
ib/libdtrace/Makefile
sr.sbin/Makefile
594e07bd1b11504215f7e800f4aad9672c6a14a2 15-Jun-2015 bapt <bapt@FreeBSD.org> Revert r284417 it is not necessary anymore
ib/Makefile.inc
9fb85ece8b4762e6e233907d48c333aba4b450b7 15-Jun-2015 bapt <bapt@FreeBSD.org> Enforce overwritting SHLIBDIR

Since METAMODE has been added, sys.mk loads bsd.mkopt.mk which ends load loading
bsd.own.mk which then defines SHLIBDIR before all the Makefile.inc everywhere.

This makes /lib being populated again.

Reported by: many
ib/Makefile.inc
2a3ec90af9d2a29ddfcfb0f66265da87045c2530 15-Jun-2015 bapt <bapt@FreeBSD.org> Fix circular dependency between libzfs and libzfs_core

libzfs_core is the wrapper around kernel ioctls, the ioctl compat code belongs
to it
ib/libzfs/Makefile
ib/libzfs_core/Makefile
008d7c831feeec7a3430b92f009e28762c6740f1 13-Jun-2015 sjg <sjg@FreeBSD.org> Add META_MODE support.

Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision: D2796
Reviewed by: brooks imp
34e109f495a7f36f028f98d9b09f1e5d533f73aa 12-Jun-2015 avg <avg@FreeBSD.org> zfs clone should not mount the clone if canmount == noauto

Creation of a new filesystem does not imply an intent to mount it.

Since canmount property is not inherited and its default value is 'on',
the only scenario where this matters is zfs clone -o canmount=noauto.
zfs create -o canmount=noauto already does not mount the new filesystem.

Also see:
https://www.illumos.org/issues/5984
https://reviews.csiden.org/r/228/
https://github.com/FransUrbo/zfs/commit/dd0e0e69f5b1c83bf2895ac00a0b83af77473175
https://github.com/zfsonlinux/zfs/issues/2241

Reviewed by: mahrens
MFC after: 8 days
Sponsored by: ClusterHQ
ontrib/opensolaris/cmd/zfs/zfs_main.c
18e52c031c82b935c288884be293bee93d904d34 12-Jun-2015 avg <avg@FreeBSD.org> MFV r284042: 1778 Assertion failed: rn->rn_nozpool == B_FALSE, file
../common/libzfs_import.c, line 1077, function zpool_open_func

illumos/illumos-gate@bd0f709169e67f4bd34526e186a7c34f595f0d9b

Author: Andrew Stormont <andyjstormont@gmail.com>
MFC after: 13 days
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
35511df052b09442147a99d1e2005819713cbd80 12-Jun-2015 avg <avg@FreeBSD.org> MFV r284030: 5818 zfs {ref}compressratio is incorrect with 4k sector size

illumos/illumos-gate@81cd5c555f505484180a62ca5a2fbb00d70c57d6

Author: Matthew Ahrens <mahrens@delphix.com>
MFC after: 17 days
ontrib/opensolaris/cmd/ztest/ztest.c
2d008d4579eea1dabbd9175371c3b0c3d9437bf8 12-Jun-2015 avg <avg@FreeBSD.org> several lockstat improvements

0. For spin events report time spent spinning, not a loop count.
While loop count is much easier and cheaper to obtain it is hard
to reason about the reported numbers, espcially for adaptive locks
where both spinning and sleeping can happen.
So, it's better to compare apples and apples.

1. Teach lockstat about FreeBSD rw locks.
This is done in part by changing the corresponding probes
and in part by changing what probes lockstat should expect.

2. Teach lockstat that rw locks are adaptive and can spin on FreeBSD.

3. Report lock acquisition events for successful rw try-lock operations.

4. Teach lockstat about FreeBSD sx locks.
Reporting of events for those locks completely mirrors
rw locks.

5. Report spin and block events before acquisition event.
This is behavior documented for the upstream, so it makes sense to stick
to it. Note that because of FreeBSD adaptive lock implementations
both the spin and block events may be reported for the same acquisition
while the upstream reports only one of them.

Differential Revision: https://reviews.freebsd.org/D2727
Reviewed by: markj
MFC after: 17 days
Relnotes: yes
Sponsored by: ClusterHQ
ontrib/opensolaris/cmd/lockstat/lockstat.c
aca9f1ba413a746d1c8e90770525abb3eb1ded64 12-Jun-2015 araujo <araujo@FreeBSD.org> At revision r247852 accidentally was removed from print the variable obj.
While here, declare some global variables as static to silence clang
warnings.

Differential Revision: D2722
Reviewed by: delphij, mahrens
ontrib/opensolaris/cmd/zdb/zdb.c
75a137820de70f75cd932fd2fa365fabaf06fa90 08-Jun-2015 sjg <sjg@FreeBSD.org> dirdeps.mk now sets DEP_RELDIR
ib/drti/Makefile.depend
ib/libavl/Makefile.depend
ib/libctf/Makefile.depend
ib/libdtrace/Makefile.depend
ib/libnvpair/Makefile.depend
ib/libumem/Makefile.depend
ib/libuutil/Makefile.depend
ib/libzfs/Makefile.depend
ib/libzfs_core/Makefile.depend
ib/libzpool/Makefile.depend
bin/zfs/Makefile.depend
bin/zpool/Makefile.depend
sr.bin/sgsmsg/Makefile.depend
sr.bin/zinject/Makefile.depend
sr.bin/zstreamdump/Makefile.depend
sr.bin/ztest/Makefile.depend
sr.sbin/lockstat/Makefile.depend
sr.sbin/zdb/Makefile.depend
sr.sbin/zhack/Makefile.depend
07f201748f5d0ecfda7b6ede2f3812cb700ba119 06-Jun-2015 markj <markj@FreeBSD.org> libdtrace: allow D libraries to declare dependencies on kernel modules

The "depends_on module" pragma can be used to declare a dependency on a
DTrace module, which for kernel probes corresponds to a KLD. Such
dependencies cannot be checked if the KLD is compiled into the kernel.
Therefore, allow a module dependency to be satisfied if either a kernel
module or a KLD with the specified name is loaded.

Differential Revision: https://reviews.freebsd.org/D2653
Reviewed by: gnn, rpaulo
Reported by: gnn
ontrib/opensolaris/lib/libdtrace/common/dt_impl.h
ontrib/opensolaris/lib/libdtrace/common/dt_module.c
ontrib/opensolaris/lib/libdtrace/common/dt_module.h
ontrib/opensolaris/lib/libdtrace/common/dt_open.c
ontrib/opensolaris/lib/libdtrace/common/dt_pragma.c
65145fa4c81da358fcbc3b650156dab705dfa34e 27-May-2015 sjg <sjg@FreeBSD.org> Merge sync of head
e9847d6bea19fb31f56d250fb0f8959f03459bf4 25-May-2015 markj <markj@FreeBSD.org> lockstat(1): document the -V option.

MFC after: 3 days
ontrib/opensolaris/cmd/lockstat/lockstat.1
ontrib/opensolaris/cmd/lockstat/lockstat.c
d5c96ed93aa553693a1dc80cda91e6e46edd16e5 21-May-2015 imp <imp@FreeBSD.org> Remove stray DEBUG_FLAGS=-g that's been here since the initial import.
sr.bin/ctfconvert/Makefile
28898440e40dd61ba7f3200142cebc53c1aedc03 20-May-2015 ngie <ngie@FreeBSD.org> Build cddl/{sbin,usr.bin,usr.sbin} in parallel as all of the applications are
freestanding (they require libraries build via make libraries in buildworld)

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
bin/Makefile
sr.bin/Makefile
sr.sbin/Makefile
d78c75e1ea74ea43e2fdef97d71fd707ba91cebd 20-May-2015 ngie <ngie@FreeBSD.org> Add dependencies for libzfs_core and libzpool I missed on my first pass on this
Makefile

MFC with: r283144
Sponsored by: EMC / Isilon Storage Division
ib/Makefile
28e44d51caaffd1bfd2bddcf7d473cda44a73b63 20-May-2015 ngie <ngie@FreeBSD.org> Articulate dependencies for cddl/lib/libdtrace and cddl/lib/libzfs

Parallelize the build in this subdirectory

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
ib/Makefile
d849ef7ae24fa094c4ad011bb897e113d9afead9 19-May-2015 bapt <bapt@FreeBSD.org> Reduce overlinking.
Because of libdtrace there is still a bit a overlinking but nothing we can deal
with easily
sr.sbin/lockstat/Makefile
sr.sbin/plockstat/Makefile
fbae1f6006a27b6df3261e113d519de35d3799c6 19-May-2015 bapt <bapt@FreeBSD.org> Correctly link libdtrace and convert to LIBADD
Make dtrace only link to libdtrace
ib/libdtrace/Makefile
sr.sbin/dtrace/Makefile
2a0393c623c9d4de373b8142f9a6d5bb79e88395 19-May-2015 bapt <bapt@FreeBSD.org> Convert to LIBADD
sr.bin/ctfconvert/Makefile
5cd95f71af2b0f4bcebb1c04765c096b9e2a3d89 19-May-2015 bapt <bapt@FreeBSD.org> Convert to LIBADD
Remove dependency on pthread, it is not needed
sr.bin/ctfdump/Makefile
7037e8b85171408e098019c3a089cb502691a3a5 17-May-2015 markj <markj@FreeBSD.org> Fix a typo that snuck in with r283024, and remove the EXFAIL annotation from
a test which now passes as a result of that change.
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
sr.sbin/dtrace/tests/tools/exclude.sh
78dbee31006a8fcbf453c24a21d6bb767e0ac43c 17-May-2015 markj <markj@FreeBSD.org> Respect the libdir option when linking drti.o, rather than hardcoding the
default path of /usr/lib(32)/dtrace.

MFC after: 3 weeks
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
ontrib/opensolaris/lib/libdtrace/common/dt_open.c
452e5a702dd4171ee2527f9a52025bdc5cf32420 17-May-2015 markj <markj@FreeBSD.org> Actually remove siftr-related definitions from tcp.d, missed in r283026.
ib/libdtrace/tcp.d
6f890aafe242f160566ad636eadc434e03a50dd8 17-May-2015 markj <markj@FreeBSD.org> Move siftr-related definitions out of tcp.d and into a separate library
which declares a dependency on siftr(4). This is necessitated by a
reference to struct pkt_node, which is defined in siftr(4): otherwise,
dtrace(1) will return an error during startup if siftr.ko is not loaded.
ib/libdtrace/Makefile
ib/libdtrace/siftr.d
6274bab2e009cf82e38699b4aab88a79104cc438 17-May-2015 markj <markj@FreeBSD.org> As dtrace(1) processes D libraries under /usr/lib/dtrace, the compiler may
return an error if one of the depends_on directives in a library is not
satisfied. In this case, libdtrace is supposed to ignore the library and
carry on. However, the remainder of the library may still be buffered by
the lexer, causing libdtrace to erroneously continue processing it on the
next call to yyparse(). Fix this by explicitly flushing the input buffer
each time the compiler state is reset.

MFC after: 3 weeks
ontrib/opensolaris/lib/libdtrace/common/dt_lex.l
48547f12feb5b334a883310e8b56fc045ce292d8 17-May-2015 markj <markj@FreeBSD.org> When in lazyload mode, write the DOF to a temporary file and rename it
rather than writing directly to the output file.

CID: 1147172
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
2c4686751c3442d00e8ca8a4684be7de7901df5a 10-May-2015 markj <markj@FreeBSD.org> ctf_add_type(): when looking up an integer or floating point type in the
list of pending dynamic type definitions, a match on the type name is not
sufficient - we need to compare the type encodings as well. For example,
bitfields have their own distinct type definitions which share the name of
the underlying integer type, and these types aren't generally
interchangeable.

This bug was causing the following libdtrace error when attempting to trace
the th_flags member of a struct tcphdr:
cg: bad field: off 104 type <32877> bits 539620016

Reported by: rwatson
MFC after: 3 weeks
ontrib/opensolaris/common/ctf/ctf_create.c
08d35a248bb3857de924963d71455ad36e3b3664 29-Apr-2015 gnn <gnn@FreeBSD.org> Brief demo script showing the various values that can be read via
the new SIFTR statically defined tracepoint (SDT).

Differential Revision: https://reviews.freebsd.org/D2387
Reviewed by: bz, markj
ib/libdtrace/tcp.d
311ef80759132743196421b9bb761e62a64db477 28-Apr-2015 avg <avg@FreeBSD.org> dump_nvlist: handle DATA_TYPE_BOOLEAN_ARRAY

To do: upstream (https://www.illumos.org/issues/5752)
MFC after: 10 days
ontrib/opensolaris/lib/libnvpair/libnvpair.c
78b4348c8c1f68bc9c8d31daa4502f77e44352cd 18-Apr-2015 markj <markj@FreeBSD.org> Add manual pages for the io, ip, proc, sched, tcp and udp DTrace providers.
The format of these pages is somewhat experimental, so they may be subject
to further tweaking.

Differential Revision: https://reviews.freebsd.org/D2170
Reviewed by: bcr, rpaulo
MFC after: 2 weeks
ontrib/opensolaris/cmd/dtrace/dtrace.1
c4727a3cf02a088e568a573f65803d491b6aba54 09-Apr-2015 bapt <bapt@FreeBSD.org> Convert cftmerge to LIBADD and remove link on libdwarf which is not needed
sr.bin/ctfmerge/Makefile
1d6ffde4f49799c1d95f31875779237c214fc09c 08-Apr-2015 markj <markj@FreeBSD.org> libdtrace: add support for lazyload mode.

Passing "-x lazyload" to dtrace -G during compilation causes dtrace(1) to
not link drti.o into the output object file, so the USDT probes are not created
during process startup. Instead, dtrace(1) will automatically discover and
create probes on the process' behalf when attaching.

Differential Revision: https://reviews.freebsd.org/D2203
Reviewed by: rpaulo
MFC after: 1 month
ontrib/opensolaris/lib/libdtrace/common/drti.c
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
ontrib/opensolaris/lib/libdtrace/common/dt_pid.c
ib/libdtrace/libproc_compat.h
b940cb0c6bc38dd3f7a0bdeb7ca92810beaa2c71 31-Mar-2015 markj <markj@FreeBSD.org> Fix a misparenthesization that could cause a crash if TERM is not set.

Reported by: Coverity (internal)
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
ontrib/opensolaris/lib/libdtrace/common/dt_consume.c
6968ab0ddeace19efdb6dffa70ec949f20770800 30-Mar-2015 markj <markj@FreeBSD.org> Fix ping(8) and ping6(8) usage in a couple of ip provider tests, and
update expected test output to reflect differences in default TTL and
payload length.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh.out
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh.out
2be5269c4846b299fe0de542671741c423b78ecd 30-Mar-2015 markj <markj@FreeBSD.org> Fix ping(8) usage in funcs/tst.system.d so that the test actually completes.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.system.d.out
ad238d9633d2837a8be70a0e4803808f5f6aa565 30-Mar-2015 markj <markj@FreeBSD.org> Replace dtest.pl, the upstream DTrace test suite harness, with a shell
script. This reimplementation is much simpler than dtest.pl and is more
amenable to being run under Kyua - dtest.pl writes error output to a
temporary directory that is deleted when the run finishes, making it hard
to debug test failures. This change also removes the test suite's dependency
on perl.
sr.sbin/dtrace/tests/Makefile
sr.sbin/dtrace/tests/Makefile.inc1
sr.sbin/dtrace/tests/tools/dtest.sh
sr.sbin/dtrace/tests/tools/gentest.sh
09331b0ed03c8f83c47514a8679758764ecdc970 28-Mar-2015 markj <markj@FreeBSD.org> tcp provider tests: sleep for a bit after closing the socket so that
libdtrace has a chance to capture the traced data.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh
bfd93bcccaf74ce509f194d86074954a405cf646 15-Mar-2015 markj <markj@FreeBSD.org> Add a missing format string argument.

PR: 197391
MFC after: 3 days
ontrib/opensolaris/tools/ctf/cvt/ctf.c
1c0a61aa611e9785df22a94fbea4a52ba293d962 11-Mar-2015 markj <markj@FreeBSD.org> When copying a type from a source CTF container to a destination container,
ctf_add_type() first performs a by-name lookup of the type in the
destination container. If this lookup returns a forward declaration for an
enum, struct, or union, reset dst_type back to CTF_ERR, indicating that the
source type is not in fact present in the destination container. This
ensures that ctf_add_type() will also search the destination container's
dynamic type list for the source type.

Without this change, a pair of mutually recursive struct definitions could
cause infinite recursion in ctf_add_type() if the destination container
only contained forward declarations for the struct types: ctf_add_type()
recursively calls itself on each struct member's type, and the forward
declarations meant that the dynamic type list search would be skipped.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
ontrib/opensolaris/common/ctf/ctf_create.c
564efa5c094daac4e86d36af51649ae394beb6af 10-Mar-2015 markj <markj@FreeBSD.org> CTF containers use the ctf_dtoldid field as a threshold type index which
indicates the range of type indices which have been committed to the
container by ctf_update(). However, the top bit of the dtd_type field is
not part of the type index; rather, it is a flag used to indicate that the
corresponding CTF container is a parent. This is why the maximum CTF type
index is 2^15 - 1 rather than 2^16 - 1. Therefore, this flag must be masked
off (using the CTF_TYPE_TO_INDEX macro) when comparing a type index with the
ctf_dtoldid field of a container.

This bug was causing libctf to erroneously free committed type definitions
in ctf_discard(). libdtrace holds some references to such types, resulting
in a use-after-free.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
ontrib/opensolaris/common/ctf/ctf_create.c
c50bfa1dd2c305908186e05a497f62bd792134b6 10-Mar-2015 markj <markj@FreeBSD.org> ctf_discard(): fetch the next list element before restarting the loop. If
we end up skipping a dynamic type because it has already been committed to
the container, we would previously either set the loop variable to an
uninitialized local variable, or set it to itself, resulting in an infinite
loop.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
ontrib/opensolaris/common/ctf/ctf_create.c
6bcf6bdf568e7a255feccc4a4036b1c00d0f8ae8 10-Mar-2015 markj <markj@FreeBSD.org> MFV r279822:

This merge is effectively a no-op since parts of it are already present
in FreeBSD, and the rest is incorrect since gelf_newehdr(3) and
gelf_newphdr(3) return pointers on FreeBSD rather than integers.

Illumos issue:
5589 improper use of NULL in tools/ctf

MFC after: 3 days
ontrib/opensolaris/tools/ctf/cvt/output.c
73a716f42de3e217d697b2e8299dcfb61be4cdbb 08-Mar-2015 gnn <gnn@FreeBSD.org> Summary: Remove the need for `mpid which is Illumos/Solaris specific.
ontrib/dtracetoolkit/Proc/pidpersec.d
b4b4fa2d5bc2bfc70b160610300333a32802d519 28-Feb-2015 markj <markj@FreeBSD.org> Add infrastructure to integrate the DTrace test suite with Kyua.

For each test category, we generate a script containing ATF test cases for
the tests under that category. Each test case simply runs dtest.pl (the
upstream test harness) with the corresponding test files. The exclude.sh
script is used to record info about tests which should be skipped or are
expected to fail; it is used to generate atf_skip and atf_expect_fail calls.
The genmakefiles.sh script can be used to regenerate the test makefiles when
new tests are brought it from upstream.

The test suite is currently not connected to the build as there is a small
number of lingering test issues which still need to be worked out. In the
meantime however, the test suite can be easily built and installed
manually from cddl/usr.sbin/dtrace/tests.

Reviewed by: ngie
Sponsored by: EMC / Isilon Storage Division
sr.sbin/dtrace/tests/Makefile
sr.sbin/dtrace/tests/Makefile.inc1
sr.sbin/dtrace/tests/common/Makefile
sr.sbin/dtrace/tests/common/aggs/Makefile
sr.sbin/dtrace/tests/common/arithmetic/Makefile
sr.sbin/dtrace/tests/common/arrays/Makefile
sr.sbin/dtrace/tests/common/assocs/Makefile
sr.sbin/dtrace/tests/common/begin/Makefile
sr.sbin/dtrace/tests/common/bitfields/Makefile
sr.sbin/dtrace/tests/common/buffering/Makefile
sr.sbin/dtrace/tests/common/builtinvar/Makefile
sr.sbin/dtrace/tests/common/cg/Makefile
sr.sbin/dtrace/tests/common/clauses/Makefile
sr.sbin/dtrace/tests/common/cpc/Makefile
sr.sbin/dtrace/tests/common/decls/Makefile
sr.sbin/dtrace/tests/common/docsExamples/Makefile
sr.sbin/dtrace/tests/common/drops/Makefile
sr.sbin/dtrace/tests/common/dtraceUtil/Makefile
sr.sbin/dtrace/tests/common/end/Makefile
sr.sbin/dtrace/tests/common/enum/Makefile
sr.sbin/dtrace/tests/common/error/Makefile
sr.sbin/dtrace/tests/common/exit/Makefile
sr.sbin/dtrace/tests/common/fbtprovider/Makefile
sr.sbin/dtrace/tests/common/funcs/Makefile
sr.sbin/dtrace/tests/common/grammar/Makefile
sr.sbin/dtrace/tests/common/include/Makefile
sr.sbin/dtrace/tests/common/inline/Makefile
sr.sbin/dtrace/tests/common/io/Makefile
sr.sbin/dtrace/tests/common/ip/Makefile
sr.sbin/dtrace/tests/common/java_api/Makefile
sr.sbin/dtrace/tests/common/json/Makefile
sr.sbin/dtrace/tests/common/lexer/Makefile
sr.sbin/dtrace/tests/common/llquantize/Makefile
sr.sbin/dtrace/tests/common/mdb/Makefile
sr.sbin/dtrace/tests/common/mib/Makefile
sr.sbin/dtrace/tests/common/misc/Makefile
sr.sbin/dtrace/tests/common/multiaggs/Makefile
sr.sbin/dtrace/tests/common/nfs/Makefile
sr.sbin/dtrace/tests/common/offsetof/Makefile
sr.sbin/dtrace/tests/common/operators/Makefile
sr.sbin/dtrace/tests/common/pid/Makefile
sr.sbin/dtrace/tests/common/plockstat/Makefile
sr.sbin/dtrace/tests/common/pointers/Makefile
sr.sbin/dtrace/tests/common/pragma/Makefile
sr.sbin/dtrace/tests/common/predicates/Makefile
sr.sbin/dtrace/tests/common/preprocessor/Makefile
sr.sbin/dtrace/tests/common/print/Makefile
sr.sbin/dtrace/tests/common/printa/Makefile
sr.sbin/dtrace/tests/common/printf/Makefile
sr.sbin/dtrace/tests/common/privs/Makefile
sr.sbin/dtrace/tests/common/probes/Makefile
sr.sbin/dtrace/tests/common/proc/Makefile
sr.sbin/dtrace/tests/common/profile-n/Makefile
sr.sbin/dtrace/tests/common/providers/Makefile
sr.sbin/dtrace/tests/common/raise/Makefile
sr.sbin/dtrace/tests/common/rates/Makefile
sr.sbin/dtrace/tests/common/safety/Makefile
sr.sbin/dtrace/tests/common/scalars/Makefile
sr.sbin/dtrace/tests/common/sched/Makefile
sr.sbin/dtrace/tests/common/scripting/Makefile
sr.sbin/dtrace/tests/common/sdt/Makefile
sr.sbin/dtrace/tests/common/sizeof/Makefile
sr.sbin/dtrace/tests/common/speculation/Makefile
sr.sbin/dtrace/tests/common/stability/Makefile
sr.sbin/dtrace/tests/common/stack/Makefile
sr.sbin/dtrace/tests/common/stackdepth/Makefile
sr.sbin/dtrace/tests/common/stop/Makefile
sr.sbin/dtrace/tests/common/strlen/Makefile
sr.sbin/dtrace/tests/common/strtoll/Makefile
sr.sbin/dtrace/tests/common/struct/Makefile
sr.sbin/dtrace/tests/common/syscall/Makefile
sr.sbin/dtrace/tests/common/sysevent/Makefile
sr.sbin/dtrace/tests/common/tick-n/Makefile
sr.sbin/dtrace/tests/common/trace/Makefile
sr.sbin/dtrace/tests/common/tracemem/Makefile
sr.sbin/dtrace/tests/common/translators/Makefile
sr.sbin/dtrace/tests/common/typedef/Makefile
sr.sbin/dtrace/tests/common/types/Makefile
sr.sbin/dtrace/tests/common/uctf/Makefile
sr.sbin/dtrace/tests/common/union/Makefile
sr.sbin/dtrace/tests/common/usdt/Makefile
sr.sbin/dtrace/tests/common/ustack/Makefile
sr.sbin/dtrace/tests/common/vars/Makefile
sr.sbin/dtrace/tests/common/version/Makefile
sr.sbin/dtrace/tests/tools/exclude.sh
sr.sbin/dtrace/tests/tools/genmakefiles.sh
sr.sbin/dtrace/tests/tools/gentest.sh
515a3333a1327afb6e18d482f7fccb50b423e44c 28-Feb-2015 markj <markj@FreeBSD.org> Use the -shared option to create a shared library.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh
7a6db9bb6f2dabfef422129b924f89be0313d2fc 28-Feb-2015 markj <markj@FreeBSD.org> Remove a leading tab that causes a make(1) error when running the test.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh
eed96d83d486fe894aed0f2da6dd6f2808ff51be 28-Feb-2015 markj <markj@FreeBSD.org> Only kill sleep processes that were forked from the test script.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.manypids.ksh
7907d899e1f7e840affaf4a9779f55562448bd62 28-Feb-2015 markj <markj@FreeBSD.org> Stop hard-coding an incorrect path to rm(1).

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiprov.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noprobes.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh
f0117ab7cca9216466d743da3f0b9bfc1eb4fe88 27-Feb-2015 obrien <obrien@FreeBSD.org> These CTF tools do not use anything from libctf, so no need to link with it.
sr.bin/ctfconvert/Makefile
sr.bin/ctfmerge/Makefile
139773cf3f485552bcba63fc9e3ae72820744c1e 27-Feb-2015 delphij <delphij@FreeBSD.org> Set altroot if the user have specified it via -o altroot.

MFC after: 2 weeks
ontrib/opensolaris/cmd/zpool/zpool_main.c
766a186dd8a6ed0ec8d2ba9f2ac7e4f7d8b7e85c 18-Feb-2015 markj <markj@FreeBSD.org> Remove drti.o's dependency on libelf. This makes it possible to add DTrace
probes to userland programs and libraries without also needing to link
libelf.

dtrace -G places the __SUNW_dof symbol at the beginning of the DOF (DTrace
probe and provider metdata) section in the generated object file; drti.o
now just uses this symbol to locate the section. A complication occurs
when multiple dtrace-generated object files are linked together, since the
__SUNW_dof symbol defined in each file is global. This is handled by
using objcopy(1) to convert __SUNW_dof to a local symbol once drti.o has
been linked with the generated object file. Upstream, this is done using a
linker feature not present in GNU ld.

Differential Revision: https://reviews.freebsd.org/D1757
Reviewed by: rpaulo
MFC after: 1 month
Relnotes: yes
ontrib/opensolaris/lib/libdtrace/common/drti.c
ontrib/opensolaris/lib/libdtrace/common/dt_impl.h
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
ontrib/opensolaris/lib/libdtrace/common/dt_open.c
ontrib/opensolaris/lib/libdtrace/common/dt_options.c
81644b962a02b605461dd461fe14cc294d0e3650 14-Feb-2015 markj <markj@FreeBSD.org> Tweak the fds test program so that it actually compiles. Also use 0 instead
of -1 for the bogus ioctl command so that dmesg doesn't get spammed with
sign extension warnings when the test program runs.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/io/tst.fds.d
b9be305241681da7846cc34819d953dd56af8657 10-Feb-2015 gnn <gnn@FreeBSD.org> Initial version of DTrace on ARM32.

Submitted by: Howard Su based on work by Oleksandr Tymoshenko
Reviewed by: ian, andrew, rpaulo, markj
ontrib/opensolaris/lib/libdtrace/arm/dt_isadep.c
ontrib/opensolaris/tools/ctf/cvt/ctf.c
ib/Makefile
ib/libdtrace/Makefile
sr.sbin/Makefile
7a5cf9ac76b62a7057ea962e115bcc8a7823d554 03-Feb-2015 markj <markj@FreeBSD.org> Avoid hard-coding a path to ksh in scripts that are executed directly by
the test harness. This is a problem in many of the *.ksh test scripts as
well, but those scripts are executed using a shell whose path is specified
in dtest.pl, so there's no need to modify them.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe
ontrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.available.exe
ontrib/opensolaris/cmd/dtrace/test/tst/common/plockstat/tst.libmap.exe
8b7f81c74b06dd92865d64bd7f5887738b3d447e 02-Feb-2015 markj <markj@FreeBSD.org> Let the standard deviation of the empty set be 0. This is consistent with
the behaviour for averages, and fixes a crash that can occur when attempting
to print a stddev aggregation containing no elements:

dtrace:::BEGIN { @ = stddev(0); clear(@); printa("%@d", @); }

PR: 197260
MFC after: 2 week
ontrib/opensolaris/lib/libdtrace/common/dt_consume.c
bcc73245049473e101205b6de4927e0dea9b59b8 31-Jan-2015 markj <markj@FreeBSD.org> Fix mktemp(1) usage.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.corruptenv.ksh
fe54896a96868c2c12b42ea7c1dcbfae47afe58c 31-Jan-2015 markj <markj@FreeBSD.org> Use syscall::exit instead of the nonexistent syscall::rexit.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.d
e626c4973b3e1e7a3a70e3500fded50cd241f126 31-Jan-2015 markj <markj@FreeBSD.org> Remove hard-coded invocations of gcc; use cc(1) instead.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.include.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreap.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.noreapring.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reap.ksh
e5ab5f0bc363e9f393327441c5d062c9b567eaf1 31-Jan-2015 markj <markj@FreeBSD.org> Remove a makefile that isn't present upstream.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/Makefile
5fc1c4b8e053f3c5f13943a929163c4f06fd5079 31-Jan-2015 markj <markj@FreeBSD.org> Fix a number of DTrace scripting tests:
* Avoid hard-coding program paths.
* Use -x when searching for oneself in ps(1) output.
* Use the correct keyword (egid instead of pgid) in tst.egid.ksh.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh
a3e668fe3502c48647f5ef166ecc4990e351524e 31-Jan-2015 markj <markj@FreeBSD.org> Fix some proc provider tests:
* Avoid hard-coding program paths, except when it's necessary in order to
override the use of a shell builtin.
* Translate struct proc through psinfo_t so that we can access process
arguments via the pr_psargs field of psinfo_t.
* Replace uses of pstop and prun with kill(1).

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.discard.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exitkilled.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.signal.ksh
b55f1535733c70849d7a3b4eddc4ad91c884db86 30-Jan-2015 markj <markj@FreeBSD.org> pause() isn't a system call on FreeBSD; use sigsuspend(2) instead.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh
eeb4fd93f1c527bc985ce0519d613724b0ce0029 30-Jan-2015 markj <markj@FreeBSD.org> The DTrace harness (dtest.pl) executes DTrace scripts with the -C flag,
which causes dtrace(1) to run the C preprocessor on input scripts before
executing them. Suppress some warnings emitted by the preprocessor which are
confusing the DTrace lexer tests.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NL.char.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_CHR_NULL.char.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/lexer/err.D_STR_NL.string.d
d74b40f343b2c31199de32992eb4d338d7250fda 30-Jan-2015 markj <markj@FreeBSD.org> Include required headers in DTrace test programs.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/json/tst.usdt.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/nfs/tst.call3.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.args1.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret1.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.ret2.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak1.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.weak2.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/syscall/tst.args.c
ontrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.forker.c
43903f9d34f9218291c9d275742247353f86fa19 30-Jan-2015 markj <markj@FreeBSD.org> Replace Solaris identifiers and types with their FreeBSD equivalents.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.baddef1.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/inline/err.D_OP_INCOMPAT.badxlate.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.roch.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/offsetof/err.D_UNKNOWN.badmemb.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/print/err.D_PRINT_VOID.bad.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/print/tst.xlate.d.out
ontrib/opensolaris/cmd/dtrace/test/tst/common/probes/tst.probestar.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.func.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.mod.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/profile-n/tst.sym.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.selfarray2.d
36cca69f6b31a4183273652bf7aac5c79e494302 30-Jan-2015 markj <markj@FreeBSD.org> Use the correct field when reading the PID out of a struct proc.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.vfork.d
ontrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.discard.ksh
ontrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.signal.ksh
849ef66336f73e1a393f3a1c5f434b63207253ce 30-Jan-2015 markj <markj@FreeBSD.org> When searching for an accompanying test program, look in the directory
containing the test script rather than the current directory. This is needed
in order to run the DTrace tests under Kyua.

MFC after: 1 week
ontrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl
62e65f40de0cda6f2f78e3775e559f18ad51ff4e 21-Jan-2015 ngie <ngie@FreeBSD.org> Follow up to r277449 by fixing the remaining NSEC_TO_TICK macro to have the same
named parameters

Reported by: Ben Perrault <ben.perrault@gmail.com>, Willem Jan Withagen <wjw@digiware.nl>
ontrib/opensolaris/lib/libzpool/common/sys/zfs_context.h
d8a01f771b23abe22fe19259e64e6c9cf443d5d3 20-Jan-2015 delphij <delphij@FreeBSD.org> MFV r277432:

Plug various memory leaks in libzfs import implementation.

Illumos issue:
5518 Memory leaks in libzfs import implementation

MFC after: 2 weeks
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
55c26d898b33386bf97f560dfeaf3b2cdc029c31 17-Jan-2015 smh <smh@FreeBSD.org> Mechanically convert cddl sun #ifdef's to illumos

Since the upstream for cddl code is now illumos not sun, mechanically
convert all sun #ifdef's to illumos #ifdef's which have been used in all
newer code for some time.

Also do a manual pass to correct the use if #ifdef comments as per style(9)
as well as few uses of #if defined(__FreeBSD__) vs #ifndef illumos.

MFC after: 1 month
Sponsored by: Multiplay
ontrib/opensolaris/cmd/dtrace/dtrace.c
ontrib/opensolaris/cmd/lockstat/lockstat.c
ontrib/opensolaris/cmd/lockstat/sym.c
ontrib/opensolaris/cmd/mdb/tools/common/die.c
ontrib/opensolaris/cmd/mdb/tools/common/util.h
ontrib/opensolaris/cmd/plockstat/plockstat.c
ontrib/opensolaris/cmd/sgs/include/alist.h
ontrib/opensolaris/cmd/sgs/include/sgs.h
ontrib/opensolaris/cmd/zfs/zfs_main.c
ontrib/opensolaris/cmd/zpool/zpool_vdev.c
ontrib/opensolaris/common/util/strtolctype.h
ontrib/opensolaris/lib/libctf/common/ctf_lib.c
ontrib/opensolaris/lib/libdtrace/common/drti.c
ontrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
ontrib/opensolaris/lib/libdtrace/common/dt_cc.c
ontrib/opensolaris/lib/libdtrace/common/dt_consume.c
ontrib/opensolaris/lib/libdtrace/common/dt_dof.c
ontrib/opensolaris/lib/libdtrace/common/dt_error.c
ontrib/opensolaris/lib/libdtrace/common/dt_handle.c
ontrib/opensolaris/lib/libdtrace/common/dt_ident.c
ontrib/opensolaris/lib/libdtrace/common/dt_impl.h
ontrib/opensolaris/lib/libdtrace/common/dt_lex.l
ontrib/opensolaris/lib/libdtrace/common/dt_link.c
ontrib/opensolaris/lib/libdtrace/common/dt_map.c
ontrib/opensolaris/lib/libdtrace/common/dt_module.c
ontrib/opensolaris/lib/libdtrace/common/dt_open.c
ontrib/opensolaris/lib/libdtrace/common/dt_options.c
ontrib/opensolaris/lib/libdtrace/common/dt_parser.c
ontrib/opensolaris/lib/libdtrace/common/dt_pid.c
ontrib/opensolaris/lib/libdtrace/common/dt_pragma.c
ontrib/opensolaris/lib/libdtrace/common/dt_printf.c
ontrib/opensolaris/lib/libdtrace/common/dt_proc.c
ontrib/opensolaris/lib/libdtrace/common/dt_program.c
ontrib/opensolaris/lib/libdtrace/common/dt_provider.c
ontrib/opensolaris/lib/libdtrace/common/dt_subr.c
ontrib/opensolaris/lib/libdtrace/common/dt_work.c
ontrib/opensolaris/lib/libdtrace/common/dtrace.h
ontrib/opensolaris/lib/libdtrace/i386/dt_isadep.c
ontrib/opensolaris/lib/libgen/common/gmatch.c
ontrib/opensolaris/lib/libzfs/common/libzfs.h
ontrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
ontrib/opensolaris/lib/libzfs/common/libzfs_diff.c
ontrib/opensolaris/lib/libzfs/common/libzfs_import.c
ontrib/opensolaris/lib/libzfs/common/libzfs_mount.c
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
ontrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
ontrib/opensolaris/lib/libzfs/common/libzfs_util.c
ontrib/opensolaris/tools/ctf/cvt/barrier.c
ontrib/opensolaris/tools/ctf/cvt/barrier.h
ontrib/opensolaris/tools/ctf/cvt/ctfconvert.c
ontrib/opensolaris/tools/ctf/cvt/ctfmerge.c
ontrib/opensolaris/tools/ctf/cvt/dwarf.c
ontrib/opensolaris/tools/ctf/cvt/output.c
ontrib/opensolaris/tools/ctf/cvt/tdata.c
ontrib/opensolaris/tools/ctf/cvt/util.c
1a0bd2e577afc4194acb8b070ec864dc313ca367 16-Jan-2015 smh <smh@FreeBSD.org> Eliminate illumos whole disk special case when searching for a ZFS vdev

This special case prevented locating vdevs which start with c[0-9] e.g.
gptid/c6cde092-504b-11e4-ba52-c45444453598 hence it was impossible to
online a vdev via its path.

Submitted by: Peter Xu <xzpeter@gmail.com>
MFC after: 2 weeks
Sponsored by: Multiplay
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
b4e2db0e20bb2de699a7d5a3411d1d8380fc35ea 08-Jan-2015 markj <markj@FreeBSD.org> Revert r274569. It seems to be causing a crash when merging CTF data for
recent i386 GENERIC kernels.

Reported by: David Wolfskill
ontrib/opensolaris/tools/ctf/cvt/merge.c
128806a8151aa98ab5b9bc844a469b33bbf5aa23 31-Dec-2014 smh <smh@FreeBSD.org> Use the correct state name for unavailable pools in zpool list

This corrects inconsitencies between zpool list and zpool status which are
both described as displaying the pool <state> however zpool list would use
this hardcoded FAULTED instead of the correct UNAVAIL.

MFC after: 1 month
ontrib/opensolaris/lib/libzfs/common/libzfs_pool.c
fb7abcd8fc250b5957bbe2b4e8a001ff4096a7c6 29-Dec-2014 joel <joel@FreeBSD.org> mdoc: remove EOL whitespace.
ontrib/opensolaris/cmd/zpool/zpool-features.7
7f4508f63265e7edce9cbc78bebfcb2765856ea2 28-Dec-2014 jhibbits <jhibbits@FreeBSD.org> Add PowerPC64 function descriptor support for dt_link.c

Summary:
PowerPC64 uses function descriptors in a s