Permalink
Browse files

merge a new version of the CDDL dtrace and ZFS code.

this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
 - dtrace FBT probes can now be placed in kernel modules.
 - ZFS now supports mmap().
  • Loading branch information...
chs chs
chs authored and chs committed May 28, 2018
1 parent d517735 commit bae129c5e36fe3b2ded1e036fc2f6f12430f55e0
Showing 404 changed files with 67,660 additions and 49,546 deletions.
@@ -1,4 +1,4 @@
# $NetBSD: shl.mi,v 1.838 2018/05/03 22:51:17 sevan Exp $
# $NetBSD: shl.mi,v 1.839 2018/05/28 21:04:59 chs Exp $
#
# Note: Don't delete entries from here - mark them as "obsolete" instead,
# unless otherwise stated below.
@@ -871,6 +871,9 @@
./usr/lib/libzfs.so base-zfs-shlib compatfile,zfs
./usr/lib/libzfs.so.0 base-zfs-shlib compatfile,zfs
./usr/lib/libzfs.so.0.0 base-zfs-shlib compatfile,zfs
./usr/lib/libzfs_core.so base-zfs-shlib compatfile,zfs
./usr/lib/libzfs_core.so.0 base-zfs-shlib compatfile,zfs
./usr/lib/libzfs_core.so.0.0 base-zfs-shlib compatfile,zfs
./usr/lib/libzpool.so base-zfs-shlib compatfile,zfs
./usr/lib/libzpool.so.0 base-zfs-shlib compatfile,zfs
./usr/lib/libzpool.so.0.0 base-zfs-shlib compatfile,zfs
@@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.2198 2018/05/28 00:18:05 nat Exp $
# $NetBSD: mi,v 1.2199 2018/05/28 21:04:59 chs Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
./etc/mtree/set.comp comp-sys-root
@@ -3772,6 +3772,8 @@
./usr/lib/libz_p.a comp-c-proflib compatfile,profile
./usr/lib/libzfs.a comp-zfs-lib compatfile,zfs
./usr/lib/libzfs_p.a comp-zfs-proflib compatfile,zfs,profile
./usr/lib/libzfs_core.a comp-zfs-lib compatfile,zfs
./usr/lib/libzfs_core_p.a comp-zfs-proflib compatfile,zfs,profile
./usr/lib/libzpool.a comp-zfs-lib compatfile,zfs
./usr/lib/libzpool_p.a comp-zfs-proflib compatfile,zfs,profile
./usr/lib/pkgconfig comp-c-lib
@@ -1,4 +1,4 @@
# $NetBSD: shl.mi,v 1.315 2018/05/05 01:09:08 sevan Exp $
# $NetBSD: shl.mi,v 1.316 2018/05/28 21:04:59 chs Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -277,7 +277,8 @@
./usr/lib/libwrap_pic.a comp-c-piclib compatfile,picinstall
./usr/lib/libz_pic.a comp-c-piclib compatfile,picinstall
./usr/lib/libzfs_pic.a comp-zfs-piclib compatfile,picinstall,zfs
./usr/lib/libzpool_pic.a comp-zfs-piclib compatfile,zfs,picinstall
./usr/lib/libzfs_core_pic.a comp-zfs-piclib compatfile,picinstall,zfs
./usr/lib/libzpool_pic.a comp-zfs-piclib compatfile,picinstall,zfs
./usr/libexec/liblto_plugin.so comp-c-bin gcc
./usr/libexec/liblto_plugin.so.0 comp-c-bin gcc
./usr/libexec/liblto_plugin.so.0.1 comp-c-bin gcc
@@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.249 2018/05/25 15:42:48 martin Exp $
# $NetBSD: mi,v 1.250 2018/05/28 21:05:00 chs Exp $
./etc/mtree/set.debug comp-sys-root
./usr/lib comp-sys-usr compatdir
./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile
@@ -265,6 +265,7 @@
./usr/lib/liby_g.a comp-c-debuglib debuglib,compatfile
./usr/lib/libz_g.a comp-c-debuglib debuglib,compatfile
./usr/lib/libzfs_g.a comp-c-debuglib debuglib,compatfile,zfs
./usr/lib/libzfs_core_g.a comp-c-debuglib debuglib,compatfile,zfs
./usr/lib/libzpool_g.a comp-c-debuglib debuglib,compatfile,zfs
./usr/libdata/debug/bin/cat.debug comp-util-debug debug
./usr/libdata/debug/bin/chio.debug comp-util-debug debug
@@ -1,4 +1,4 @@
# $NetBSD: shl.mi,v 1.197 2018/05/04 12:44:40 sevan Exp $
# $NetBSD: shl.mi,v 1.198 2018/05/28 21:05:00 chs Exp $
./usr/lib/libbfd_g.a comp-c-debuglib debuglib,compatfile,binutils
./usr/libdata/debug/lib base-sys-usr debug,dynamicroot,compatdir
./usr/libdata/debug/lib/libblacklist.so.0.0.debug comp-sys-debug debug,dynamicroot
@@ -294,6 +294,7 @@
./usr/libdata/debug/usr/lib/libwrap.so.1.0.debug comp-net-debug debug,compatfile
./usr/libdata/debug/usr/lib/libz.so.1.0.debug comp-sys-debug debug,compatfile
./usr/libdata/debug/usr/lib/libzfs.so.0.0.debug comp-zfs-debug debug,compatfile,zfs
./usr/libdata/debug/usr/lib/libzfs_core.so.0.0.debug comp-zfs-debug debug,compatfile,zfs
./usr/libdata/debug/usr/lib/libzpool.so.0.0.debug comp-zfs-debug debug,compatfile,zfs
./usr/libdata/debug/usr/lib/npf/ext_log.so.0.0.debug comp-obsolete debug,compatfile,npf,obsolete
./usr/libdata/debug/usr/lib/npf/ext_normalise.so.0.0.debug comp-obsolete debug,compatfile,npf,obsolete
@@ -1,4 +1,4 @@
# $NetBSD: mi,v 1.1591 2018/05/28 00:18:05 nat Exp $
# $NetBSD: mi,v 1.1592 2018/05/28 21:05:00 chs Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -2317,6 +2317,7 @@
./usr/share/man/cat7/symlink.0 man-reference-catman .cat
./usr/share/man/cat7/sysctl.0 man-reference-catman .cat
./usr/share/man/cat7/tests.0 man-reference-catman .cat
./usr/share/man/cat7/zpool-features.8 man-zfs-catman zfs,.cat
./usr/share/man/cat8/MAKEDEV.0 man-sysutil-catman .cat
./usr/share/man/cat8/MAKEDEV.local.0 man-sysutil-catman .cat
./usr/share/man/cat8/ac.0 man-sysutil-catman .cat
@@ -5358,6 +5359,7 @@
./usr/share/man/html7/symlink.html man-reference-htmlman html
./usr/share/man/html7/sysctl.html man-reference-htmlman html
./usr/share/man/html7/tests.html man-reference-htmlman html
./usr/share/man/html7/zpool-features.html man-zfs-htmlman zfs,html
./usr/share/man/html8/MAKEDEV.html man-sysutil-htmlman html
./usr/share/man/html8/MAKEDEV.local.html man-sysutil-htmlman html
./usr/share/man/html8/ac.html man-sysutil-htmlman html
@@ -8376,6 +8378,7 @@
./usr/share/man/man7/symlink.7 man-reference-man .man
./usr/share/man/man7/sysctl.7 man-reference-man .man
./usr/share/man/man7/tests.7 man-reference-man .man
./usr/share/man/man7/zpool-features.7 man-zfs-man zfs,.man
./usr/share/man/man8/MAKEDEV.8 man-sysutil-man .man
./usr/share/man/man8/MAKEDEV.local.8 man-sysutil-man .man
./usr/share/man/man8/ac.8 man-sysutil-man .man
@@ -1,8 +1,10 @@
# $FreeBSD: src/cddl/Makefile.inc,v 1.6.2.1 2009/08/03 08:13:06 kensmith Exp $
# $FreeBSD: head/cddl/Makefile.inc 270358 2014-08-22 20:04:51Z delphij $
WARNS?=5
OSNETDIR= ${NETBSDSRCDIR}/external/cddl/osnet
OPENSOLARIS_USR_DISTDIR=${OSNETDIR}/dist
OPENSOLARIS_SYS_DISTDIR=${OSNETDIR}/dist
CPPFLAGS+=-Wno-unknown-pragmas -Wno-sign-compare -D_KERNTYPES
@@ -1,20 +1,18 @@
# $NetBSD: Makefile.zfs,v 1.4 2012/09/05 23:08:42 riz Exp $
# $NetBSD: Makefile.zfs,v 1.5 2018/05/28 21:05:02 chs Exp $
.include <bsd.own.mk>
# Verify these manually
NOGCCERROR= yes
# Basic compilation stuff.
CPPFLAGS+= "-D__va_list=va_list"
CPPFLAGS+= "-Doffsetof(s, m)=((size_t)(&(((s *)0)->m)))"
CPPFLAGS+= -std=c99
# Pick a VTOC format - ick.
CPPFLAGS+= -D_SUNOS_VTOC_16
CPPFLAGS+= -D_PROPLIB_ZFS_CONFLICT
CFLAGS+= -O0 -fno-inline
#CFLAGS+= -O0 -fno-inline
#DBG= -g
@@ -36,14 +34,24 @@ CPPFLAGS+= -I${ZFSDIR}/dist/lib/libshare/common
CPPFLAGS+= -I${ZFSDIR}/dist/lib/libumem
CPPFLAGS+= -I${ZFSDIR}/dist/lib/libuutil/common
CPPFLAGS+= -I${ZFSDIR}/dist/lib/libzfs/common
CPPFLAGS+= -I${ZFSDIR}/dist/lib/libzfs_core/common
CPPFLAGS+= -I${ZFSDIR}/dist/lib/libzpool/common
CPPFLAGS+= -I${ZFSDIR}/dist/common
CWARNFLAGS+= -Wno-missing-field-initializers
CWARNFLAGS+= -Wno-strict-prototypes
CWARNFLAGS+= -Wno-cast-qual
CWARNFLAGS+= -Wno-discarded-qualifiers
CWARNFLAGS+= -Wno-switch
CWARNFLAGS+= -Wno-missing-prototypes
CWARNFLAGS+= -Wno-unused-variable
CWARNFLAGS+= -Wno-shadow
LIBAVL_SRCDIR= ${ZFSDIR}/lib/libavl
LIBNVPAIR_SRCDIR= ${ZFSDIR}/lib/libnvpair
LIBUMEM_SRCDIR= ${ZFSDIR}/lib/libumem
LIBUUTIL_SRCDIR= ${ZFSDIR}/lib/libuutil
LIBZFS_SRCDIR= ${ZFSDIR}/lib/libzfs
LIBZFS_CORE_SRCDIR= ${ZFSDIR}/lib/libzfs_core
LIBZPOOL_SRCDIR= ${ZFSDIR}/lib/libzpool
@@ -1,4 +1,4 @@
/* $NetBSD: cyclic_machdep.c,v 1.1 2014/03/05 06:35:44 ozaki-r Exp $ */
/* $NetBSD: cyclic_machdep.c,v 1.2 2018/05/28 21:05:02 chs Exp $ */
/*
* Copyright 2006-2008 John Birrell <jb@FreeBSD.org>
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
* $FreeBSD: head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c 222813 2011-06-07 08:46:13Z attilio $
*
*/
@@ -1,4 +1,4 @@
/* $NetBSD: cyclic.c,v 1.7 2017/02/01 21:59:09 chs Exp $ */
/* $NetBSD: cyclic.c,v 1.8 2018/05/28 21:05:02 chs Exp $ */
/*
* CDDL HEADER START
@@ -23,7 +23,7 @@
*
* Portions Copyright 2008 John Birrell <jb@freebsd.org>
*
* $FreeBSD$
* $FreeBSD: head/sys/cddl/dev/cyclic/cyclic.c 227293 2011-11-07 06:44:47Z ed $
*
* This is a simplified version of the cyclic timer subsystem from
* OpenSolaris. In the FreeBSD version, we don't use interrupt levels.
@@ -352,7 +352,6 @@
#define mtx_unlock_spin(x) mutex_spin_exit(x)
#define mtx_destroy(x) mutex_destroy(x)
#define ASSERT(x) KASSERT(x)
#define SYSINIT(a1, a2, a3, a4, a5)
#define SYSUNINIT(a1, a2, a3, a4, a5)
#define CPU_FOREACH(var) \
@@ -1,4 +1,4 @@
/* $NetBSD: cyclic_test.c,v 1.2 2010/02/21 01:46:33 darran Exp $ */
/* $NetBSD: cyclic_test.c,v 1.3 2018/05/28 21:05:02 chs Exp $ */
/*-
* Copyright 2007 John Birrell <jb@FreeBSD.org>
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/cddl/dev/cyclic/cyclic_test.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $
* $FreeBSD: head/sys/cddl/dev/cyclic/cyclic_test.c 179260 2008-05-23 22:21:58Z jb $
*
*/
@@ -1,4 +1,4 @@
/* $NetBSD: cyclic_machdep.c,v 1.4 2012/12/02 01:05:16 chs Exp $ */
/* $NetBSD: cyclic_machdep.c,v 1.5 2018/05/28 21:05:02 chs Exp $ */
/*-
* Copyright 2006-2008 John Birrell <jb@FreeBSD.org>
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
* $FreeBSD: head/sys/cddl/dev/cyclic/i386/cyclic_machdep.c 222813 2011-06-07 08:46:13Z attilio $
*
*/
@@ -1,4 +1,4 @@
/* $NetBSD: dtmalloc.c,v 1.2 2010/02/21 01:46:33 darran Exp $ */
/* $NetBSD: dtmalloc.c,v 1.3 2018/05/28 21:05:03 chs Exp $ */
/*
* CDDL HEADER START
@@ -22,14 +22,15 @@
*
* Portions Copyright 2006-2008 John Birrell jb@freebsd.org
*
* $FreeBSD: src/sys/cddl/dev/dtmalloc/dtmalloc.c,v 1.1.4.1 2009/08/03 08:13:06 kensmith Exp $
* $FreeBSD: head/sys/cddl/dev/dtmalloc/dtmalloc.c 252325 2013-06-28 03:14:40Z markj $
*
*/
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/ctype.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/module.h>
@@ -113,8 +114,17 @@ dtmalloc_type_cb(struct malloc_type *mtp, void *arg __unused)
{
char name[DTRACE_FUNCNAMELEN];
struct malloc_type_internal *mtip = mtp->ks_handle;
int i;
/*
* malloc_type descriptions are allowed to contain whitespace, but
* DTrace probe identifiers are not, so replace the whitespace with
* underscores.
*/
strlcpy(name, mtp->ks_shortdesc, sizeof(name));
for (i = 0; name[i] != 0; i++)
if (isspace(name[i]))
name[i] = '_';
if (dtrace_probe_lookup(dtmalloc_id, NULL, name, "malloc") != 0)
return;
Oops, something went wrong.

0 comments on commit bae129c

Please sign in to comment.