Add debug.verbose_sysinit tunable for VERBOSE_SYSINIT

VERBOSE_SYSINIT is currently an all-or-nothing option. debug.verbose_sysinit
adds an option to have the code compiled in but quiet by default so that
getting this information from a device in the field doesn't necessarily
require distributing a recompiled kernel.

Its default is VERBOSE_SYSINIT's value as defined in the kernconf. As such,
the default behavior for simply omitting or including this option is
unchanged.

MFC after:	1 week
This commit is contained in:
Kyle Evans 2018-06-20 19:23:56 +00:00
parent 14c5b433cf
commit c7962400c9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=335458

View File

@ -119,6 +119,18 @@ int bootverbose = BOOTVERBOSE;
SYSCTL_INT(_debug, OID_AUTO, bootverbose, CTLFLAG_RW, &bootverbose, 0,
"Control the output of verbose kernel messages");
#ifdef VERBOSE_SYSINIT
/*
* We'll use the defined value of VERBOSE_SYSINIT from the kernel config to
* dictate the default VERBOSE_SYSINIT behavior. Significant values for this
* option and associated tunable are:
* - 0, 'compiled in but silent by default'
* - 1, 'compiled in but verbose by default' (default)
*/
int verbose_sysinit = VERBOSE_SYSINIT;
TUNABLE_INT("debug.verbose_sysinit", &verbose_sysinit);
#endif
#ifdef INVARIANTS
FEATURE(invariants, "Kernel compiled with INVARIANTS, may affect performance");
#endif
@ -268,7 +280,7 @@ mi_startup(void)
continue;
#if defined(VERBOSE_SYSINIT)
if ((*sipp)->subsystem > last) {
if ((*sipp)->subsystem > last && verbose_sysinit != 0) {
verbose = 1;
last = (*sipp)->subsystem;
printf("subsystem %x\n", last);