Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 May 2008 03:31:00 GMT
From:      John Birrell <jb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 142187 for review
Message-ID:  <200805240331.m4O3V0rA089175@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=142187

Change 142187 by jb@freebsd3 on 2008/05/24 03:30:45

	IFopensolaris

Affected files ...

.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst#3 integrate
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl#7 integrate
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh.out#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/Makefile#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.basic.ksh#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.hvmenable.ksh#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.memenable.ksh#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedargs.ksh#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/i86xpv/xdt/tst.schedenable.ksh#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c#7 integrate
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c#7 integrate
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_program.c#6 integrate
.. //depot/projects/dtrace/src/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c#6 integrate
.. //depot/projects/dtrace/src/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c#5 integrate

Differences ...

==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/jdtrace/exception.lst#3 (text+ko) ====

@@ -23,7 +23,7 @@
 # Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
-#ident	"%Z%%M%	%I%	%E% SMI"
+# ident	"%Z%%M%	%I%	%E% SMI"
 
 # Exception list: names tests that are bypassed when running in Java
 # mode (relative to /opt/SUNWdtrt/tst)
@@ -49,6 +49,7 @@
 common/usdt/tst.dlclose3.ksh
 common/usdt/tst.eliminate.ksh
 common/usdt/tst.enabled.ksh
+common/usdt/tst.enabled2.ksh
 common/usdt/tst.entryreturn.ksh
 common/usdt/tst.fork.ksh
 common/usdt/tst.header.ksh

==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl#7 (xtext) ====

@@ -40,6 +40,7 @@
 $USAGE = "Usage: $PNAME [-abfghjlnqs] [-d dir] [-i isa] "
     . "[-x opt[=arg]] [file | dir ...]\n";
 ($MACH = `uname -p`) =~ s/\W*\n//;
+($PLATFORM = `uname -i`) =~ s/\W*\n//;
 
 @dtrace_argv = ();
 
@@ -215,17 +216,17 @@
 }
 
 #
-# Iterate over the set of test files specified on the command-line or by
-# a find on "$defdir/common" and "$defdir/$MACH" and execute each one.
-# If the test file is executable, we fork and exec it. If the test is a
-# .ksh file, we run it with $ksh_path. Otherwise we run dtrace -s on it.
-# If the file is named tst.* we assume it should return exit status 0.
-# If the file is named err.* we assume it should return exit status 1.
-# If the file is named err.D_[A-Z0-9]+[.*].d we use dtrace -xerrtags and
-# examine stderr to ensure that a matching error tag was produced.
-# If the file is named drp.[A-Z0-9]+[.*].d we use dtrace -xdroptags and
-# examine stderr to ensure that a matching drop tag was produced.
-# If any *.out or *.err files are found we perform output comparisons.
+# Iterate over the set of test files specified on the command-line or by a find
+# on "$defdir/common", "$defdir/$MACH" and "$defdir/$PLATFORM" and execute each
+# one.  If the test file is executable, we fork and exec it. If the test is a
+# .ksh file, we run it with $ksh_path. Otherwise we run dtrace -s on it.  If
+# the file is named tst.* we assume it should return exit status 0.  If the
+# file is named err.* we assume it should return exit status 1.  If the file is
+# named err.D_[A-Z0-9]+[.*].d we use dtrace -xerrtags and examine stderr to
+# ensure that a matching error tag was produced.  If the file is named
+# drp.[A-Z0-9]+[.*].d we use dtrace -xdroptags and examine stderr to ensure
+# that a matching drop tag was produced.  If any *.out or *.err files are found
+# we perform output comparisons.
 #
 # run_tests takes two arguments: The first is the pathname of the dtrace
 # command to invoke when running the tests. The second is the pathname
@@ -548,6 +549,7 @@
 
 find(\&wanted, "$defdir/common") if (scalar(@ARGV) == 0);
 find(\&wanted, "$defdir/$MACH") if (scalar(@ARGV) == 0);
+find(\&wanted, "$defdir/$PLATFORM") if (scalar(@ARGV) == 0);
 die $USAGE if (scalar(@files) == 0);
 
 $dtrace_path = '/usr/sbin/dtrace';

==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c#7 (text) ====

@@ -868,15 +868,19 @@
 	/*
 	 * We may have already processed this object file in an earlier linker
 	 * invocation. Check to see if the present instruction sequence matches
-	 * the one we would install.
+	 * the one we would install below.
 	 */
 	if (isenabled) {
-		if (ip[0] == DT_OP_CLR_O0)
+		if (ip[0] == DT_OP_NOP) {
+			(*off) += sizeof (ip[0]);
 			return (0);
+		}
 	} else {
 		if (DT_IS_RESTORE(ip[1])) {
-			if (ip[0] == DT_OP_RET)
+			if (ip[0] == DT_OP_RET) {
+				(*off) += sizeof (ip[0]);
 				return (0);
+			}
 		} else if (DT_IS_MOV_O7(ip[1])) {
 			if (DT_IS_RETL(ip[0]))
 				return (0);
@@ -910,7 +914,17 @@
 			return (-1);
 		}
 
-		ip[0] = DT_OP_CLR_O0;
+
+		/*
+		 * On SPARC, we take advantage of the fact that the first
+		 * argument shares the same register as for the return value.
+		 * The macro handles the work of zeroing that register so we
+		 * don't need to do anything special here. We instrument the
+		 * instruction in the delay slot as we'll need to modify the
+		 * return register after that instruction has been emulated.
+		 */
+		ip[0] = DT_OP_NOP;
+		(*off) += sizeof (ip[0]);
 	} else {
 		/*
 		 * If the call is followed by a restore, it's a tail call so
@@ -919,11 +933,16 @@
 		 * so change the call to a retl-like instruction that returns
 		 * to that register value + 8 (rather than the typical %o7 +
 		 * 8); the delay slot instruction is left, but should have no
-		 * effect. Otherwise we change the call to be a nop. In the
-		 * first and the last case we adjust the offset to land on what
-		 * was once the delay slot of the call so we correctly get all
-		 * the arguments as they would have been passed in a normal
-		 * function call.
+		 * effect. Otherwise we change the call to be a nop. We
+		 * identify the subsequent instruction as the probe point in
+		 * all but the leaf tail-call case to ensure that arguments to
+		 * the probe are complete and consistent. An astute, though
+		 * largely hypothetical, observer would note that there is the
+		 * possibility of a false-positive probe firing if the function
+		 * contained a branch to the instruction in the delay slot of
+		 * the call. Fixing this would require significant in-kernel
+		 * modifications, and isn't worth doing until we see it in the
+		 * wild.
 		 */
 		if (DT_IS_RESTORE(ip[1])) {
 			ip[0] = DT_OP_RET;

==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c#7 (text) ====

@@ -115,8 +115,9 @@
 #define	DT_VERS_1_5	DT_VERSION_NUMBER(1, 5, 0)
 #define	DT_VERS_1_6	DT_VERSION_NUMBER(1, 6, 0)
 #define	DT_VERS_1_6_1	DT_VERSION_NUMBER(1, 6, 1)
-#define	DT_VERS_LATEST	DT_VERS_1_6_1
-#define	DT_VERS_STRING	"Sun D 1.6.1"
+#define	DT_VERS_1_6_2	DT_VERSION_NUMBER(1, 6, 2)
+#define	DT_VERS_LATEST	DT_VERS_1_6_2
+#define	DT_VERS_STRING	"Sun D 1.6.2"
 
 const dt_version_t _dtrace_versions[] = {
 	DT_VERS_1_0,	/* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */
@@ -130,6 +131,7 @@
 	DT_VERS_1_5,	/* D API 1.5 Solaris Express 7/07 */
 	DT_VERS_1_6,	/* D API 1.6 */
 	DT_VERS_1_6_1,	/* D API 1.6.1 */
+	DT_VERS_1_6_2,	/* D API 1.6.2 */
 	0
 };
 

==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_program.c#6 (text) ====

@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -436,8 +436,13 @@
 	if (fprintf(infop->dthi_out, ");\n") < 0)
 		return (dt_set_errno(dtp, errno));
 
-	if (fprintf(infop->dthi_out, "extern int "
-	    "__dtraceenabled_%s___%s(void);\n", infop->dthi_pfname, fname) < 0)
+	if (fprintf(infop->dthi_out,
+	    "#ifndef\t__sparc\n"
+	    "extern int __dtraceenabled_%s___%s(void);\n"
+	    "#else\n"
+	    "extern int __dtraceenabled_%s___%s(long);\n"
+	    "#endif\n",
+	    infop->dthi_pfname, fname, infop->dthi_pfname, fname) < 0)
 		return (dt_set_errno(dtp, errno));
 
 	return (0);
@@ -499,13 +504,20 @@
 		return (dt_set_errno(dtp, errno));
 
 	if (!infop->dthi_empty) {
-		if (fprintf(infop->dthi_out, "#define\t%s_%s_ENABLED() \\\n",
-		    infop->dthi_pmname, mname) < 0)
+		if (fprintf(infop->dthi_out,
+		    "#ifndef\t__sparc\n"
+		    "#define\t%s_%s_ENABLED() \\\n"
+		    "\t__dtraceenabled_%s___%s()\n"
+		    "#else\n"
+		    "#define\t%s_%s_ENABLED() \\\n"
+		    "\t__dtraceenabled_%s___%s(0)\n"
+		    "#endif\n",
+		    infop->dthi_pmname, mname,
+		    infop->dthi_pfname, fname,
+		    infop->dthi_pmname, mname,
+		    infop->dthi_pfname, fname) < 0)
 			return (dt_set_errno(dtp, errno));
 
-		if (fprintf(infop->dthi_out, "\t__dtraceenabled_%s___%s()\n",
-		    infop->dthi_pfname, fname) < 0)
-			return (dt_set_errno(dtp, errno));
 	} else {
 		if (fprintf(infop->dthi_out, "#define\t%s_%s_ENABLED() (0)\n",
 		    infop->dthi_pmname, mname) < 0)

==== //depot/projects/dtrace/src/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c#6 (text) ====

@@ -11398,13 +11398,21 @@
 	mutex_enter(&dtrace_lock);
 
 	/*
-	 * Because we can be called after dtrace_detach() has been called, we
-	 * cannot assert that there are retained enablings.  We can safely
-	 * load from dtrace_retained, however:  the taskq_destroy() at the
-	 * end of dtrace_detach() will block pending our completion.
+	 * Iterate over all retained enablings to see if any probes match
+	 * against them.  We only perform this operation on enablings for which
+	 * we have sufficient permissions by virtue of being in the global zone
+	 * or in the same zone as the DTrace client.  Because we can be called
+	 * after dtrace_detach() has been called, we cannot assert that there
+	 * are retained enablings.  We can safely load from dtrace_retained,
+	 * however:  the taskq_destroy() at the end of dtrace_detach() will
+	 * block pending our completion.
 	 */
-	for (enab = dtrace_retained; enab != NULL; enab = enab->dten_next)
-		(void) dtrace_enabling_match(enab, NULL);
+	for (enab = dtrace_retained; enab != NULL; enab = enab->dten_next) {
+		cred_t *cr = enab->dten_vstate->dtvs_state->dts_cred.dcr_cred;
+
+		if (INGLOBALZONE(curproc) || getzoneid() == crgetzoneid(cr))
+			(void) dtrace_enabling_match(enab, NULL);
+	}
 
 	mutex_exit(&dtrace_lock);
 	mutex_exit(&cpu_lock);

==== //depot/projects/dtrace/src/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c#5 (text) ====

@@ -2044,13 +2044,6 @@
 			    tp->ftt_proc->ftpc_acount != 0)
 				break;
 
-			/*
-			 * The count of active providers can only be
-			 * decremented (i.e. to zero) during exec, exit, and
-			 * removal of a meta provider so it should be
-			 * impossible to drop the count during this operation().
-			 */
-			ASSERT(tp->ftt_proc->ftpc_acount != 0);
 			tp = tp->ftt_next;
 		}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200805240331.m4O3V0rA089175>