summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_ktr.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2012-08-30 21:22:47 +0000
committerattilio <attilio@FreeBSD.org>2012-08-30 21:22:47 +0000
commitec1be6b9d0937e659de30fed1f58b7ae8c8835e7 (patch)
tree24953b4f84c8662937a81c8de85c1958e947a4c2 /sys/kern/kern_ktr.c
parent37d20a17c00900e79a4f93e9ab22cf6aad6ab469 (diff)
downloadFreeBSD-src-ec1be6b9d0937e659de30fed1f58b7ae8c8835e7.zip
FreeBSD-src-ec1be6b9d0937e659de30fed1f58b7ae8c8835e7.tar.gz
Post r222812 KTR_CPUMASK started being initialized only as a tunable
handler and not more statically. Unfortunately, it seems that this is not ideal for new platform bringup and boot low level development (which needs ktr_cpumask to be effective before tunables can be setup). Because of this, add a way to statically initialize cpusets, by passing an list of initializers, divided by commas. Also, provide a way to enforce an all-set mask, for above mentioned initializers. This imposes some differences on how KTR_CPUMASK is setup now as a kernel option, and in particular this makes the words specifications backward wrt. what is currently in -CURRENT. In order to avoid mismatches between KTR_CPUMASK definition and other way to setup the mask (tunable, sysctl) and to print it, change the ordering how cpusetobj_print() and cpusetobj_scan() acquire the words belonging to the set. Please give a look to sys/conf/NOTES in order to understand how the new format is supposed to work. Also, ktr manpages will be updated shortly by gjb which volountereed for this. This patch won't be merged because it changes a POLA (at least from the theoretical standpoint) and this is however a patch that proves to be effective only in development environments. Requested by: rpaulo Reviewed by: jeff, rpaulo
Diffstat (limited to 'sys/kern/kern_ktr.c')
-rw-r--r--sys/kern/kern_ktr.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c
index 6adca69..738b05a 100644
--- a/sys/kern/kern_ktr.c
+++ b/sys/kern/kern_ktr.c
@@ -70,6 +70,10 @@ __FBSDID("$FreeBSD$");
#define KTR_MASK (0)
#endif
+#ifndef KTR_CPUMASK
+#define KTR_CPUMASK CPUSET_FSET
+#endif
+
#ifndef KTR_TIME
#define KTR_TIME get_cyclecount()
#endif
@@ -99,7 +103,7 @@ int ktr_version = KTR_VERSION;
SYSCTL_INT(_debug_ktr, OID_AUTO, version, CTLFLAG_RD,
&ktr_version, 0, "Version of the KTR interface");
-cpuset_t ktr_cpumask;
+cpuset_t ktr_cpumask = CPUSET_T_INITIALIZER(KTR_CPUMASK);
static char ktr_cpumask_str[CPUSETBUFSIZ];
TUNABLE_STR("debug.ktr.cpumask", ktr_cpumask_str, sizeof(ktr_cpumask_str));
@@ -107,12 +111,6 @@ static void
ktr_cpumask_initializer(void *dummy __unused)
{
- CPU_FILL(&ktr_cpumask);
-#ifdef KTR_CPUMASK
- if (cpusetobj_strscan(&ktr_cpumask, KTR_CPUMASK) == -1)
- CPU_FILL(&ktr_cpumask);
-#endif
-
/*
* TUNABLE_STR() runs with SI_ORDER_MIDDLE priority, thus it must be
* already set, if necessary.
OpenPOWER on IntegriCloud