PERFORCE change 134573 for review

John Birrell jb at FreeBSD.org
Thu Jan 31 19:44:43 PST 2008


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

Change 134573 by jb at jb_freebsd1 on 2008/02/01 03:44:08

	Remove my debugging sysctls. I haven't needed to use them this
	time around, so I assume that I'm not calling and function from
	the probe context that the DTrace design says I'm not supposed
	to.

Affected files ...

.. //depot/projects/dtrace/src/sys/cddl/dev/fbt/fbt.c#7 edit
.. //depot/projects/dtrace7/src/sys/cddl/dev/fbt/fbt.c#2 edit

Differences ...

==== //depot/projects/dtrace/src/sys/cddl/dev/fbt/fbt.c#7 (text+ko) ====

@@ -52,7 +52,6 @@
 #include <sys/selinfo.h>
 #include <sys/smp.h>
 #include <sys/syscall.h>
-#include <sys/sysctl.h>
 #include <sys/sysent.h>
 #include <sys/sysproto.h>
 #include <sys/uio.h>
@@ -64,23 +63,6 @@
 MALLOC_DECLARE(M_FBT);
 MALLOC_DEFINE(M_FBT, "fbt", "Function Boundary Tracing");
 
-SYSCTL_DECL(_debug_dtrace);
-int	fbt_debug = 0;
-int	fbt_filter_0 = 0;
-int	fbt_filter_1 = 0;
-int	fbt_filter_2 = 0;
-int	fbt_filter_3 = 0;
-int	fbt_filter_len = 0;
-char	fbt_filter_str[64];
-TUNABLE_INT("debug.dtrace.fbt_debug", &fbt_debug);
-SYSCTL_INT(_debug_dtrace, OID_AUTO, fbt_debug, CTLFLAG_RW, &fbt_debug, 0, "");
-SYSCTL_INT(_debug_dtrace, OID_AUTO, fbt_filter_0, CTLFLAG_RW, &fbt_filter_0, 0, "");
-SYSCTL_INT(_debug_dtrace, OID_AUTO, fbt_filter_1, CTLFLAG_RW, &fbt_filter_1, 0, "");
-SYSCTL_INT(_debug_dtrace, OID_AUTO, fbt_filter_2, CTLFLAG_RW, &fbt_filter_2, 0, "");
-SYSCTL_INT(_debug_dtrace, OID_AUTO, fbt_filter_3, CTLFLAG_RW, &fbt_filter_3, 0, "");
-SYSCTL_INT(_debug_dtrace, OID_AUTO, fbt_filter_len, CTLFLAG_RW, &fbt_filter_len, 0, "");
-SYSCTL_STRING(_debug_dtrace, OID_AUTO, fbt_filter_str, CTLFLAG_RW, fbt_filter_str, 0, "");
-
 #define	FBT_PUSHL_EBP		0x55
 #define	FBT_MOVL_ESP_EBP0_V0	0x8b
 #define	FBT_MOVL_ESP_EBP1_V0	0xec
@@ -244,39 +226,6 @@
 		return (0);
 	}
 
-	/*
-	 * These filters are set by sysctl to help debugging the initial
-	 * port of this provider. Normally the wildcard would be 
-	 * specified to dtrace via the probe name (e.g. fbt::abc*:entry)
-	 * rather than using these. However, to apply a filter to narrow
-	 * the problem down while running Sun's tests, it is easier to
-	 * set these filters rather than have to modify the tests all the
-	 * time.
-	 */
-	if (fbt_filter_0 != 0) {
-		if (name[0] != fbt_filter_0)
-			return (0);
-		if (fbt_filter_1 != 0) {
-			if (name[1] != fbt_filter_1)
-				return (0);
-			if (fbt_filter_2 != 0) {
-				if (name[2] != fbt_filter_2)
-					return (0);
-				if (fbt_filter_3 != 0) {
-					if (name[3] != fbt_filter_3)
-						return (0);
-				}
-			}
-		}
-	}
-
-	/*
-	 * This is an alternate form of filter. The one above is easier to
-	 * set from a shell script though.
-	 */
-	if (fbt_filter_len > 0 && strncmp(name, fbt_filter_str, fbt_filter_len) != 0)
-		return (0);
-
 	size = symval->size;
 
 	instr = (u_int8_t *) symval->value;
@@ -552,8 +501,6 @@
 	}
 
 	for (; fbt != NULL; fbt = fbt->fbtp_next) {
-		if (fbt_debug)
-			printf("fbt_enable %s\n",fbt->fbtp_name);
 		*fbt->fbtp_patchpoint = fbt->fbtp_patchval;
 	}
 }

==== //depot/projects/dtrace7/src/sys/cddl/dev/fbt/fbt.c#2 (text+ko) ====

@@ -52,7 +52,6 @@
 #include <sys/selinfo.h>
 #include <sys/smp.h>
 #include <sys/syscall.h>
-#include <sys/sysctl.h>
 #include <sys/sysent.h>
 #include <sys/sysproto.h>
 #include <sys/uio.h>
@@ -64,23 +63,6 @@
 MALLOC_DECLARE(M_FBT);
 MALLOC_DEFINE(M_FBT, "fbt", "Function Boundary Tracing");
 
-SYSCTL_DECL(_debug_dtrace);
-int	fbt_debug = 0;
-int	fbt_filter_0 = 0;
-int	fbt_filter_1 = 0;
-int	fbt_filter_2 = 0;
-int	fbt_filter_3 = 0;
-int	fbt_filter_len = 0;
-char	fbt_filter_str[64];
-TUNABLE_INT("debug.dtrace.fbt_debug", &fbt_debug);
-SYSCTL_INT(_debug_dtrace, OID_AUTO, fbt_debug, CTLFLAG_RW, &fbt_debug, 0, "");
-SYSCTL_INT(_debug_dtrace, OID_AUTO, fbt_filter_0, CTLFLAG_RW, &fbt_filter_0, 0, "");
-SYSCTL_INT(_debug_dtrace, OID_AUTO, fbt_filter_1, CTLFLAG_RW, &fbt_filter_1, 0, "");
-SYSCTL_INT(_debug_dtrace, OID_AUTO, fbt_filter_2, CTLFLAG_RW, &fbt_filter_2, 0, "");
-SYSCTL_INT(_debug_dtrace, OID_AUTO, fbt_filter_3, CTLFLAG_RW, &fbt_filter_3, 0, "");
-SYSCTL_INT(_debug_dtrace, OID_AUTO, fbt_filter_len, CTLFLAG_RW, &fbt_filter_len, 0, "");
-SYSCTL_STRING(_debug_dtrace, OID_AUTO, fbt_filter_str, CTLFLAG_RW, fbt_filter_str, 0, "");
-
 #define	FBT_PUSHL_EBP		0x55
 #define	FBT_MOVL_ESP_EBP0_V0	0x8b
 #define	FBT_MOVL_ESP_EBP1_V0	0xec
@@ -244,39 +226,6 @@
 		return (0);
 	}
 
-	/*
-	 * These filters are set by sysctl to help debugging the initial
-	 * port of this provider. Normally the wildcard would be 
-	 * specified to dtrace via the probe name (e.g. fbt::abc*:entry)
-	 * rather than using these. However, to apply a filter to narrow
-	 * the problem down while running Sun's tests, it is easier to
-	 * set these filters rather than have to modify the tests all the
-	 * time.
-	 */
-	if (fbt_filter_0 != 0) {
-		if (name[0] != fbt_filter_0)
-			return (0);
-		if (fbt_filter_1 != 0) {
-			if (name[1] != fbt_filter_1)
-				return (0);
-			if (fbt_filter_2 != 0) {
-				if (name[2] != fbt_filter_2)
-					return (0);
-				if (fbt_filter_3 != 0) {
-					if (name[3] != fbt_filter_3)
-						return (0);
-				}
-			}
-		}
-	}
-
-	/*
-	 * This is an alternate form of filter. The one above is easier to
-	 * set from a shell script though.
-	 */
-	if (fbt_filter_len > 0 && strncmp(name, fbt_filter_str, fbt_filter_len) != 0)
-		return (0);
-
 	size = symval->size;
 
 	instr = (u_int8_t *) symval->value;
@@ -552,8 +501,6 @@
 	}
 
 	for (; fbt != NULL; fbt = fbt->fbtp_next) {
-		if (fbt_debug)
-			printf("fbt_enable %s\n",fbt->fbtp_name);
 		*fbt->fbtp_patchpoint = fbt->fbtp_patchval;
 	}
 }


More information about the p4-projects mailing list