svn commit: r254704 - in stable/9/sys: cddl/compat/opensolaris/sys cddl/dev/dtrace conf modules/cyclic modules/dtrace/dtio modules/dtrace/dtmalloc modules/dtrace/dtnfscl modules/dtrace/dtnfsclient ...

Andriy Gapon avg at FreeBSD.org
Fri Aug 23 14:17:51 UTC 2013


Author: avg
Date: Fri Aug 23 14:17:45 2013
New Revision: 254704
URL: http://svnweb.freebsd.org/changeset/base/254704

Log:
  MFC r253996,253997: opensolaris code: translate INVARIANTS to DEBUG and ZFS_DEBUG
  
  Please note that support for compiling ZFS into a kernel is not in this
  branch as of now.

Added:
  stable/9/sys/cddl/compat/opensolaris/sys/debug_compat.h
     - copied unchanged from r253996, head/sys/cddl/compat/opensolaris/sys/debug_compat.h
Modified:
  stable/9/sys/cddl/compat/opensolaris/sys/mutex.h
  stable/9/sys/cddl/compat/opensolaris/sys/rwlock.h
  stable/9/sys/cddl/dev/dtrace/dtrace_load.c
  stable/9/sys/cddl/dev/dtrace/dtrace_unload.c
  stable/9/sys/conf/options
  stable/9/sys/modules/cyclic/Makefile
  stable/9/sys/modules/dtrace/dtio/Makefile
  stable/9/sys/modules/dtrace/dtmalloc/Makefile
  stable/9/sys/modules/dtrace/dtnfscl/Makefile
  stable/9/sys/modules/dtrace/dtnfsclient/Makefile
  stable/9/sys/modules/dtrace/dtrace/Makefile
  stable/9/sys/modules/dtrace/dtrace_test/Makefile
  stable/9/sys/modules/dtrace/dtraceall/Makefile
  stable/9/sys/modules/dtrace/fasttrap/Makefile
  stable/9/sys/modules/dtrace/fbt/Makefile
  stable/9/sys/modules/dtrace/lockstat/Makefile
  stable/9/sys/modules/dtrace/profile/Makefile
  stable/9/sys/modules/dtrace/prototype/Makefile
  stable/9/sys/modules/dtrace/sdt/Makefile
  stable/9/sys/modules/dtrace/systrace/Makefile
  stable/9/sys/modules/dtrace/systrace_freebsd32/Makefile
  stable/9/sys/modules/dtrace/systrace_linux32/Makefile
  stable/9/sys/modules/opensolaris/Makefile
  stable/9/sys/modules/zfs/Makefile
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/modules/   (props changed)

Copied: stable/9/sys/cddl/compat/opensolaris/sys/debug_compat.h (from r253996, head/sys/cddl/compat/opensolaris/sys/debug_compat.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/9/sys/cddl/compat/opensolaris/sys/debug_compat.h	Fri Aug 23 14:17:45 2013	(r254704, copy of r253996, head/sys/cddl/compat/opensolaris/sys/debug_compat.h)
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2013 Andriy Gapon <avg at FreeBSD.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+/*
+ * This is a special file that SHOULD NOT be included using #include directive.
+ */
+
+#if defined(INVARIANTS)
+#ifndef DEBUG
+#define DEBUG
+#endif
+#endif

Modified: stable/9/sys/cddl/compat/opensolaris/sys/mutex.h
==============================================================================
--- stable/9/sys/cddl/compat/opensolaris/sys/mutex.h	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/cddl/compat/opensolaris/sys/mutex.h	Fri Aug 23 14:17:45 2013	(r254704)
@@ -46,7 +46,7 @@ typedef enum {
 
 typedef struct sx	kmutex_t;
 
-#ifndef DEBUG
+#ifndef OPENSOLARIS_WITNESS
 #define	MUTEX_FLAGS	(SX_DUPOK | SX_NOWITNESS)
 #else
 #define	MUTEX_FLAGS	(SX_DUPOK)

Modified: stable/9/sys/cddl/compat/opensolaris/sys/rwlock.h
==============================================================================
--- stable/9/sys/cddl/compat/opensolaris/sys/rwlock.h	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/cddl/compat/opensolaris/sys/rwlock.h	Fri Aug 23 14:17:45 2013	(r254704)
@@ -47,7 +47,7 @@ typedef enum {
 
 typedef	struct sx	krwlock_t;
 
-#ifndef DEBUG
+#ifndef OPENSOLARIS_WITNESS
 #define	RW_FLAGS	(SX_DUPOK | SX_NOWITNESS)
 #else
 #define	RW_FLAGS	(SX_DUPOK)

Modified: stable/9/sys/cddl/dev/dtrace/dtrace_load.c
==============================================================================
--- stable/9/sys/cddl/dev/dtrace/dtrace_load.c	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/cddl/dev/dtrace/dtrace_load.c	Fri Aug 23 14:17:45 2013	(r254704)
@@ -73,7 +73,9 @@ dtrace_load(void *dummy)
 	mutex_init(&dtrace_lock,"dtrace probe state", MUTEX_DEFAULT, NULL);
 	mutex_init(&dtrace_provider_lock,"dtrace provider state", MUTEX_DEFAULT, NULL);
 	mutex_init(&dtrace_meta_lock,"dtrace meta-provider state", MUTEX_DEFAULT, NULL);
+#ifdef DEBUG
 	mutex_init(&dtrace_errlock,"dtrace error lock", MUTEX_DEFAULT, NULL);
+#endif
 
 	mutex_enter(&dtrace_provider_lock);
 	mutex_enter(&dtrace_lock);

Modified: stable/9/sys/cddl/dev/dtrace/dtrace_unload.c
==============================================================================
--- stable/9/sys/cddl/dev/dtrace/dtrace_unload.c	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/cddl/dev/dtrace/dtrace_unload.c	Fri Aug 23 14:17:45 2013	(r254704)
@@ -121,7 +121,9 @@ dtrace_unload()
 	mutex_destroy(&dtrace_meta_lock);
 	mutex_destroy(&dtrace_provider_lock);
 	mutex_destroy(&dtrace_lock);
+#ifdef DEBUG
 	mutex_destroy(&dtrace_errlock);
+#endif
 
 	/* XXX Hack */
 	mutex_destroy(&mod_lock);

Modified: stable/9/sys/conf/options
==============================================================================
--- stable/9/sys/conf/options	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/conf/options	Fri Aug 23 14:17:45 2013	(r254704)
@@ -682,6 +682,7 @@ KTR_VERBOSE		opt_ktr.h
 WITNESS			opt_global.h
 WITNESS_KDB		opt_witness.h
 WITNESS_SKIPSPIN	opt_witness.h
+OPENSOLARIS_WITNESS	opt_global.h
 
 # options for ACPI support
 ACPI_DEBUG		opt_acpi.h

Modified: stable/9/sys/modules/cyclic/Makefile
==============================================================================
--- stable/9/sys/modules/cyclic/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/cyclic/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -12,8 +12,8 @@ CFLAGS+=	-I${.CURDIR}/../../cddl/compat/
 		-I${.CURDIR}/../..					\
 		-I${.CURDIR}/../../cddl/dev/cyclic/${MACHINE_CPUARCH:S/amd64/i386/}
 
-CFLAGS+=	-DDEBUG=1
-
 IGNORE_PRAGMA=	1
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/dtio/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/dtio/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/dtio/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -11,3 +11,5 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/comp
 		-I${.CURDIR}/../../..
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/dtmalloc/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/dtmalloc/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/dtmalloc/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -11,3 +11,5 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/comp
 		-I${.CURDIR}/../../..
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/dtnfscl/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/dtnfscl/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/dtnfscl/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -11,3 +11,5 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/comp
 		-I${.CURDIR}/../../..
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/dtnfsclient/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/dtnfsclient/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/dtnfsclient/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -11,3 +11,5 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/comp
 		-I${.CURDIR}/../../..
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/dtrace/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/dtrace/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/dtrace/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -40,7 +40,7 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/comp
 		-I${.CURDIR}/../../../cddl/contrib/opensolaris/uts/common \
 		-I${.CURDIR}/../../.. -DDIS_MEM
 
-CFLAGS+=	-DSMP -DDEBUG
+CFLAGS+=	-DSMP
 
 EXPORT_SYMS=	dtrace_register \
 		dtrace_unregister \
@@ -50,6 +50,9 @@ dtrace_asm.o:  assym.s
 
 .include <bsd.kmod.mk>
 
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+
 CWARNFLAGS+=	-Wno-parentheses
 CWARNFLAGS+=	-Wno-uninitialized
 CWARNFLAGS+=	-Wno-cast-qual
+CWARNFLAGS+=	-Wno-unused

Modified: stable/9/sys/modules/dtrace/dtrace_test/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/dtrace_test/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/dtrace_test/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -12,3 +12,5 @@ CFLAGS+=	-I${.CURDIR}/../../..
 CFLAGS+=	-D_KERNEL
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/dtraceall/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/dtraceall/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/dtraceall/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -13,3 +13,5 @@ opt_compat.h:
 .endif
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/fasttrap/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/fasttrap/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/fasttrap/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -15,6 +15,9 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/cont
 .PATH:		${.CURDIR}/../../../cddl/contrib/opensolaris/uts/intel/dtrace
 .endif
 
-CFLAGS+=	-DSMP -DDEBUG
+CFLAGS+=	-DSMP
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h
+CWARNFLAGS+=	-Wno-unused

Modified: stable/9/sys/modules/dtrace/fbt/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/fbt/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/fbt/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -11,3 +11,5 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/comp
 		-I${.CURDIR}/../../..
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/lockstat/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/lockstat/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/lockstat/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -12,3 +12,5 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/comp
 		-I${.CURDIR}/../../..
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/profile/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/profile/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/profile/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -11,3 +11,5 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/comp
 		-I${.CURDIR}/../../..
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/prototype/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/prototype/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/prototype/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -11,3 +11,5 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/comp
 		-I${.CURDIR}/../../..
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/sdt/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/sdt/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/sdt/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -11,3 +11,5 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/comp
 		-I${.CURDIR}/../../..
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/systrace/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/systrace/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/systrace/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -11,3 +11,5 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/comp
 		-I${.CURDIR}/../../..
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/systrace_freebsd32/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/systrace_freebsd32/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/systrace_freebsd32/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -11,3 +11,5 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/comp
 		-I${.CURDIR}/../../.. -DFREEBSD32_SYSTRACE
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/dtrace/systrace_linux32/Makefile
==============================================================================
--- stable/9/sys/modules/dtrace/systrace_linux32/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/dtrace/systrace_linux32/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -16,3 +16,5 @@ CFLAGS+=	-I${.CURDIR}/../../../cddl/comp
 		-I${.CURDIR}/../../.. -DLINUX_SYSTRACE
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/opensolaris/Makefile
==============================================================================
--- stable/9/sys/modules/opensolaris/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/opensolaris/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -27,3 +27,5 @@ CFLAGS+=	-I${.CURDIR}/../../cddl/compat/
 IGNORE_PRAGMA=	1
 
 .include <bsd.kmod.mk>
+
+CFLAGS+=	-include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h

Modified: stable/9/sys/modules/zfs/Makefile
==============================================================================
--- stable/9/sys/modules/zfs/Makefile	Fri Aug 23 14:12:39 2013	(r254703)
+++ stable/9/sys/modules/zfs/Makefile	Fri Aug 23 14:17:45 2013	(r254704)
@@ -95,6 +95,8 @@ CFLAGS+=-mminimal-toc
 
 .include <bsd.kmod.mk>
 
+CFLAGS+=	-include ${.CURDIR}/../../cddl/compat/opensolaris/sys/debug_compat.h
+
 CWARNFLAGS+=-Wno-unknown-pragmas
 CWARNFLAGS+=-Wno-missing-prototypes
 CWARNFLAGS+=-Wno-undef


More information about the svn-src-stable-9 mailing list