PERFORCE change 140383 for review

John Birrell jb at FreeBSD.org
Tue Apr 22 05:08:24 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=140383

Change 140383 by jb at freebsd3 on 2008/04/22 05:08:02

	IFopensolaris

Affected files ...

.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d#2 integrate
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out#2 integrate
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substrminate.d.out#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.newprobes.ksh.out#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/err.D_PRAGMA_DEPEND.main.d#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pragma/tst.libchain.ksh#1 branch
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/sgs/include/debug.h#2 integrate
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/sgs/include/sgs.h#3 integrate
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c#3 integrate
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h#3 integrate
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c#3 integrate
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c#3 integrate
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c#3 integrate
.. //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pragma.c#3 integrate
.. //depot/projects/dtrace/src/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c#3 integrate
.. //depot/projects/dtrace/src/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c#2 integrate
.. //depot/projects/dtrace/src/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h#2 integrate

Differences ...

==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d#2 (text+ko) ====

@@ -20,18 +20,20 @@
  */
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
 
 #pragma D option quiet
+#pragma D option strsize=32
 
 struct {
 	int index;
 	int length;
 	int nolen;
+	int alt;
 } command[int];
 
 int i;
@@ -39,6 +41,9 @@
 BEGIN
 {
 	str = "foobarbazbop";
+	str2 = "";
+	altstr = "CRAIG: Positioned them, I don't ";
+	altstr2 = "know... I'm fairly wide guy.";
 
 	command[i].index = 3;
 	command[i].nolen = 1;
@@ -108,6 +113,18 @@
 	command[i].length = -1;
 	i++;
 
+	command[i].index = 3;
+	command[i].length = -4;
+	i++;
+
+	command[i].index = 3;
+	command[i].length = -20;
+	i++;
+
+	command[i].index = -10;
+	command[i].length = -5;
+	i++;
+
 	command[i].index = 0;
 	command[i].length = 400;
 	i++;
@@ -144,6 +161,16 @@
 	command[i].length = strlen(str) - 1;
 	i++;
 
+	command[i].index = 100;
+	command[i].length = 10;
+	command[i].alt = 1;
+	i++;
+
+	command[i].index = 100;
+	command[i].nolen = 1;
+	command[i].alt = 1;
+	i++;
+
 	end = i;
 	i = 0;
 	printf("#!/usr/perl5/bin/perl\n\nBEGIN {\n");
@@ -153,17 +180,21 @@
 tick-1ms
 /i < end && command[i].nolen/
 {
-	this->result = substr(str, command[i].index);
+	this->str = command[i].alt ? altstr : str;
+	this->str2 = command[i].alt ? altstr2 : str2;
+	this->result = substr(command[i].alt ?
+	    "CRAIG: Positioned them, I don't know... I'm fairly wide guy." :
+	    str, command[i].index);
 
-	printf("\tif (substr(\"%s\", %d) != \"%s\") {\n",
-	    str, command[i].index, this->result);
+	printf("\tif (substr(\"%s%s\", %d) ne \"%s\") {\n",
+	    this->str, this->str2, command[i].index, this->result);
 
-	printf("\t\tprintf(\"perl => substr(\\\"%s\\\", %d) = ",
-	    str, command[i].index);
-	printf("\\\"%%s\\\"\\n\",\n\t\t    substr(\"%s\", %d));\n",
-	    str, command[i].index);
-	printf("\t\tprintf(\"   D => substr(\\\"%s\\\", %d) = ",
-	    str, command[i].index);
+	printf("\t\tprintf(\"perl => substr(\\\"%s%s\\\", %d) = ",
+	    this->str, this->str2, command[i].index);
+	printf("\\\"%%s\\\"\\n\",\n\t\t    substr(\"%s%s\", %d));\n",
+	    this->str, this->str2, command[i].index);
+	printf("\t\tprintf(\"   D => substr(\\\"%s%s\\\", %d) = ",
+	    this->str, this->str2, command[i].index);
 	printf("\\\"%%s\\\"\\n\",\n\t\t    \"%s\");\n", this->result);
 	printf("\t\t$failed++;\n");
 	printf("\t}\n\n");
@@ -172,16 +203,21 @@
 tick-1ms
 /i < end && !command[i].nolen/
 {
-	this->result = substr(str, command[i].index, command[i].length);
+	this->str = command[i].alt ? altstr : str;
+	this->str2 = command[i].alt ? altstr2 : str2;
+	this->result = substr(command[i].alt ?
+	    "CRAIG: Positioned them, I don't know... I'm fairly wide guy." :
+	    str, command[i].index, command[i].length);
 
-	printf("\tif (substr(\"%s\", %d, %d) != \"%s\") {\n",
-	    str, command[i].index, command[i].length, this->result);
-	printf("\t\tprintf(\"perl => substr(\\\"%s\\\", %d, %d) = ",
-	    str, command[i].index, command[i].length);
-	printf("\\\"%%s\\\"\\n\",\n\t\t    substr(\"%s\", %d, %d));\n",
-	    str, command[i].index, command[i].length);
-	printf("\t\tprintf(\"   D => substr(\\\"%s\\\", %d, %d) = ",
-	    str, command[i].index, command[i].length);
+	printf("\tif (substr(\"%s%s\", %d, %d) ne \"%s\") {\n",
+	    this->str, this->str2, command[i].index, command[i].length,
+	    this->result);
+	printf("\t\tprintf(\"perl => substr(\\\"%s%s\\\", %d, %d) = ",
+	    this->str, this->str2, command[i].index, command[i].length);
+	printf("\\\"%%s\\\"\\n\",\n\t\t    substr(\"%s%s\", %d, %d));\n",
+	    this->str, this->str2, command[i].index, command[i].length);
+	printf("\t\tprintf(\"   D => substr(\\\"%s%s\\\", %d, %d) = ",
+	    this->str, this->str2, command[i].index, command[i].length);
 	printf("\\\"%%s\\\"\\n\",\n\t\t    \"%s\");\n", this->result);
 	printf("\t\t$failed++;\n");
 	printf("\t}\n\n");

==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.substr.d.out#2 (text+ko) ====

@@ -1,7 +1,7 @@
 #!/usr/perl5/bin/perl
 
 BEGIN {
-	if (substr("foobarbazbop", 3) != "barbazbop") {
+	if (substr("foobarbazbop", 3) ne "barbazbop") {
 		printf("perl => substr(\"foobarbazbop\", 3) = \"%s\"\n",
 		    substr("foobarbazbop", 3));
 		printf("   D => substr(\"foobarbazbop\", 3) = \"%s\"\n",
@@ -9,7 +9,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 300) != "") {
+	if (substr("foobarbazbop", 300) ne "") {
 		printf("perl => substr(\"foobarbazbop\", 300) = \"%s\"\n",
 		    substr("foobarbazbop", 300));
 		printf("   D => substr(\"foobarbazbop\", 300) = \"%s\"\n",
@@ -17,7 +17,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", -10) != "obarbazbop") {
+	if (substr("foobarbazbop", -10) ne "obarbazbop") {
 		printf("perl => substr(\"foobarbazbop\", -10) = \"%s\"\n",
 		    substr("foobarbazbop", -10));
 		printf("   D => substr(\"foobarbazbop\", -10) = \"%s\"\n",
@@ -25,7 +25,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 0) != "foobarbazbop") {
+	if (substr("foobarbazbop", 0) ne "foobarbazbop") {
 		printf("perl => substr(\"foobarbazbop\", 0) = \"%s\"\n",
 		    substr("foobarbazbop", 0));
 		printf("   D => substr(\"foobarbazbop\", 0) = \"%s\"\n",
@@ -33,7 +33,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 1) != "oobarbazbop") {
+	if (substr("foobarbazbop", 1) ne "oobarbazbop") {
 		printf("perl => substr(\"foobarbazbop\", 1) = \"%s\"\n",
 		    substr("foobarbazbop", 1));
 		printf("   D => substr(\"foobarbazbop\", 1) = \"%s\"\n",
@@ -41,7 +41,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 11) != "p") {
+	if (substr("foobarbazbop", 11) ne "p") {
 		printf("perl => substr(\"foobarbazbop\", 11) = \"%s\"\n",
 		    substr("foobarbazbop", 11));
 		printf("   D => substr(\"foobarbazbop\", 11) = \"%s\"\n",
@@ -49,7 +49,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 12) != "") {
+	if (substr("foobarbazbop", 12) ne "") {
 		printf("perl => substr(\"foobarbazbop\", 12) = \"%s\"\n",
 		    substr("foobarbazbop", 12));
 		printf("   D => substr(\"foobarbazbop\", 12) = \"%s\"\n",
@@ -57,7 +57,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 13) != "") {
+	if (substr("foobarbazbop", 13) ne "") {
 		printf("perl => substr(\"foobarbazbop\", 13) = \"%s\"\n",
 		    substr("foobarbazbop", 13));
 		printf("   D => substr(\"foobarbazbop\", 13) = \"%s\"\n",
@@ -65,7 +65,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 8, 20) != "zbop") {
+	if (substr("foobarbazbop", 8, 20) ne "zbop") {
 		printf("perl => substr(\"foobarbazbop\", 8, 20) = \"%s\"\n",
 		    substr("foobarbazbop", 8, 20));
 		printf("   D => substr(\"foobarbazbop\", 8, 20) = \"%s\"\n",
@@ -73,7 +73,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 4, 4) != "arba") {
+	if (substr("foobarbazbop", 4, 4) ne "arba") {
 		printf("perl => substr(\"foobarbazbop\", 4, 4) = \"%s\"\n",
 		    substr("foobarbazbop", 4, 4));
 		printf("   D => substr(\"foobarbazbop\", 4, 4) = \"%s\"\n",
@@ -81,7 +81,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 5, 8) != "rbazbop") {
+	if (substr("foobarbazbop", 5, 8) ne "rbazbop") {
 		printf("perl => substr(\"foobarbazbop\", 5, 8) = \"%s\"\n",
 		    substr("foobarbazbop", 5, 8));
 		printf("   D => substr(\"foobarbazbop\", 5, 8) = \"%s\"\n",
@@ -89,7 +89,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 5, 9) != "rbazbop") {
+	if (substr("foobarbazbop", 5, 9) ne "rbazbop") {
 		printf("perl => substr(\"foobarbazbop\", 5, 9) = \"%s\"\n",
 		    substr("foobarbazbop", 5, 9));
 		printf("   D => substr(\"foobarbazbop\", 5, 9) = \"%s\"\n",
@@ -97,7 +97,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 400, 20) != "") {
+	if (substr("foobarbazbop", 400, 20) ne "") {
 		printf("perl => substr(\"foobarbazbop\", 400, 20) = \"%s\"\n",
 		    substr("foobarbazbop", 400, 20));
 		printf("   D => substr(\"foobarbazbop\", 400, 20) = \"%s\"\n",
@@ -105,7 +105,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 400, 0) != "") {
+	if (substr("foobarbazbop", 400, 0) ne "") {
 		printf("perl => substr(\"foobarbazbop\", 400, 0) = \"%s\"\n",
 		    substr("foobarbazbop", 400, 0));
 		printf("   D => substr(\"foobarbazbop\", 400, 0) = \"%s\"\n",
@@ -113,7 +113,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 400, -1) != "") {
+	if (substr("foobarbazbop", 400, -1) ne "") {
 		printf("perl => substr(\"foobarbazbop\", 400, -1) = \"%s\"\n",
 		    substr("foobarbazbop", 400, -1));
 		printf("   D => substr(\"foobarbazbop\", 400, -1) = \"%s\"\n",
@@ -121,7 +121,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 3, 0) != "") {
+	if (substr("foobarbazbop", 3, 0) ne "") {
 		printf("perl => substr(\"foobarbazbop\", 3, 0) = \"%s\"\n",
 		    substr("foobarbazbop", 3, 0));
 		printf("   D => substr(\"foobarbazbop\", 3, 0) = \"%s\"\n",
@@ -129,15 +129,39 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 3, -1) != "") {
+	if (substr("foobarbazbop", 3, -1) ne "barbazbo") {
 		printf("perl => substr(\"foobarbazbop\", 3, -1) = \"%s\"\n",
 		    substr("foobarbazbop", 3, -1));
 		printf("   D => substr(\"foobarbazbop\", 3, -1) = \"%s\"\n",
+		    "barbazbo");
+		$failed++;
+	}
+
+	if (substr("foobarbazbop", 3, -4) ne "barba") {
+		printf("perl => substr(\"foobarbazbop\", 3, -4) = \"%s\"\n",
+		    substr("foobarbazbop", 3, -4));
+		printf("   D => substr(\"foobarbazbop\", 3, -4) = \"%s\"\n",
+		    "barba");
+		$failed++;
+	}
+
+	if (substr("foobarbazbop", 3, -20) ne "") {
+		printf("perl => substr(\"foobarbazbop\", 3, -20) = \"%s\"\n",
+		    substr("foobarbazbop", 3, -20));
+		printf("   D => substr(\"foobarbazbop\", 3, -20) = \"%s\"\n",
 		    "");
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", 0, 400) != "foobarbazbop") {
+	if (substr("foobarbazbop", -10, -5) ne "obarb") {
+		printf("perl => substr(\"foobarbazbop\", -10, -5) = \"%s\"\n",
+		    substr("foobarbazbop", -10, -5));
+		printf("   D => substr(\"foobarbazbop\", -10, -5) = \"%s\"\n",
+		    "obarb");
+		$failed++;
+	}
+
+	if (substr("foobarbazbop", 0, 400) ne "foobarbazbop") {
 		printf("perl => substr(\"foobarbazbop\", 0, 400) = \"%s\"\n",
 		    substr("foobarbazbop", 0, 400));
 		printf("   D => substr(\"foobarbazbop\", 0, 400) = \"%s\"\n",
@@ -145,7 +169,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", -1, 400) != "p") {
+	if (substr("foobarbazbop", -1, 400) ne "p") {
 		printf("perl => substr(\"foobarbazbop\", -1, 400) = \"%s\"\n",
 		    substr("foobarbazbop", -1, 400));
 		printf("   D => substr(\"foobarbazbop\", -1, 400) = \"%s\"\n",
@@ -153,7 +177,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", -1, 0) != "") {
+	if (substr("foobarbazbop", -1, 0) ne "") {
 		printf("perl => substr(\"foobarbazbop\", -1, 0) = \"%s\"\n",
 		    substr("foobarbazbop", -1, 0));
 		printf("   D => substr(\"foobarbazbop\", -1, 0) = \"%s\"\n",
@@ -161,7 +185,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", -1, -1) != "") {
+	if (substr("foobarbazbop", -1, -1) ne "") {
 		printf("perl => substr(\"foobarbazbop\", -1, -1) = \"%s\"\n",
 		    substr("foobarbazbop", -1, -1));
 		printf("   D => substr(\"foobarbazbop\", -1, -1) = \"%s\"\n",
@@ -169,7 +193,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", -24, 24) != "foobarbazbop") {
+	if (substr("foobarbazbop", -24, 24) ne "foobarbazbop") {
 		printf("perl => substr(\"foobarbazbop\", -24, 24) = \"%s\"\n",
 		    substr("foobarbazbop", -24, 24));
 		printf("   D => substr(\"foobarbazbop\", -24, 24) = \"%s\"\n",
@@ -177,7 +201,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", -24, 12) != "") {
+	if (substr("foobarbazbop", -24, 12) ne "") {
 		printf("perl => substr(\"foobarbazbop\", -24, 12) = \"%s\"\n",
 		    substr("foobarbazbop", -24, 12));
 		printf("   D => substr(\"foobarbazbop\", -24, 12) = \"%s\"\n",
@@ -185,7 +209,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", -24, 13) != "f") {
+	if (substr("foobarbazbop", -24, 13) ne "f") {
 		printf("perl => substr(\"foobarbazbop\", -24, 13) = \"%s\"\n",
 		    substr("foobarbazbop", -24, 13));
 		printf("   D => substr(\"foobarbazbop\", -24, 13) = \"%s\"\n",
@@ -193,7 +217,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", -12, 12) != "foobarbazbop") {
+	if (substr("foobarbazbop", -12, 12) ne "foobarbazbop") {
 		printf("perl => substr(\"foobarbazbop\", -12, 12) = \"%s\"\n",
 		    substr("foobarbazbop", -12, 12));
 		printf("   D => substr(\"foobarbazbop\", -12, 12) = \"%s\"\n",
@@ -201,7 +225,7 @@
 		$failed++;
 	}
 
-	if (substr("foobarbazbop", -12, 11) != "foobarbazbo") {
+	if (substr("foobarbazbop", -12, 11) ne "foobarbazbo") {
 		printf("perl => substr(\"foobarbazbop\", -12, 11) = \"%s\"\n",
 		    substr("foobarbazbop", -12, 11));
 		printf("   D => substr(\"foobarbazbop\", -12, 11) = \"%s\"\n",
@@ -209,6 +233,22 @@
 		$failed++;
 	}
 
+	if (substr("CRAIG: Positioned them, I don't know... I'm fairly wide guy.", 100, 10) ne "") {
+		printf("perl => substr(\"CRAIG: Positioned them, I don't know... I'm fairly wide guy.\", 100, 10) = \"%s\"\n",
+		    substr("CRAIG: Positioned them, I don't know... I'm fairly wide guy.", 100, 10));
+		printf("   D => substr(\"CRAIG: Positioned them, I don't know... I'm fairly wide guy.\", 100, 10) = \"%s\"\n",
+		    "");
+		$failed++;
+	}
+
+	if (substr("CRAIG: Positioned them, I don't know... I'm fairly wide guy.", 100) ne "") {
+		printf("perl => substr(\"CRAIG: Positioned them, I don't know... I'm fairly wide guy.\", 100) = \"%s\"\n",
+		    substr("CRAIG: Positioned them, I don't know... I'm fairly wide guy.", 100));
+		printf("   D => substr(\"CRAIG: Positioned them, I don't know... I'm fairly wide guy.\", 100) = \"%s\"\n",
+		    "");
+		$failed++;
+	}
+
 	exit($failed);
 }
 

==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/sgs/include/debug.h#2 (text) ====

@@ -405,6 +405,7 @@
 
 #define	Dbg_unused_file		Dbg64_unused_file
 #define	Dbg_unused_lcinterface	Dbg64_unused_lcinterface
+#define	Dbg_unused_path		Dbg64_unused_path
 #define	Dbg_unused_sec		Dbg64_unused_sec
 #define	Dbg_unused_unref	Dbg64_unused_unref
 
@@ -607,6 +608,7 @@
 
 #define	Dbg_unused_file		Dbg32_unused_file
 #define	Dbg_unused_lcinterface	Dbg32_unused_lcinterface
+#define	Dbg_unused_path		Dbg32_unused_path
 #define	Dbg_unused_sec		Dbg32_unused_sec
 #define	Dbg_unused_unref	Dbg32_unused_unref
 
@@ -676,7 +678,7 @@
 extern	void	Dbg_file_delete(Rt_map *);
 extern	void	Dbg_file_dlclose(Lm_list *, const char *, int);
 extern	void	Dbg_file_dldump(Rt_map *, const char *, int);
-extern	void	Dbg_file_dlopen(Rt_map *, const char *, int);
+extern	void	Dbg_file_dlopen(Rt_map *, const char *, int *, int);
 extern	void	Dbg_file_elf(Lm_list *, const char *, ulong_t, ulong_t,
 		    ulong_t, ulong_t, const char *, Aliste);
 extern	void	Dbg_file_filtee(Lm_list *, const char *, const char *, int);
@@ -708,7 +710,7 @@
 extern	void	Dbg_libs_ignore(Lm_list *, const char *);
 extern	void	Dbg_libs_init(Lm_list *, List *, List *);
 extern	void	Dbg_libs_l(Lm_list *, const char *, const char *);
-extern	void	Dbg_libs_path(Lm_list *, const char *, Half, const char *);
+extern	void	Dbg_libs_path(Lm_list *, const char *, uint_t, const char *);
 extern	void	Dbg_libs_req(Lm_list *, const char *, const char *,
 		    const char *);
 extern	void	Dbg_libs_update(Lm_list *, List *, List *);
@@ -805,7 +807,8 @@
 extern	void	Dbg_syms_ar_title(Lm_list *, const char *, int);
 extern	void	Dbg_syms_created(Lm_list *, const char *);
 extern	void	Dbg_syms_discarded(Lm_list *, Sym_desc *);
-extern	void	Dbg_syms_dlsym(Rt_map *, const char *, const char *, int);
+extern	void	Dbg_syms_dlsym(Rt_map *, const char *, int *, const char *,
+		    int);
 extern	void	Dbg_syms_dup_sort_addr(Lm_list *, const char *, const char *,
 		    const char *, Addr);
 extern	void	Dbg_syms_entered(Ofl_desc *, Sym *, Sym_desc *);
@@ -858,6 +861,8 @@
 
 extern	void	Dbg_unused_file(Lm_list *, const char *, int, uint_t);
 extern	void	Dbg_unused_lcinterface(Rt_map *, Rt_map *, int);
+extern	void	Dbg_unused_path(Lm_list *, const char *, uint_t, uint_t,
+		    const char *);
 extern	void	Dbg_unused_sec(Lm_list *, Is_desc *);
 extern	void	Dbg_unused_unref(Rt_map *, const char *);
 

==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/cmd/sgs/include/sgs.h#3 (text) ====

@@ -24,7 +24,7 @@
  *	  All Rights Reserved
  *
  *
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  *
  * Global include file for all sgs.
@@ -69,8 +69,14 @@
 
 #ifndef _ASM
 
-extern const char link_ver_string[];	/* Linker version id  */
-					/*   see libconv/{plat}/vernote.s */
+/*
+ * link_ver_string[] contains a version string for use by the link-editor
+ * and all other linker components. It is found in libconv, and is
+ * generated by sgs/libconv/common/bld_vernote.ksh. That script produces
+ * libconv/{plat}/vernote.s, which is in turn assembled/linked into
+ * libconv.
+ */
+extern const char link_ver_string[];
 /*
  * Macro to round to next double word boundary.
  */

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

@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -2106,8 +2106,10 @@
 			dt_dprintf("skipping library %s: %s\n",
 			    dld->dtld_library,
 			    dtrace_errmsg(dtp, dtrace_errno(dtp)));
-		} else
+		} else {
+			dld->dtld_loaded = B_TRUE;
 			dt_program_destroy(dtp, pgp);
+		}
 	}
 
 	dt_lib_depend_free(dtp);

==== //depot/projects/dtrace/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h#3 (text) ====

@@ -18,6 +18,7 @@
  *
  * CDDL HEADER END
  */
+
 /*
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
@@ -193,6 +194,7 @@
 	char *dtld_libpath;		/* library pathname */
 	uint_t dtld_finish;		/* completion time in tsort for lib */
 	uint_t dtld_start;		/* starting time in tsort for lib */
+	uint_t dtld_loaded;		/* boolean: is this library loaded */
 	dt_list_t dtld_dependencies;	/* linked-list of lib dependencies */
 	dt_list_t dtld_dependents;	/* linked-list of lib dependents */
 } dt_lib_depend_t;

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

@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -942,7 +942,9 @@
 #elif defined(__i386) || defined(__amd64)
 
 #define	DT_OP_NOP		0x90
+#define	DT_OP_RET		0xc3
 #define	DT_OP_CALL		0xe8
+#define	DT_OP_JMP32		0xe9
 #define	DT_OP_REX_RAX		0x48
 #define	DT_OP_XOR_EAX_0		0x33
 #define	DT_OP_XOR_EAX_1		0xc0
@@ -952,6 +954,7 @@
     uint32_t *off)
 {
 	uint8_t *ip = (uint8_t *)(p + rela->r_offset - 1);
+	uint8_t ret;
 
 	/*
 	 * On x86, the first byte of the instruction is the call opcode and
@@ -975,38 +978,43 @@
 	 * 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. For is-enabled probes, we advance the
-	 * offset to the first nop instruction in the sequence.
+	 * offset to the first nop instruction in the sequence to match the
+	 * text modification code below.
 	 */
 	if (!isenabled) {
-		if (ip[0] == DT_OP_NOP && ip[1] == DT_OP_NOP &&
-		    ip[2] == DT_OP_NOP && ip[3] == DT_OP_NOP &&
-		    ip[4] == DT_OP_NOP)
+		if ((ip[0] == DT_OP_NOP || ip[0] == DT_OP_RET) &&
+		    ip[1] == DT_OP_NOP && ip[2] == DT_OP_NOP &&
+		    ip[3] == DT_OP_NOP && ip[4] == DT_OP_NOP)
 			return (0);
 	} else if (dtp->dt_oflags & DTRACE_O_LP64) {
 		if (ip[0] == DT_OP_REX_RAX &&
 		    ip[1] == DT_OP_XOR_EAX_0 && ip[2] == DT_OP_XOR_EAX_1 &&
-		    ip[3] == DT_OP_NOP && ip[4] == DT_OP_NOP) {
+		    (ip[3] == DT_OP_NOP || ip[3] == DT_OP_RET) &&
+		    ip[4] == DT_OP_NOP) {
 			(*off) += 3;
 			return (0);
 		}
 	} else {
 		if (ip[0] == DT_OP_XOR_EAX_0 && ip[1] == DT_OP_XOR_EAX_1 &&
-		    ip[2] == DT_OP_NOP && ip[3] == DT_OP_NOP &&
-		    ip[4] == DT_OP_NOP) {
+		    (ip[2] == DT_OP_NOP || ip[2] == DT_OP_RET) &&
+		    ip[3] == DT_OP_NOP && ip[4] == DT_OP_NOP) {
 			(*off) += 2;
 			return (0);
 		}
 	}
 
 	/*
-	 * We only expect a call instrution with a 32-bit displacement.
+	 * We expect either a call instrution with a 32-bit displacement or a
+	 * jmp instruction with a 32-bit displacement acting as a tail-call.
 	 */
-	if (ip[0] != DT_OP_CALL) {
-		dt_dprintf("found %x instead of a call instruction at %llx\n",
-		    ip[0], (u_longlong_t)rela->r_offset);
+	if (ip[0] != DT_OP_CALL && ip[0] != DT_OP_JMP32) {
+		dt_dprintf("found %x instead of a call or jmp instruction at "
+		    "%llx\n", ip[0], (u_longlong_t)rela->r_offset);
 		return (-1);
 	}
 
+	ret = (ip[0] == DT_OP_JMP32) ? DT_OP_RET : DT_OP_NOP;
+
 	/*
 	 * Establish the instruction sequence -- all nops for probes, and an
 	 * instruction to clear the return value register (%eax/%rax) followed
@@ -1015,7 +1023,7 @@
 	 * for more readable disassembly when the probe is enabled.
 	 */
 	if (!isenabled) {
-		ip[0] = DT_OP_NOP;
+		ip[0] = ret;
 		ip[1] = DT_OP_NOP;
 		ip[2] = DT_OP_NOP;
 		ip[3] = DT_OP_NOP;
@@ -1024,13 +1032,13 @@
 		ip[0] = DT_OP_REX_RAX;
 		ip[1] = DT_OP_XOR_EAX_0;
 		ip[2] = DT_OP_XOR_EAX_1;
-		ip[3] = DT_OP_NOP;
+		ip[3] = ret;
 		ip[4] = DT_OP_NOP;
 		(*off) += 3;
 	} else {
 		ip[0] = DT_OP_XOR_EAX_0;
 		ip[1] = DT_OP_XOR_EAX_1;
-		ip[2] = DT_OP_NOP;
+		ip[2] = ret;
 		ip[3] = DT_OP_NOP;
 		ip[4] = DT_OP_NOP;
 		(*off) += 2;

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

@@ -114,8 +114,9 @@
 #define	DT_VERS_1_4_1	DT_VERSION_NUMBER(1, 4, 1)
 #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_LATEST	DT_VERS_1_6
-#define	DT_VERS_STRING	"Sun D 1.6"
+#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"
 
 const dt_version_t _dtrace_versions[] = {
 	DT_VERS_1_0,	/* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */
@@ -128,6 +129,7 @@
 	DT_VERS_1_4_1,	/* D API 1.4.1 Solaris Express 4/07 */
 	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 */
 	0
 };
 
@@ -1545,6 +1547,9 @@
 	dt_dirpath_t *dirp;
 	int i;
 
+	if (dtp->dt_procs != NULL)
+		dt_proc_hash_destroy(dtp);
+
 	while ((pgp = dt_list_next(&dtp->dt_programs)) != NULL)
 		dt_program_destroy(dtp, pgp);
 
@@ -1573,9 +1578,6 @@
 	while ((pvp = dt_list_next(&dtp->dt_provlist)) != NULL)
 		dt_provider_destroy(dtp, pvp);
 
-	if (dtp->dt_procs != NULL)
-		dt_proc_hash_destroy(dtp);
-
 	if (dtp->dt_fd != -1)
 		(void) close(dtp->dt_fd);
 	if (dtp->dt_ftfd != -1)

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

@@ -768,7 +768,13 @@
 		assert(dpr != NULL);
 		(void) pthread_mutex_lock(&dpr->dpr_lock);
 
-		err = dt_pid_create_pid_probes(pdp, dtp, pcb, dpr);
+		if ((err = dt_pid_create_pid_probes(pdp, dtp, pcb, dpr)) == 0) {
+			/*
+			 * Alert other retained enablings which may match
+			 * against the newly created probes.
+			 */
+			(void) dt_ioctl(dtp, DTRACEIOC_ENABLE, NULL);
+		}
 
 		(void) pthread_mutex_unlock(&dpr->dpr_lock);
 		dt_proc_release(dtp, P);

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

@@ -18,8 +18,9 @@
  *
  * CDDL HEADER END
  */
+
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -212,6 +213,7 @@
 	dt_node_t *nnp = cnp ? cnp->dn_list : NULL;
 	int found;
 	dt_lib_depend_t *dld;
+	char lib[MAXPATHLEN];
 
 	if (cnp == NULL || nnp == NULL ||
 	    cnp->dn_kind != DT_NODE_IDENT || nnp->dn_kind != DT_NODE_IDENT) {
@@ -225,29 +227,53 @@
 		dt_module_t *mp = dt_module_lookup_by_name(dtp, nnp->dn_string);
 		found = mp != NULL && dt_module_getctf(dtp, mp) != NULL;
 	} else if (strcmp(cnp->dn_string, "library") == 0) {
-
-		/*
-		 * We have the file we are working on in dtp->dt_filetag
-		 * so find that node and add the dependency in.
-		 */
 		if (yypcb->pcb_cflags & DTRACE_C_CTL) {
-			char lib[MAXPATHLEN];
+			assert(dtp->dt_filetag != NULL);
 
+			/*
+			 * We have the file we are working on in dtp->dt_filetag
+			 * so find that node and add the dependency in.
+			 */
 			dld = dt_lib_depend_lookup(&dtp->dt_lib_dep,
 			    dtp->dt_filetag);
 			assert(dld != NULL);
 
-			(void) snprintf(lib, MAXPATHLEN, "%s%s",
+			(void) snprintf(lib, sizeof (lib), "%s%s",
 			    dld->dtld_libpath, nnp->dn_string);
 			if ((dt_lib_depend_add(dtp, &dld->dtld_dependencies,
 			    lib)) != 0) {
 				xyerror(D_PRAGMA_DEPEND,
-				    "failed to add dependency %s:%s\n",
-				    lib,
+				    "failed to add dependency %s:%s\n", lib,
 				    dtrace_errmsg(dtp, dtrace_errno(dtp)));
 			}
+		} else {
+			/*
+			 * By this point we have already performed a topological
+			 * sort of the dependencies; we process this directive
+			 * as satisfied as long as the dependency was properly
+			 * loaded.
+			 */
+			if (dtp->dt_filetag == NULL)
+				xyerror(D_PRAGMA_DEPEND, "main program may "
+				    "not explicitly depend on a library");
+
+			dld = dt_lib_depend_lookup(&dtp->dt_lib_dep,
+			    dtp->dt_filetag);
+			assert(dld != NULL);
+
+			(void) snprintf(lib, sizeof (lib), "%s%s",
+			    dld->dtld_libpath, nnp->dn_string);
+			dld = dt_lib_depend_lookup(&dtp->dt_lib_dep_sorted,
+			    lib);
+			assert(dld != NULL);
+
+			if (!dld->dtld_loaded)
+				xyerror(D_PRAGMA_DEPEND, "program requires "
+				    "library \"%s\" which failed to load",
+				    lib);
 		}
-		found = 1;
+
+		found = B_TRUE;
 	} else {
 		xyerror(D_PRAGMA_INVAL, "invalid class %s "
 		    "specified by #pragma %s\n", cnp->dn_string, prname);

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

@@ -3886,15 +3886,15 @@
 			break;
 		}
 
-		if (nargs <= 2)
-			remaining = (int64_t)size;
-
 		if (!DTRACE_INSCRATCH(mstate, size)) {
 			DTRACE_CPUFLAG_SET(CPU_DTRACE_NOSCRATCH);
 			regs[rd] = 0;
 			break;
 		}
 
+		if (nargs <= 2)
+			remaining = (int64_t)size;
+
 		if (index < 0) {
 			index += len;
 
@@ -3904,18 +3904,20 @@
 			}
 		}
 
-		if (index >= len || index < 0)
-			index = len;
+		if (index >= len || index < 0) {
+			remaining = 0;
+		} else if (remaining < 0) {
+			remaining += len - index;
+		} else if (index + remaining > size) {
+			remaining = size - index;
+		}
 
-		for (d[0] = '\0'; remaining > 0; remaining--) {
-			if ((d[i++] = dtrace_load8(s++ + index)) == '\0')
+		for (i = 0; i < remaining; i++) {
+			if ((d[i] = dtrace_load8(s + index + i)) == '\0')
 				break;
+		}
 
-			if (i == size) {
-				d[i - 1] = '\0';
-				break;
-			}
-		}
+		d[i] = '\0';
 
 		mstate->dtms_scratch_ptr += size;
 		regs[rd] = (uintptr_t)d;
@@ -3986,9 +3988,9 @@
 		 * explained to them, and who can't even concisely describe
 		 * the conditions under which one would be forced to resort to
 		 * this technique.  Needless to say, those conditions are
-		 * found here -- and probably only here.  Is this is the only
-		 * use of this infamous trick in shipping, production code?
-		 * If it isn't, it probably should be...
+		 * found here -- and probably only here.  Is this the only use
+		 * of this infamous trick in shipping, production code?  If it
+		 * isn't, it probably should be...
 		 */
 		if (minor != -1) {
 			uintptr_t maddr = dtrace_loadptr(daddr +
@@ -11408,33 +11410,6 @@
 	mutex_exit(&cpu_lock);
 }
 
-static int
-dtrace_enabling_matchstate(dtrace_state_t *state, int *nmatched)
-{
-	dtrace_enabling_t *enab;
-	int matched, total = 0, err;
-
-	ASSERT(MUTEX_HELD(&cpu_lock));
-	ASSERT(MUTEX_HELD(&dtrace_lock));
-
-	for (enab = dtrace_retained; enab != NULL; enab = enab->dten_next) {
-		ASSERT(enab->dten_vstate->dtvs_state != NULL);
-
-		if (enab->dten_vstate->dtvs_state != state)
-			continue;
-
-		if ((err = dtrace_enabling_match(enab, &matched)) != 0)
-			return (err);
-
-		total += matched;
-	}
-
-	if (nmatched != NULL)
-		*nmatched = total;
-
-	return (0);
-}
-
 /*
  * If an enabling is to be enabled without having matched probes (that is, if
  * dtrace_state_go() is to be called on the underlying dtrace_state_t), the
@@ -15649,13 +15624,9 @@
 		 * cue to reevaluate our enablings.
 		 */
 		if (arg == NULL) {
-			mutex_enter(&cpu_lock);
-			mutex_enter(&dtrace_lock);
-			err = dtrace_enabling_matchstate(state, rv);
-			mutex_exit(&dtrace_lock);
-			mutex_exit(&cpu_lock);
+			dtrace_enabling_matchall();
 
-			return (err);
+			return (0);
 		}
 
 		if ((dof = dtrace_dof_copyin(arg, &rval)) == NULL)

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

@@ -20,7 +20,7 @@
  */
 
 /*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -390,7 +390,7 @@
 
 /*
  * This is called from cfork() via dtrace_fasttrap_fork(). The child
- * process's address space is a (roughly) a copy of the parent process's so
+ * process's address space is (roughly) a copy of the parent process's so
  * we have to remove all the instrumentation we had previously enabled in the
  * parent.
  */
@@ -437,6 +437,15 @@
 			    tp->ftt_proc->ftpc_acount != 0) {
 				int ret = fasttrap_tracepoint_remove(cp, tp);
 				ASSERT(ret == 0);
+
+				/*
+				 * 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
+				 * mid-fork.
+				 */
+				ASSERT(tp->ftt_proc->ftpc_acount != 0);
 			}
 		}
 		mutex_exit(&bucket->ftb_mtx);
@@ -517,6 +526,12 @@
 again:
 	mutex_enter(&bucket->ftb_mtx);
 	for (tp = bucket->ftb_data; tp != NULL; tp = tp->ftt_next) {
+		/*
+		 * Note that it's safe to access the active count on the
+		 * associated proc structure because we know that at least one
+		 * provider (this one) will still be around throughout this
+		 * operation.
+		 */
 		if (tp->ftt_pid != pid || tp->ftt_pc != pc ||
 		    tp->ftt_proc->ftpc_acount == 0)
 			continue;
@@ -1157,6 +1172,7 @@
 			mutex_exit(&bucket->ftb_mtx);
 			fprc->ftpc_rcount++;
 			atomic_add_64(&fprc->ftpc_acount, 1);
+			ASSERT(fprc->ftpc_acount <= fprc->ftpc_rcount);
 			mutex_exit(&fprc->ftpc_mtx);

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list