Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 May 2011 23:50:21 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r222235 - in projects/largeSMP/sys: conf kern sparc64/include sys
Message-ID:  <201105232350.p4NNoLut042995@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Mon May 23 23:50:21 2011
New Revision: 222235
URL: http://svn.freebsd.org/changeset/base/222235

Log:
  Revert a patch that unvolountary sneaked in while I was MFCing.

Modified:
  projects/largeSMP/sys/conf/NOTES
  projects/largeSMP/sys/kern/kern_cpuset.c
  projects/largeSMP/sys/kern/kern_ktr.c
  projects/largeSMP/sys/sparc64/include/ktr.h
  projects/largeSMP/sys/sys/cpuset.h
  projects/largeSMP/sys/sys/ktr.h

Modified: projects/largeSMP/sys/conf/NOTES
==============================================================================
--- projects/largeSMP/sys/conf/NOTES	Mon May 23 23:35:50 2011	(r222234)
+++ projects/largeSMP/sys/conf/NOTES	Mon May 23 23:50:21 2011	(r222235)
@@ -441,7 +441,7 @@ options 	KTR
 options 	KTR_ENTRIES=1024
 options 	KTR_COMPILE=(KTR_INTR|KTR_PROC)
 options 	KTR_MASK=KTR_INTR
-options 	KTR_CPUMASK=("0x3")
+options 	KTR_CPUMASK=0x3
 options 	KTR_VERBOSE
 
 #

Modified: projects/largeSMP/sys/kern/kern_cpuset.c
==============================================================================
--- projects/largeSMP/sys/kern/kern_cpuset.c	Mon May 23 23:35:50 2011	(r222234)
+++ projects/largeSMP/sys/kern/kern_cpuset.c	Mon May 23 23:50:21 2011	(r222235)
@@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/cpuset.h>
 #include <sys/sx.h>
 #include <sys/queue.h>
-#include <sys/libkern.h>
 #include <sys/limits.h>
 #include <sys/bus.h>
 #include <sys/interrupt.h>
@@ -661,41 +660,6 @@ cpusetobj_strprint(char *buf, const cpus
 }
 
 /*
- * Build a valid cpuset_t object from a string representation.
- * It expects an incoming buffer at least sized as CPUSETBUFSIZ.
- */
-int
-cpusetobj_strscan(cpuset_t *set, const char *buf)
-{
-	u_int nwords;
-	int i;
-
-	if (strlen(buf) > CPUSETBUFSIZ - 1)
-		return (-1);
-
-	/* Allow to pass a shorter version of the mask when necessary. */
-	nwords = 1;
-	for (i = 0; buf[i] != '\0'; i++)
-		if (buf[i] == ',')
-			nwords++;
-	if (nwords > _NCPUWORDS)
-		return (-1);
-
-	CPU_ZERO(set);
-	for (i = nwords - 1; i > 0; i--) {
-		if (!sscanf(buf, "%lx, ", &set->__bits[i]))
-			return (-1);
-		buf = strstr(buf, " ");
-		if (buf == NULL)
-			return (-1);
-		buf++;
-	}
-	if (!sscanf(buf, "%lx", &set->__bits[0]))
-		return (-1);
-	return (0);
-}
-
-/*
  * Apply an anonymous mask to a single thread.
  */
 int

Modified: projects/largeSMP/sys/kern/kern_ktr.c
==============================================================================
--- projects/largeSMP/sys/kern/kern_ktr.c	Mon May 23 23:35:50 2011	(r222234)
+++ projects/largeSMP/sys/kern/kern_ktr.c	Mon May 23 23:50:21 2011	(r222235)
@@ -40,10 +40,8 @@ __FBSDID("$FreeBSD$");
 #include "opt_alq.h"
 
 #include <sys/param.h>
-#include <sys/queue.h>
 #include <sys/alq.h>
 #include <sys/cons.h>
-#include <sys/cpuset.h>
 #include <sys/kernel.h>
 #include <sys/ktr.h>
 #include <sys/libkern.h>
@@ -70,6 +68,10 @@ __FBSDID("$FreeBSD$");
 #define	KTR_MASK	(0)
 #endif
 
+#ifndef KTR_CPUMASK
+#define	KTR_CPUMASK	(~0)
+#endif
+
 #ifndef KTR_TIME
 #define	KTR_TIME	get_cyclecount()
 #endif
@@ -82,10 +84,10 @@ FEATURE(ktr, "Kernel support for KTR ker
 
 SYSCTL_NODE(_debug, OID_AUTO, ktr, CTLFLAG_RD, 0, "KTR options");
 
-static char ktr_cpumask[CPUSETBUFSIZ];
-TUNABLE_STR("debug.ktr.cpumask", ktr_cpumask, sizeof(ktr_cpumask));
-SYSCTL_STRING(_debug_ktr, OID_AUTO, cpumask, CTLFLAG_RW, ktr_cpumask,
-    sizeof(ktr_cpumask), "Bitmask of CPUs on which KTR logging is enabled");
+int	ktr_cpumask = KTR_CPUMASK;
+TUNABLE_INT("debug.ktr.cpumask", &ktr_cpumask);
+SYSCTL_INT(_debug_ktr, OID_AUTO, cpumask, CTLFLAG_RW,
+    &ktr_cpumask, 0, "Bitmask of CPUs on which KTR logging is enabled");
 
 int	ktr_mask = KTR_MASK;
 TUNABLE_INT("debug.ktr.mask", &ktr_mask);
@@ -196,7 +198,6 @@ ktr_tracepoint(u_int mask, const char *f
     u_long arg1, u_long arg2, u_long arg3, u_long arg4, u_long arg5,
     u_long arg6)
 {
-	cpuset_t intern_cpumask;
 	struct ktr_entry *entry;
 #ifdef KTR_ALQ
 	struct ale *ale = NULL;
@@ -211,16 +212,8 @@ ktr_tracepoint(u_int mask, const char *f
 		return;
 	if ((ktr_mask & mask) == 0)
 		return;
-#ifndef KTR_CPUMASK
-	CPU_FILL(&intern_cpumask);
-#else
-	if (ktr_cpumask[0] == '\0')
-		strncpy(ktr_cpumask, KTR_CPUMASK, sizeof(ktr_cpumask));
-	if (cpusetobj_strscan(&intern_cpumask, ktr_cpumask) == -1)
-		return;
-#endif
 	cpu = KTR_CPU;
-	if (!CPU_ISSET(cpu, &intern_cpumask))
+	if (((1 << cpu) & ktr_cpumask) == 0)
 		return;
 #if defined(KTR_VERBOSE) || defined(KTR_ALQ)
 	td = curthread;

Modified: projects/largeSMP/sys/sparc64/include/ktr.h
==============================================================================
--- projects/largeSMP/sys/sparc64/include/ktr.h	Mon May 23 23:35:50 2011	(r222234)
+++ projects/largeSMP/sys/sparc64/include/ktr.h	Mon May 23 23:50:21 2011	(r222235)
@@ -85,9 +85,7 @@ l2:	add	r2, 1, r3 ; \
 	lduw	[PCPU(MID)], r1 ; \
 	mov	1, r2 ; \
 	sllx	r2, r1, r1 ; \
-#if 0
 	TEST(ktr_cpumask, r1, r2, r3, l3) ; \
-#endif
 	ATR(desc, r1, r2, r3, l1, l2)
 
 #endif /* LOCORE */

Modified: projects/largeSMP/sys/sys/cpuset.h
==============================================================================
--- projects/largeSMP/sys/sys/cpuset.h	Mon May 23 23:35:50 2011	(r222234)
+++ projects/largeSMP/sys/sys/cpuset.h	Mon May 23 23:50:21 2011	(r222235)
@@ -216,7 +216,6 @@ int	cpuset_create_root(struct prison *, 
 int	cpuset_setproc_update_set(struct proc *, struct cpuset *);
 int	cpusetobj_ffs(const cpuset_t *);
 char	*cpusetobj_strprint(char *, const cpuset_t *);
-int	cpusetobj_strscan(cpuset_t *, const char *);
 
 #else
 __BEGIN_DECLS

Modified: projects/largeSMP/sys/sys/ktr.h
==============================================================================
--- projects/largeSMP/sys/sys/ktr.h	Mon May 23 23:35:50 2011	(r222234)
+++ projects/largeSMP/sys/sys/ktr.h	Mon May 23 23:50:21 2011	(r222235)
@@ -107,6 +107,7 @@ struct ktr_entry {
 	u_long	ktr_parms[KTR_PARMS];
 };
 
+extern int ktr_cpumask;
 extern int ktr_mask;
 extern int ktr_entries;
 extern int ktr_verbose;



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